]> git.lyx.org Git - features.git/commitdiff
Fix bug #8238: correct the forward argument of replace2string() in on_replacePB_click...
authorStephan Witt <switt@lyx.org>
Thu, 26 Jul 2012 22:34:17 +0000 (00:34 +0200)
committerStephan Witt <switt@lyx.org>
Thu, 26 Jul 2012 22:34:17 +0000 (00:34 +0200)
src/frontends/qt4/GuiSpellchecker.cpp
src/frontends/qt4/Menus.cpp

index e65e22346cca8179be72634fb51401e113ede81a..98eaace14abcb44076886240e2a76adb00d02f3b 100644 (file)
@@ -457,8 +457,13 @@ void SpellcheckerWidget::on_replacePB_clicked()
                return;
        docstring const textfield = qstring_to_ucs4(d->ui.wordED->text());
        docstring const replacement = qstring_to_ucs4(d->ui.replaceCO->currentText());
-       docstring const datastring = replace2string(replacement, textfield,
-               true, true, false, false);
+       docstring const datastring = 
+               replace2string(replacement, textfield,
+                       true,   // case sensitive
+                       true,   // match word
+                       false,  // all words
+                       true,   // forward
+                       false); // find next
 
        LYXERR(Debug::GUI, "Replace (" << replacement << ")");
        dispatch(FuncRequest(LFUN_WORD_REPLACE, datastring));
@@ -474,8 +479,13 @@ void SpellcheckerWidget::on_replaceAllPB_clicked()
                return;
        docstring const textfield = qstring_to_ucs4(d->ui.wordED->text());
        docstring const replacement = qstring_to_ucs4(d->ui.replaceCO->currentText());
-       docstring const datastring = replace2string(replacement, textfield,
-               true, true, true, true);
+       docstring const datastring =
+               replace2string(replacement, textfield,
+                       true,   // case sensitive
+                       true,   // match word
+                       true,   // all words
+                       true,   // forward
+                       false); // find next
 
        LYXERR(Debug::GUI, "Replace all (" << replacement << ")");
        dispatch(FuncRequest(LFUN_WORD_REPLACE, datastring));
index 40a4f575e36a9ec56b835c3c6383e00e1df2841a..8bea71082191f962b5c15a36ce1942892aedcc36 100644 (file)
@@ -783,7 +783,11 @@ void MenuDefinition::expandSpellingSuggestions(BufferView const * bv)
                                        MenuItem w(MenuItem::Command, toqstr(suggestion),
                                                FuncRequest(LFUN_WORD_REPLACE,
                                                        replace2string(suggestion, selection,
-                                                               true, true, false, true, false)));
+                                                               true,     // case sensitive
+                                                               true,     // match word
+                                                               false,    // all words
+                                                               true,     // forward
+                                                               false))); // find next
                                        if (i < m)
                                                add(w);
                                        else