Boost::date_time has changed to throwing a std::out_of_range instead of a
boost::date_time::gregorian::bad_year when a date is outside of the
1400-9999 year range it can deal with.
We also recently discovered that it will use the system localtime function
when creating a new date which can lead to a 2038 failure. Use std::chrono
to resolve that problem.
* apply_xmlnode_text (node, f, optional default_val)
retrieves text; and calls and returns f(text)
on failure (i.e. node==null || node has no text), it returns default_val
* apply_xmlnode_text (node, obj, f)
retrieves text; and calls and returns f(obj, text)
on success, it will return true, on failure it returns false
Avoids allocating/g_free temporary strings when DOM text
exists. Replaces dom_tree_to_text() with dom_node_to_text() fast-path
for Account, Transaction, and Split string setters.
dom_tree_to_commodity_ref() is called for every transaction or
price. It created and destroyed a commodity only to read its namespace
and mnemonic when loading books. Rewrite to avoid creating temporary
commodity.
dom_tree_to_commodity_ref_no_engine () is called when creating
commodities.
Introduce get_commodity_ns_mnemonic() to parse namespace/mnemonic
directly, and use it in both code paths.
Instead of capitalized versions of the variables in gnc-filepath-utils.
The environment variables are documented in the wiki and are what the user
can change.
this optimisation will greatly reduce the search size. first, sort
splits by reverse absolute amount. then precompute the positive and
negative sum(amounts) of remaining splits. when exploring any branch,
if the target is falls outside the range remaining negative to
positive sums, then any combination of subsequent splits will not
reach target. bail early.
https://lists.gnucash.org/pipermail/gnucash-user/2025-November/118103.html
reported that GnuCash crashes when he runs it with GNC_HOME=<somewhere
random>. We use GNC_HOME to set XDG_DATA_DIR in the environment file to
accommodate relocating GnuCash on macOS and Windows and GnuCash crashes
when the schemas aren't found.
This commit prevents the user from setting the 6 special environment
variables either from the environment or by editing the environment file.
instead of vice-versa.
- avoids malloc/free in gnc_gdate_set_today
- avoids unnecessary dmy->julian->dmy(*) conversion
(*) the GDate is typically used by gdate_to_time64 which performs a
julian->dmy conversion, and this is now avoided
Fixes a generic bug in gnc_module_init_backend_dbi() when HAVE_LIBDBI_R is defined. Specifically, when the initial dbi_initialize_r() returns no drivers, the dbi_instance variable is still set.