Commit Graph

2106 Commits

Author SHA1 Message Date
Richard Cohen
958e9a4d6f Valgrind: fix "Invalid read" in test-exp-parser
The pointer passed to the gfec exception handler is
not valid after the exception handler ends

==382525== Invalid read of size 1
==382525==    at 0x484B050: memcpy@GLIBC_2.2.5 (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==382525==    by 0x531AB67: __printf_buffer_write (Xprintf_buffer_write.c:39)
==382525==    by 0x5322CD4: __printf_buffer (vfprintf-process-arg.c:501)
==382525==    by 0x53465F3: __vasprintf_internal (vasprintf.c:102)
==382525==    by 0x499C8C1: g_vasprintf (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==382525==    by 0x4969BE0: g_strdup_vprintf (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==382525==    by 0x494B2F6: g_logv (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==382525==    by 0x494B7A2: g_log (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==382525==    by 0x4862862: func_op (gnc-exp-parser.c:342)
==382525==    by 0x485D381: primary_exp (expression_parser.c:1222)
==382525==    by 0x485CE0F: multiply_divide_op (expression_parser.c:1028)
==382525==    by 0x485CC33: add_sub_op (expression_parser.c:968)
==382525==  Address 0xad387ec is 764 bytes inside a block of size 766 free'd
==382525==    at 0x484620F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==382525==    by 0x4861D9B: gfec_apply (gfec.c:145)
==382525==    by 0x4862813: func_op (gnc-exp-parser.c:339)
==382525==    by 0x485D381: primary_exp (expression_parser.c:1222)
==382525==    by 0x485CE0F: multiply_divide_op (expression_parser.c:1028)
==382525==    by 0x485CC33: add_sub_op (expression_parser.c:968)
==382525==    by 0x485C9DE: assignment_op (expression_parser.c:886)
==382525==    by 0x485C101: parse_string (expression_parser.c:605)
==382525==    by 0x4862F07: gnc_exp_parser_parse_separate_vars (gnc-exp-parser.c:535)
==382525==    by 0x4862D60: gnc_exp_parser_parse (gnc-exp-parser.c:475)
==382525==    by 0x10A963: run_parser_test (test-exp-parser.c:94)
==382525==    by 0x10AB99: run_parser_tests (test-exp-parser.c:144)
==382525==  Block was alloc'd at
==382525==    at 0x4843738: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==382525==    by 0x4A81473: scm_realloc (in /usr/lib/x86_64-linux-gnu/libguile-3.0.so.1.5.0)
==382525==    by 0x4AEEF70: scm_to_utf8_stringn (in /usr/lib/x86_64-linux-gnu/libguile-3.0.so.1.5.0)
==382525==    by 0x55AA71F: gnc_scm_to_utf8_string (gnc-guile-utils.c:42)
==382525==    by 0x4861D4E: gfec_apply (gfec.c:136)
==382525==    by 0x4862813: func_op (gnc-exp-parser.c:339)
==382525==    by 0x485D381: primary_exp (expression_parser.c:1222)
==382525==    by 0x485CE0F: multiply_divide_op (expression_parser.c:1028)
==382525==    by 0x485CC33: add_sub_op (expression_parser.c:968)
==382525==    by 0x485C9DE: assignment_op (expression_parser.c:886)
==382525==    by 0x485C101: parse_string (expression_parser.c:605)
==382525==    by 0x4862F07: gnc_exp_parser_parse_separate_vars (gnc-exp-parser.c:535)
2023-06-20 10:20:44 +01:00
Vincent Dawans
b514245c22 Bug 798952 - Unable to set day threshold or counters in properties
Make sure counter values are retrieved as int; allow counter back
to zero; fix voucher default value.
2023-06-19 19:23:04 -07:00
Christopher Lam
b331ec974e [gnc-gsettings.cpp] plug a char* leak
full_name leaks if it's already in schema_hash hash table. It would be
better to convert GHashTable to unordered_map.
2023-06-20 09:21:49 +08:00
Richard Cohen
2e861ab673 Valgrind: fix "Mismatched free/delete" - test-dom-converters1
==32195== Mismatched free() / delete / delete []
==32195==    at 0x484620F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==32195==    by 0x146DB5: test_dom_tree_to_guid() (test-dom-converters1.cpp:251)
...
==32195==  Address 0x8043780 is 0 bytes inside a block of size 16 alloc'd
==32195==    at 0x4843FA3: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==32195==    by 0x503E06E: guid_malloc (guid.cpp:106)
==32195==    by 0x503E0D5: guid_copy (guid.cpp:123)
==32195==    by 0x503E1E7: guid_new (guid.cpp:154)
==32195==    by 0x147188: get_random_guid (test-engine-stuff.cpp:207)
==32195==    by 0x146D03: test_dom_tree_to_guid() (test-dom-converters1.cpp:237)
...
2023-06-19 13:53:24 +01:00
Richard Cohen
e5a26e3c77 Valgrind: fix "Mismatched free/delete" - test-query
==31803== Mismatched free() / delete / delete []
==31803==    at 0x484620F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==31803==    by 0x1198CB: make_trans_query (test-engine-stuff.cpp:2030)
==31803==    by 0x115898: test_trans_query(transaction_s*, void*) (test-query.cpp:40)
...
==31803==  Address 0x7fed160 is 0 bytes inside a block of size 16 alloc'd
==31803==    at 0x4843FA3: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==31803==    by 0x4E3706E: guid_malloc (guid.cpp:106)
==31803==    by 0x4E370D5: guid_copy (guid.cpp:123)
==31803==    by 0x4E371E7: guid_new (guid.cpp:154)
==31803==    by 0x115D64: get_random_guid (test-engine-stuff.cpp:207)
==31803==    by 0x11984C: make_trans_query (test-engine-stuff.cpp:2023)
...
2023-06-19 13:53:24 +01:00
Richard Cohen
4018ff1722 Valgrind: fix "Mismatched free/delete" - test-kvp-frames etc.
- test-kvp-frames
- test-xml-account
- test-xml-transaction
- test-account-object
- test-group-vs-book
- test-lots
- test-query
- test-import-pending-matches

==30223== Mismatched free() / delete / delete []
==30223==    at 0x4846AFF: operator delete(void*, unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==30223==    by 0x4E370AA: guid_free (guid.cpp:116)
...
==30223==  Address 0x7ea4390 is 0 bytes inside a block of size 16 alloc'd
==30223==    at 0x4843828: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==30223==    by 0x5032948: g_malloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==30223==    by 0x11603A: get_random_guid (test-engine-stuff.cpp:209)
...
2023-06-19 13:53:24 +01:00
John Ralls
241aa1d2eb Merge Richard Cohen's 'remove-unneeded-memcpy' into stable. 2023-06-17 17:58:53 -07:00
John Ralls
aae568eca6 Add comment explaining "option.template get_value<int>()". 2023-06-17 16:58:03 -07:00
John Ralls
4dc8a7ee0d Bug 798952 - Unable to set day threshold or counters in properties
Make counters explicitly integer type and adjust the kvp load and save functions
to recognize that and behave accordingly so that other range options like day
threshold aren't affected.
2023-06-17 16:49:52 -07:00
John Ralls
827bfabd69 Merge Richard Cohen's 'declare-type-gnc-plugin' into stable. 2023-06-16 12:42:42 -07:00
Richard Cohen
3abc9a5558 Refactor: Remove some unnecessary uses of memcpy
- Also, remove unnecessary "static" in gnucash-style.c

The second one in guid.cpp is UB:

libgnucash/engine/guid.cpp:137:5: warning: undefined behavior, source object type 'const gnc::GUID' is not TriviallyCopyable [bugprone-undefined-memory-manipulation]
        memcpy (&target, &source, sizeof (GncGUID));
        ^
2023-06-15 11:10:58 +01:00
Christopher Lam
4a60e01fcd bugfix xaccTransGetTxnType: avoid returning TXN_TYPE_LINK incorrectly
A TXN_TYPE_PAYMENT will have non-APAR splits; a TXN_TYPE_LINK will not
have non-APAR splits. This bug manifests as a regular TXN_TYPE_PAYMENT
transaction being later voided being incorrectly changed to
TXN_TYPE_LINK.
2023-06-14 18:29:00 +08:00
Richard Cohen
1255d61917 Refactor: hide implementation of GncPlugin* (move from .h -> .c) 2023-06-14 11:03:37 +01:00
Richard Cohen
2e59bda951 Refactor: DECLARE_FINAL GncPluginExample < GncPlugin
- Fix the name
2023-06-14 11:03:37 +01:00
John Ralls
0d1ba1ebe7 Merge Richard Cohen's 'y2038-fixes' into stable. 2023-06-12 14:44:11 -07:00
Christopher Lam
8ec6a4cb12 [Scrub.c] 8628ca8715 rewritten to avoid QofQuery
because QofQuery will include the blank transaction which must not be
scrubbed.
2023-06-12 23:59:37 +08:00
Richard Cohen
7d26b8c05f Fail the test if still using 32bit time_t in 2038
gtest-gnc-option.cpp and gtest-gnc-optiondb.cpp need to call
time() for g_date_set_time_t()
2023-06-08 14:30:32 +01:00
Richard Cohen
d63248dad2 Update Y2038 comments 2023-06-08 14:30:28 +01:00
Christopher Lam
3ccb5c4896 Merge branch 'wordsmithing' into stable #1658 2023-06-07 22:00:06 +08:00
John Ralls
dda661cfd2 Merge Richard Cohen's 'more-define-types' into stable. 2023-06-06 21:27:36 -07:00
Christopher Lam
f580a6cf2d [gnc-ui-balances.c] better wording for balance limits 2023-06-07 08:49:01 +08:00
John Ralls
a5ff19b62a Merge Richard Cohen's 'fix-incorrect-logging-after-fallthrough' into stable. 2023-06-06 14:59:05 -07:00
Richard Cohen
6e5c525f77 Use gnc_time() instead of time() 2023-06-06 15:40:36 +01:00
Richard Cohen
fde90c4c99 Restore test-gnc-option
- removed in merge 3e5fcc8709

To get it to compile

- remove unused variables
- remove duplicate operator==(GncGUID)
2023-06-06 15:34:07 +01:00
Richard Cohen
a0fd9af394 Fix incorrect logging after switch fallthrough
oops
2023-06-06 15:16:39 +01:00
Christopher Lam
ccc75cfc88 Merge branch 'scrub-optimize' into stable 2023-06-04 07:58:31 +08:00
Christopher Lam
81902ba8bb [scrub.c] xaccTransScrubSplits calls Begin/Commit only if required 2023-06-02 18:01:08 +08:00
Christopher Lam
872e20c555 move xaccTransScrubSplits to Scrub.c
it's defined in Scrub.h anyway
2023-06-01 20:28:01 +08:00
Richard Cohen
680fe47bac Refactor: Remove unused macros GNC_BASIC_GOBJECT_* 2023-06-01 10:32:02 +01:00
Christopher Lam
9047156017 [Scrub.c] refactor xaccAccountTreeScrubOrphans 2023-05-31 19:34:28 +08:00
Christopher Lam
8628ca8715 [Scrub.c] refactor xaccAccountTreeScrubImbalance
The scrubbing routines are transaction oriented. Instead of
xaccAccountTreeScrubImbalance calling xaccAccountScrubImbalance for
each descendant, refactor so that the transaction list is generated
only once. The scrubbing is faster and progress bar is more accurate.
2023-05-31 09:26:58 +08:00
Christopher Lam
d214b2f05d Merge Vincent Dawans' branch 'bug798879' into stable #1617 2023-05-30 22:41:05 +08:00
Vincent Dawans
1c04e744d3 [trep-engine.scm] Rename "Totals" option to "Grand Total" 2023-05-29 20:01:11 -07:00
John Ralls
dd5be317d8 Merge Richard Cohen's 'define-type' into stable. 2023-05-27 10:09:05 -04:00
John Ralls
6111184c73 Ensure incorrectly coded counter KVP is read correctly.
Bug 798930 caused some counters to be saved as KVP double. If the
correct int64_t value isn't found when reading, or if a double is
encountered when loading the option dialog, get the double value
and cast it to int64_t.
2023-05-26 21:24:06 -04:00
John Ralls
7d5663899c Bug 798930 - invoices wont sequence to the next number
Because KVP can't magically cast between int64_t and double.
2023-05-26 20:41:13 -04:00
Richard Cohen
5d955654bc Refactor: DEFINE_TYPE GncSxInstanceModel < GObject 2023-05-26 13:34:09 +01:00
John Ralls
3d30e5978a Merge Richard Cohen's 'define-boxed' into stable. 2023-05-25 10:50:08 -04:00
Richard Cohen
ae9304efb0 Remove unused boxed type gnc_value_list 2023-05-25 14:42:28 +01:00
Richard Cohen
f9efbf86c6 Remove unused Qofbook::ab-templates property 2023-05-25 14:42:28 +01:00
John Ralls
8a5b3721df Merge Richard Cohen's 'remove-duplicate-define-type-code' into stable. 2023-05-24 11:25:16 -04:00
Mike Alexander
6bdaa161eb Redo 71afa3e0 and 71afa3e0 so powten(max_leg_digits) is 1e18
This is what it was before 71afa3e0.  This is the largest power of
ten that fits in an int64.
2023-05-22 15:24:26 -04:00
Christopher Lam
89f7e8933b gnc_list_all_paths returns std::vector instead of GList of EnvPaths
because its consumers are now cpp there's no need to return a GList.
2023-05-22 09:45:33 +08:00
Richard Cohen
2db5004a22 Remove code that duplicates features of G_DEFINE_TYPE
- declarations of *_init, *_class_init
- implementation of *_parent_class

- also, removed unnecessary NULL checks for destroy, dispose, finalize
2023-05-21 15:21:33 +01:00
Richard Cohen
eb2d5df778 Refactor: DEFINE_BOXED GncGUID 2023-05-21 15:20:18 +01:00
Richard Cohen
c514f61a7a Refactor: DEFINE_BOXED Time64 2023-05-21 15:20:18 +01:00
Richard Cohen
14f2efcfb7 Refactor: DEFINE_BOXED gnc_numeric 2023-05-21 15:20:18 +01:00
John Ralls
bba49a6d09 Fix test-gnc-euro failure.
Fixing the pow[] array required also adjusting the number of
denominator digits when converting doubles to gnc_numerics.
2023-05-19 20:14:58 -05:00
Mike Alexander
71afa3e0fc Make the GncNumeric string constructtor work for long decimal numbers.
It was failing to produce a correct representation for input with more than
14 digits after the decimal poin.  Fixes Bug 798916.  The bug was in
powten so this fix may corect other problems too.  For example conversion
of GncNumeric back to a string also failed in certain circumsances.
2023-05-18 17:42:44 -04:00
Mike Alexander
d61b962954 Fix a typo in some debug output. 2023-05-18 17:34:05 -04:00
John Ralls
8ccc6da87e Merge Richard Cohen's 'fix-test-engine-crash' into stable. 2023-05-17 21:20:44 -05:00
John Ralls
26162da450 Merge Richard Cohen's 'cleanup-build' into stable. 2023-05-17 21:16:09 -05:00
John Ralls
46e9fcf037 Merge Richard Cohen's 'cleanup-ui-files' into stable. 2023-05-17 12:18:54 -05:00
Richard Cohen
81fba56bbb Initialise guids in test-engine-kvp-properties.c
Valgrind: Conditional jump or move depends on uninitialised value(s)
2023-05-15 20:03:23 +01:00
Richard Cohen
bed43c7f3b Fix potential crash in test-engine
==515314== Invalid read of size 1
==515314==    at 0x484AD67: __strcmp_sse42 (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==515314==    by 0x171D36: do_test_list_handler (unittest-support.c:181)
==515314==    by 0x171DCE: test_list_handler (unittest-support.c:197)
==515314==    by 0x51BD4C1: g_logv (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==515314==    by 0x51BD7A2: g_log (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==515314==    by 0x4D5D0D9: xaccSplitEqualCheckBal (Split.c:753)
==515314==    by 0x4D5D841: xaccSplitEqual (Split.c:869)
==515314==    by 0x4D647A5: xaccTransEqual (Transaction.c:981)
==515314==    by 0x15C0E8: test_xaccTransEqual(Fixture*, void const*) (utest-Transaction.cpp:901)
...
==515314==  Address 0x8725260 is 0 bytes inside a block of size 59 free'd
==515314==    at 0x484620F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==515314==    by 0x15BDB1: test_xaccTransEqual(Fixture*, void const*) (utest-Transaction.cpp:883)
...
==515314==  Block was alloc'd at
==515314==    at 0x4843828: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==515314==    by 0x5618677: __vasprintf_internal (vasprintf.c:116)
==515314==    by 0x520E8C1: g_vasprintf (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==515314==    by 0x51DBBE0: g_strdup_vprintf (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==515314==    by 0x51DBC9C: g_strdup_printf (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==515314==    by 0x15BBAC: test_xaccTransEqual(Fixture*, void const*) (utest-Transaction.cpp:879)
...

ok 78 /engine/Transaction/xaccTransEqual
2023-05-15 20:03:23 +01:00
Richard Cohen
dc62959553 Fix crash in test-engine on Arch
Thanks, Valgrind:

==515314== Invalid read of size 8
==515314==    at 0x4ED46F3: gncInvoiceRemoveEntries (gncInvoice.c:767)
==515314==    by 0x142B35: teardown_with_invoice (utest-Invoice.c:274)
...
==515314==  Address 0x8557b98 is 8 bytes inside a block of size 24 free'd
==515314==    at 0x484620F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==515314==    by 0x51B565D: g_list_remove (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==515314==    by 0x4ED42EF: gncInvoiceRemoveEntry (gncInvoice.c:688)
==515314==    by 0x4ED46A2: gncInvoiceRemoveEntries (gncInvoice.c:781)
==515314==    by 0x142B35: teardown_with_invoice (utest-Invoice.c:274)
...
==515314==  Block was alloc'd at
==515314==    at 0x4843828: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==515314==    by 0x51BD948: g_malloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==515314==    by 0x51B1CB9: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==515314==    by 0x4ED4271: gncInvoiceAddEntry (gncInvoice.c:676)
==515314==    by 0x142401: setup_with_invoice (utest-Invoice.c:142)
...

ok 57 /engine/gncInvoice/post trans - vendor bill
2023-05-15 20:03:23 +01:00
Richard Cohen
3c34a61776 Remove #pragma ... "-Wformat-nonliteral"
Seems to have been accidentally left behind when time64_to_string()
was (re)moved
2023-05-15 13:21:30 +01:00
Richard Cohen
1f43bbc798 Remove #pragma ..."-Wstrict-aliasing"
G_LOCK was fixed in glib 2.19.8

See https://bugzilla.gnome.org/show_bug.cgi?id=316221
2023-05-15 13:21:30 +01:00
Richard Cohen
80e9d9c35d scanf supports %lld since C++11, C99 2023-05-15 13:21:30 +01:00
Richard Cohen
7f1ce2b5e5 Remove references to cutecash 2023-05-15 13:21:29 +01:00
Richard Cohen
b3e3eb3166 By default, filter out online_wiggle in test-gnc-quotes
The test relies on a lot of external dependencies
- installed finance-quote-wrapper
- alpha vantage key
- network
- working remote server

Running ./bin/test-gnc-quotes from the command line
will still include online_wiggle
2023-05-14 14:25:01 +01:00
Richard Cohen
1fe097bd5f Update gnc-plugin-example-ui.xml 2023-05-14 14:09:59 +01:00
Richard Cohen
4df662afae Fix the typo in function name "new_query_for_addresss" 2023-05-13 13:08:07 +01:00
Richard Cohen
3957272ef0 Fix some typos in comments 2023-05-13 13:00:25 +01:00
John Ralls
9b95419608 Fix glib include. 2023-05-11 11:56:23 -07:00
John Ralls
d696f0cfcb Bug 798885 - Accented character in folder name on Account Export (bis)
Pass a boost::filesystem's c_str() rv to the ofstream constructor to
keep libstdc++ from transcoding it back to UTF8 and creating a broken
name or failing to match the directory name. Implemented in
gnc-filepath-utils to avoid spreading the boost::filesystem dependency
throughout the code base.

See https://github.com/boostorg/filesystem/issues/181 for why other
approaches don't work.
2023-05-08 13:35:21 -07:00
John Ralls
bb423e4484 Merge CrfzdPQM6's 'b_betterCurrencyBudgetReporting' into stable. 2023-04-29 12:04:45 -07:00
Daniel Johnson
04b0317119 Demonstrate fx handling in budget report 2023-04-29 12:01:36 -07:00
John Ralls
df878c6a3d Merge Maarten Bosmans's 'memleak-fixes' into stable. 2023-04-29 11:54:41 -07:00
Maarten Bosmans
71802b5627 [test] Fix memory leak in test-gnc-quotes
When the commodity table is registered, the current book will get
a default table assigned.  When later setting the table explicitly
using qof_book_set_data() the exisiting table gets overwritten and
is thus leaked.

There is no way of removing or freeing a currency table from a book,
so the best we can do here is to set our own table on the book before
calling gnc_commodity_table_register().
2023-04-29 11:52:12 -07:00
Maarten Bosmans
6be682b645 Store allocated temporaries in a variable so they can be freed
If a function that returns an allocated pointer is passed directly into
something that does not take ownership of the pointer, the allocation is
leaked.  This can be fixed by assigning the pointer to a new variable
and freeing it after operation on the memory.
2023-04-29 11:51:43 -07:00
Christopher Lam
1a7fcb69c0 [gnc-features.cpp] remove_if requires <algorithm> 2023-04-29 08:17:22 +08:00
John Ralls
8481f062d4 Create obsolete features list with first member book_currency.
Obsolete features set in the book will be removed from the book's
KVP and ignored. Note the warning in the comment!
2023-04-28 17:08:04 -07:00
John Ralls
0d175dce12 Refactor gnc-features.
* type aliases to gnc-features.h
* string_views to avoid copying (all of the strings are static)
* qof_book_get_unknown_features returns a FeatureSet
2023-04-28 16:31:07 -07:00
John Ralls
e8c80f2f5c Restore existence, but not implementation, of GNC_FEATURE_BOOK_CURRENCY.
At least one user has managed to get it set on their book so even
though it was supposed to be unimplemented it got through somehow.
Restoring it allows books with it set to load.
2023-04-28 14:15:59 -07:00
John Ralls
9ff2362bb0 Merge Muhammadyusuf Kurbanov's 'uz-currency-fix' into stable. 2023-04-28 12:50:48 -07:00
Robert Fewell
fb58959f9a Bug 798885 - Accented character in folder name on Account Export
Changed export_coa to use g_fopen instead of fopen
2023-04-28 09:55:57 +01:00
Muhammadyusuf
02e24ccf96
edit: use &apos; instead of ` symbol 2023-04-24 02:04:35 +05:00
Muhammadyusuf
dca596ac84
edit: Fix local symbol of uzbek sum 2023-04-24 01:49:23 +05:00
Christopher Lam
e26c3d6cf4 [gnc-ui-balances.c] gnc_ui_account_get_balance_limit_explanation
returns a char* explanation, or NULL
2023-04-22 14:22:40 +08:00
Vincent Dawans
761d7f29a5 Bug 765920 - Running balance not accurate when sorted different ways
- Renamed option to "Account Balance" to avoid confusion with running
  total.
- Added helper function to ensure running balance and balance forward
  are only shown when transaction are grouped by account and sorted as
  in register. In that case column heading remains "Running Balance"
  and balance forward is shown. Otherwwise column heading is renamed
  "Account Balance" and balance forward is not shown.
- Also added missing code for Common Currency conversion.
2023-04-21 09:13:16 -07:00
John Ralls
4a5b897d89 Bug 798863 - Crash on clicking Settings button second time
Ensure that dialog resources stored in options are freed when the
dialog is destroyed.

The crash happened when a new dialog replaced the old one on the options
and the old one's destructors tried to access a dangling reference to
a GtkWidget.
2023-04-20 20:08:38 -07:00
John Ralls
f4f481fe38 Bug 798812 - crashes after I open a customer report and select…
Edit/Report Options

As a result of auto instead of auto& in a std::visit call which
resulted in a temporary option whose GncOwner* was destroyed before
we could use it.
2023-04-15 13:29:40 -07:00
Robert Fewell
0d84506a5e Bug 798851 - Account Balance 'include subaccounts' not saved
The defaults for the account were removed by mistake in a previous
commit, added them back.
2023-04-12 11:20:32 +01:00
John Ralls
2f471e65a7 Bug 798802 - Online Price quote - Stocks not working GNU 5.0 Windows Bis
The previous change of the delimiter between namespace and symbol
is needed in both overloads of GncQuoteImpl::query_fq.

Also log the query json string to ease future troubleshooting.
2023-04-09 15:24:53 -07:00
Maarten Bosmans
0d86be6d2a [test] Properly destroy resources on end of tests
This fixes memory leaks that are only present in testing code.
Not very useful on itself, but it does make it easier to fix memory
leaks and other AddressSanitizer problems in actual gnucash code later.
2023-04-02 21:12:50 +02:00
Maarten Bosmans
ed3fe00880 [test] Use test fixture to initialize and destroy resources 2023-04-02 21:12:50 +02:00
Maarten Bosmans
35aeed45ec [engine] Remove two replace functions from KvpValue
These were not used outside a test.

And that test was not leak free, as a result of the functions not doing
what they are supposed to do when the current value is not of the type
that is expected. (NULL is returned, but the value is not replaced)
2023-04-02 21:12:50 +02:00
Maarten Bosmans
bd94965d9b [backend/xml] Remove unused string copy 2023-04-02 21:12:50 +02:00
Richard Cohen
6ba5bb326a Fix dereference of expired temporaries.
Reported by clang 15.0.7, which will be in Ubuntu 23.04, -Wdangling-gsl
2023-03-31 11:27:33 -07:00
Richard Cohen
9fa2a48fe1 Fix build on gcc-8 & 9.
See https://lists.gnucash.org/pipermail/gnucash-devel/2023-March/046617.html
2023-03-30 18:25:23 -07:00
John Ralls
0d598d51ed Fix Finance::Quote use on Win32.
By dealing with Win32 \r\n newlines on return from finance-quote-wrapper.
2023-03-30 16:45:01 -07:00
John Ralls
a587dfff2c Bug 798802 - Online Price quote - Stocks not working GNU 5.0 Windows
Change the property-tree path delimiter for constructing paths from
'.' that's commonly used in stock symbols, to '|' that isn't.
2023-03-29 20:01:10 -07:00
Christopher Lam
bdf79f7721 Merge branch 'master-fileopen-filter' into stable #1576 2023-03-27 12:48:52 +08:00
John Ralls
89f41a305c Merge new potfile reflecting string changes. 2023-03-24 14:28:24 -07:00
John Ralls
576fc9b52c Fix quotes on Windows.
Boost process wchar_t conversion chokes if it's fed an empty string.
This would happen when the user had no alphavantage key. Separate
the process invocation to not present the empty value to boost process.
2023-03-19 10:32:26 -07:00
John Ralls
90e1e2d1c3 Merge Bob Fewell's 'bug798558' into master. 2023-03-19 10:11:42 -07:00
John Ralls
0c3e85404d Avoid crash from trying to free an unallocated char*. 2023-03-19 10:09:01 -07:00
Christopher Lam
97f0653238 [gnc-quotes] g_free a char* from gnc_prefs_get_string
ultimately gets char* from g_settings_get_string and must be freed
2023-03-20 00:40:41 +08:00
Robert Fewell
a576dd87a4 Bug798558 - Irregular line spacing in Account Tree View
When securities are in the list, the rows look twice as high as though
there is a linefeed at the end. This is partly due to commit for bug
797501 which worked at the time but a change in pango 50.4 to do with
wrapping has highlighted this bug.

To fix this only wrap currencies with ltr bidi isolate characters in
gnc_print_amount_with_bidi_ltr_isolate
2023-03-19 13:53:41 +00:00