From 5d0f08d8564258da1c330f35759bb32462c3616a Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 7 Sep 2005 10:00:19 +0000 Subject: [PATCH] fix crash when toggling change tracking off git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10421 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView_pimpl.C | 10 +++++----- src/ChangeLog | 8 ++++++++ src/lyxfind.C | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 0934b42568..01c6f11e9f 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -877,13 +877,13 @@ void BufferView::Pimpl::trackChanges() // We cannot allow undos beyond the freeze point buffer_->undostack().clear(); } else { - update(); - bv_->text()->setCursor(cursor_, 0, 0); -#ifdef WITH_WARNINGS -#warning changes FIXME -#endif + cursor_.setCursor(doc_iterator_begin(buffer_->inset())); bool const found = lyx::find::findNextChange(bv_); if (found) { + // We reset the cursor to the start of the + // document, since the Changes Dialog is going + // to search for the next change anyway. + cursor_.setCursor(doc_iterator_begin(buffer_->inset())); owner_->getDialogs().show("changes"); return; } diff --git a/src/ChangeLog b/src/ChangeLog index fe7cba16f3..a667b441a1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2005-08-04 Jean-Marc Lasgouttes + + * lyxfind.C (findNextChange): tiny cleanup. + + * BufferView_pimpl.C (trackChanges): avoid crash when stopping + change tracking with the cursor in an inset; make sure the first + change is not skipped. + 2005-09-06 Jürgen Spitzmüller * CutAndPaste.[Ch]: new methods dirtyTabularStack and diff --git a/src/lyxfind.C b/src/lyxfind.C index 8fcd49e268..2f16fd3d6c 100644 --- a/src/lyxfind.C +++ b/src/lyxfind.C @@ -339,7 +339,7 @@ bool findNextChange(BufferView * bv) if (!bv->available()) return false; - DocIterator cur = DocIterator(bv->cursor()); + DocIterator cur = bv->cursor(); if (!findChange(cur)) return false;