diff --git a/src/ChangeLog b/src/ChangeLog index 9f7913d402..747c2561d4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2005-07-01 Jürgen Spitzmüller + + * dociterator.[Ch]: implement operator==(StableDocIterator const &, + StableDocIterator const &) + * undo.C (recordUndo): use the above instead of cell.size() comparison + (fixes bug 1808; instructed by André). 2005-06-29 Martin Vermeer diff --git a/src/dociterator.C b/src/dociterator.C index 53a0d2ebc7..596a0a119f 100644 --- a/src/dociterator.C +++ b/src/dociterator.C @@ -540,3 +540,10 @@ std::ostream & operator<<(std::ostream & os, StableDocIterator const & dit) os << " " << dit.data_[i] << "\n"; return os; } + + +bool operator==(StableDocIterator const & dit1, StableDocIterator const & dit2) +{ + return dit1.data_ == dit2.data_; +} + diff --git a/src/dociterator.h b/src/dociterator.h index 33fd32cab3..9106f8dde9 100644 --- a/src/dociterator.h +++ b/src/dociterator.h @@ -267,10 +267,11 @@ public: /// friend std::istream & operator>>(std::istream & is, StableDocIterator & cur); + /// + friend bool + operator==(StableDocIterator const &, StableDocIterator const &); private: std::vector data_; }; -bool operator==(StableDocIterator const &, StableDocIterator const &); - #endif diff --git a/src/undo.C b/src/undo.C index 1517cf6360..bb600dd118 100644 --- a/src/undo.C +++ b/src/undo.C @@ -73,7 +73,7 @@ void recordUndo(Undo::undo_kind kind, if (!undo_finished && kind != Undo::ATOMIC && !stack.empty() - && stack.top().cell.size() == undo.cell.size() + && stack.top().cell == undo.cell && stack.top().kind == undo.kind && stack.top().from == undo.from && stack.top().end == undo.end)