gnucash maint: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Sat Jun 12 19:48:21 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/985a6420 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/6aa35ea7 (commit)
	from  https://github.com/Gnucash/gnucash/commit/9eeff5dd (commit)



commit 985a6420fce4a828ac6b8b255fba6e5e776ded93
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Jun 12 16:47:35 2021 -0700

    Bug 798196 - not building with Boost 1.76

diff --git a/libgnucash/engine/gnc-numeric.cpp b/libgnucash/engine/gnc-numeric.cpp
index c1b5969b2..c1142a546 100644
--- a/libgnucash/engine/gnc-numeric.cpp
+++ b/libgnucash/engine/gnc-numeric.cpp
@@ -24,24 +24,21 @@
 
 #include <glib.h>
 
+#include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cstdint>
+#include <sstream>
+#include <boost/regex.hpp>
+#include <boost/locale/encoding_utf.hpp>
+
 extern "C"
 {
 #include <config.h>
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
 #include "qof.h"
 }
 
-#include <stdint.h>
-#include <boost/regex.hpp>
-#include <boost/locale/encoding_utf.hpp>
-#include <sstream>
-#include <cstdlib>
-
 #include "gnc-numeric.hpp"
 #include "gnc-rational.hpp"
 

commit 6aa35ea7fb9e9facba6d0dd6525ffaa7f65e78ad
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Jun 12 16:42:10 2021 -0700

    Better fix for bug 798204, doesn't break trading account selection.

diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp
index 5cea5e022..154ff1936 100644
--- a/libgnucash/engine/Account.cpp
+++ b/libgnucash/engine/Account.cpp
@@ -3145,6 +3145,18 @@ gnc_account_lookup_by_type_and_commodity (Account* root,
             retval = g_list_prepend(retval, account);
         }
     }
+
+    if (!retval) // Recurse through the children
+        for (auto node = rpriv->children; node; node = node->next)
+        {
+            auto account{static_cast<Account*>(node->data)};
+            auto result = gnc_account_lookup_by_type_and_commodity(account,
+                                                                   name,
+                                                                   acctype,
+                                                                   commodity);
+            if (result)
+                retval = g_list_concat(result, retval);
+        }
     return retval;
 }
 
diff --git a/libgnucash/engine/Scrub.c b/libgnucash/engine/Scrub.c
index 78e9652be..88965cefb 100644
--- a/libgnucash/engine/Scrub.c
+++ b/libgnucash/engine/Scrub.c
@@ -1453,19 +1453,6 @@ xaccScrubUtilityGetOrMakeAccount (Account *root, gnc_commodity * currency,
 
     g_return_val_if_fail (root, NULL);
 
-    /* If we're looking for a name, search the whole hierarchy for the name */
-
-    if (checkname)
-    {
-        if (!accname)
-            return NULL;
-        acc = gnc_account_lookup_by_name (root, accname);
-        return acc ? acc :  construct_account (root, currency, accname,
-                                               acctype, placeholder);
-    }
-    /* Otherwise search just the current level. This is used to build
-     * a hierarchy directly under the root account for trading accounts.
-     */
     acc_list =
         gnc_account_lookup_by_type_and_commodity (root,
                                                   checkname ? accname : NULL,



Summary of changes:
 libgnucash/engine/Account.cpp     | 12 ++++++++++++
 libgnucash/engine/Scrub.c         | 13 -------------
 libgnucash/engine/gnc-numeric.cpp | 21 +++++++++------------
 3 files changed, 21 insertions(+), 25 deletions(-)



More information about the gnucash-changes mailing list