Root cause is using boost::locale::translate because it ignores
the LANGUAGES environment variable and doesn't support different
values for LC_MESSAGES, LC_DATE, LC_MONETARY, and LC_NUMERIC.
That makes it impossible to configure a user environment that
presents translated strings in a different locale from the one
applied to formatting dates and numbers.
To correct this replace all use of boost::locale::translate
with GNU gettext.
Don't create a new book in the new-user dialog unless the user says to.
Don't automatically create a new book when retrieving default commodities
because the retrieve might be requested in a context like the Preferences
dialog when there is no book.
Some report tests relied on requesting the default commodity creating
the book, so in those tests ensure that the book is created first.
Control character check doesn't need normalization, the control character
codepoints aren't graphic and so can't be composed nor have compatible
equivalents.
There were two issues here, the first one was that the copied doclink
was pointing to the original doclink which lead to a double-free. The
second is the setting of the doclink on the copied invoice needs to be
done with gncInvoiceSetDocLink otherwise on closure the doclink value
will disappear.
- avoid hashing Account* twice. one call to operator[] is sufficient.
- don't need use std::move with better constructors
- sanity check - can't have a budget with num_periods = 0
- remove unused headers
- don't need to create/destroy GHashTable for each feature query
- plugs leak: g_hash_table_unref (features_used) not always called properly
- to check 1 feature, don't need to traverse whole GHashTable
With XCode 14 or newer CMake tries to use the "new build system" which has a
requirement that if two targets depend on the same generated file one of them
must depend on the other. This commit adds reduntant dependencies to satisfy
this requirement.
Because when loading the value the split in the xml backend doesn't yet
have a parent so the code tried to convert to GNC_COMMODITY_MAX_FRACTION
and if the numerator was larger than 10^10 that would overflow.
To fix it this changes the "don't know" response to get_currency_denom
and get_commodity_denom to GNC_DENOM_AUTO which will normally leave
the denominator alone.
Handle template transactions that don't have any splits with empty credit
and debit strings and those having no set transaction account.
Set the concrete transaction commodity to the first found of:
The template transaction's commodity
The commodity of the first split with a credit or debit string
The commodity of the first split.
Test these scheduled transactions:
* 2 splits with fixed amounts "123"
* 2 splits with fixed amounts "0"
* 2 splits with empty amounts ""
Verify that automatically created scheduled transactions exist.
The root cause of which is that on recent releases of GLib (recent
meaning 2.66 in the current Debian stable!) g_type_instance_get_private
looks in the wrong place for the private data. When running the script
in question it returned NULL and since the code didn't check for a valid
pointer, it crashed.
So this change replaces all calls to g_type_instance_get_private with
the function [type_prefix]_get_instance_private() added in glib-2.36
except for two register2 files that have been removed from master; those
are ignored to avoid unnecessary merge conflicts.
This scrubbing function calls xaccTransRollbackEdit which is
leaky. Instead of trying to fix xaccTransRollbackEdit which requires
superhuman skills, it's easiest to track the changes separately in a
GList, and use xaccTransBeginEdit/xaccTransCommitEdit only if
necessary.
tests TXN_TYPE_NONE in utest-Transaction.c
testing TXN_TYPE_INVOICE, TXN_TYPE_PAYMENT, and TXN_TYPE_LINK will
require valid posted invoices, so, are best tested in utest-Invoice.c