From ae74ac9d4ce1b620fa75e4c04bb4e147679cb23f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Tue, 1 Jun 2010 07:33:08 +0000 Subject: [PATCH] * GuiSpellchecker.cpp: revert r33567 abd thereby fix bug #6708. No status entry needed, since this was already fixed in 1.6.6.1. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@34567 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiSpellchecker.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/frontends/qt4/GuiSpellchecker.cpp b/src/frontends/qt4/GuiSpellchecker.cpp index 1e5a6887b5..4120b8145e 100644 --- a/src/frontends/qt4/GuiSpellchecker.cpp +++ b/src/frontends/qt4/GuiSpellchecker.cpp @@ -20,7 +20,6 @@ #include "BufferView.h" #include "Cursor.h" #include "CutAndPaste.h" -#include "FuncRequest.h" #include "Language.h" #include "LyXRC.h" #include "Paragraph.h" @@ -466,21 +465,16 @@ void GuiSpellchecker::replace(docstring const & replacement) { LYXERR(Debug::GUI, "GuiSpellchecker::replace(" << to_utf8(replacement) << ")"); - /* - Slight hack ahead: we want to use the dispatch machinery - (see bug #6217), but self-insert honors the ``auto region - delete'' setting, which is not wanted here. Creating a new - ad-hoc LFUN seems overkill, but it could be an option (JMarc). - */ - bool const ard = lyxrc.auto_region_delete; - lyxrc.auto_region_delete = true; - dispatch(FuncRequest(LFUN_SELF_INSERT, replacement)); - lyxrc.auto_region_delete = ard; + BufferView * bv = const_cast(bufferview()); + if (!bv->cursor().inTexted()) + return; + cap::replaceSelectionWithString(bv->cursor(), replacement, true); + bv->buffer().markDirty(); + // If we used an LFUN, we would not need that + bv->processUpdateFlags(Update::Force | Update::FitCursor); // fix up the count --count_; - // Do nothing if the spellchecker has been terminated already - if (speller_) - check(); + check(); }