Author: spitz
Date: Tue Jun  1 09:33:08 2010
New Revision: 34567
URL: http://www.lyx.org/trac/changeset/34567

Log:
* GuiSpellchecker.cpp: revert r33567 abd thereby fix bug #6708.

No status entry needed, since this was already fixed in 1.6.6.1.

Modified:
   lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiSpellchecker.cpp

Modified: lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiSpellchecker.cpp
==============================================================================
--- lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiSpellchecker.cpp       
Tue Jun  1 09:03:14 2010        (r34566)
+++ lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiSpellchecker.cpp       
Tue Jun  1 09:33:08 2010        (r34567)
@@ -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 @@
 {
        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 *>(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();
 }
 
 

Reply via email to