Fix crash related to undo and continuous spell checking

The cursor member new_word_ should not be saved in undo.
Move it from CursorData to Cursor.
This commit is contained in:
Jean-Marc Lasgouttes 2012-12-11 10:14:47 +01:00
parent 945c0e4127
commit 146b754f1d
2 changed files with 4 additions and 2 deletions

View File

@ -286,6 +286,8 @@ void Cursor::reset()
push_back(CursorSlice(buffer()->inset())); push_back(CursorSlice(buffer()->inset()));
anchor_ = doc_iterator_begin(buffer()); anchor_ = doc_iterator_begin(buffer());
anchor_.clear(); anchor_.clear();
new_word_ = doc_iterator_begin(buffer());
new_word_.clear();
clearTargetX(); clearTargetX();
selection_ = false; selection_ = false;
mark_ = false; mark_ = false;

View File

@ -52,8 +52,6 @@ public:
protected: protected:
/// the anchor position /// the anchor position
DocIterator anchor_; DocIterator anchor_;
/// the start of the new born word
DocIterator new_word_;
/// ///
mutable DispatchResult disp_; mutable DispatchResult disp_;
/// do we have a selection? /// do we have a selection?
@ -394,6 +392,8 @@ private:
int x_target_; int x_target_;
/// if a x_target cannot be hit exactly in a text, put the difference here /// if a x_target cannot be hit exactly in a text, put the difference here
int textTargetOffset_; int textTargetOffset_;
/// the start of the new born word
DocIterator new_word_;
/// position before dispatch started /// position before dispatch started
DocIterator beforeDispatchCursor_; DocIterator beforeDispatchCursor_;
/// cursor screen coordinates before dispatch started /// cursor screen coordinates before dispatch started