Skip to content

Commit

Permalink
[gnc-tree-container.hpp] bugfix in operator==
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
christopherlam committed Aug 19, 2023
1 parent 38435a7 commit 63eae80
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gnucash/gnome-utils/gnc-tree-container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class GncTreeIter

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())
Expand Down

0 comments on commit 63eae80

Please sign in to comment.