From 3cfdaf0a9ac84222bb3dfc8a36b40b9a034da5b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Fri, 1 Jul 2005 12:36:28 +0000 Subject: [PATCH] fix undo in tabular cells (bug 1808) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10115 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 6 ++++++ src/dociterator.C | 7 +++++++ src/dociterator.h | 5 +++-- src/undo.C | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) 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)