gnucash stable: [gnc-tree-container.hpp] bugfix in operator==

Christopher Lam clam at code.gnucash.org
Mon Aug 21 03:34:47 EDT 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/63eae802 (commit)
	from  https://github.com/Gnucash/gnucash/commit/38435a75 (commit)



commit 63eae802a1a70b99f693cd1622e0017a0e7756dd
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Aug 19 19:06:36 2023 +0800

    [gnc-tree-container.hpp] bugfix in operator==
    
    when comparing two GncTreeIter, if they both were end() iterators from
    differing GtkTreeModels they would have been deemed equal. Amend so
    that operator== returns false.

diff --git a/gnucash/gnome-utils/gnc-tree-container.hpp b/gnucash/gnome-utils/gnc-tree-container.hpp
index 433833ff10..1aa2f37ce5 100644
--- a/gnucash/gnome-utils/gnc-tree-container.hpp
+++ b/gnucash/gnome-utils/gnc-tree-container.hpp
@@ -102,6 +102,8 @@ public:
 
     bool operator==(const GncTreeIter& other) const
     {
+        if (m_model != other.m_model)
+            return false;
         if (!m_iter.has_value() && !other.m_iter.has_value())
             return true;
         if (!m_iter.has_value() || !other.m_iter.has_value())



Summary of changes:
 gnucash/gnome-utils/gnc-tree-container.hpp | 2 ++
 1 file changed, 2 insertions(+)



More information about the gnucash-changes mailing list