From ed140e7343f6ffe614b833b9c7fde49d09251dfe Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Mon, 4 Jul 2011 18:39:25 +0000 Subject: [PATCH] backport fix for #7661 to branch - check buffer of cursors before using compare operator - avoid assertion git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39245 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiSpellchecker.cpp | 11 +++++++++-- status.20x | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiSpellchecker.cpp b/src/frontends/qt4/GuiSpellchecker.cpp index f6da10a9eb..5e7305e75a 100644 --- a/src/frontends/qt4/GuiSpellchecker.cpp +++ b/src/frontends/qt4/GuiSpellchecker.cpp @@ -79,6 +79,8 @@ struct SpellcheckerWidget::Private return false; } void canCheck() { incheck_ = false; } + /// check for wrap around of current position + bool isWrapAround(DocIterator cursor) const; /// Ui::SpellcheckerUi ui; /// @@ -200,6 +202,11 @@ bool SpellcheckerWidget::Private::continueFromBeginning() return true; } +bool SpellcheckerWidget::Private::isWrapAround(DocIterator cursor) const +{ + return wrap_around_ && start_.buffer() == cursor.buffer() && start_ < cursor; +} + void SpellcheckerWidget::Private::forward() { @@ -216,7 +223,7 @@ void SpellcheckerWidget::Private::forward() //FIXME we must be at the end of a cell dispatch(FuncRequest(LFUN_CHAR_FORWARD)); } - if (wrap_around_ && start_ < bv->cursor()) { + if (isWrapAround(bv->cursor())) { dv_->hide(); } } @@ -397,7 +404,7 @@ void SpellcheckerWidget::Private::check() return; } - if (wrap_around_ && start_ < from) { + if (isWrapAround(from)) { dv_->hide(); return; } diff --git a/status.20x b/status.20x index 0d2911de4a..ce3e1d9482 100644 --- a/status.20x +++ b/status.20x @@ -198,6 +198,9 @@ What's new - Don't assert when accepting/rejecting non-existent changes (bug 7654). +- Fix assertion when using "Ignore All" in spell checker dialog + after changing buffer view (bug 7661). + * ADVANCED FIND AND REPLACE -- 2.39.5