fix undo in tabular cells (bug 1808)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10115 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2005-07-01 12:36:28 +00:00
parent 883decc7da
commit 3cfdaf0a9a
4 changed files with 17 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2005-07-01 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* 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 <martin.vermeer@hut.fi>

View File

@ -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_;
}

View File

@ -267,10 +267,11 @@ public:
///
friend std::istream &
operator>>(std::istream & is, StableDocIterator & cur);
///
friend bool
operator==(StableDocIterator const &, StableDocIterator const &);
private:
std::vector<CursorSlice> data_;
};
bool operator==(StableDocIterator const &, StableDocIterator const &);
#endif

View File

@ -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)