GLib 2.76 introduced a no-discard warning on g_string_free
if the second parameter is FALSE. This revealed a string
leak and a correct usage that didn't use the return value.
- Show proper amount in dialog when applying or editing an existing transaction as payment
- Be more careful not to waste the existing payment split
- If the user changed the payment amount while starting from an existing transaction
unreconcile the changed payment split
- Avoid needlessly changing transaction currency (only do so if the user chose
a new transfer account and the old currency is neither the new transfer account's
currency nor the post account's currency)
gnc_commodity_compare is used for sorting and so needs to have a less-than
return value. The only place it's used presents nothing to the UI; a GncGUID
ordering is fast and stable.
GnuCash allows only one commodity per book for any namespace/mnemonic pair, so
the exhaustive string comparisons are superflous. While the current engine
design allows only one instance of any object, meaning that a pointer comparison
is sufficient to determine equality, that may not be true in the future, but the
GncGUID is guaranteed to sufficiently identify a single commodity. Note that
gnc_commodity_equiv is used to enforce that single-commodity rule and so cannot
use GncGUID comparison.
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.