]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSpellchecker.cpp
Properly track the lifetime of signals2::slots (#8261)
[lyx.git] / src / frontends / qt4 / GuiSpellchecker.cpp
index e65e22346cca8179be72634fb51401e113ede81a..cbdf4f4893b9947eb427e93846869ed4d017c2f4 100644 (file)
@@ -337,16 +337,16 @@ void SpellcheckerWidget::Private::setSelection(
                Cursor & bvcur = bv->cursor();
                bvcur.setCursor(from);
                bvcur.clearSelection();
-               bvcur.setSelection(true);
+               bvcur.selection(true);
                bvcur.setCursor(end);
-               bvcur.setSelection(true);
+               bvcur.selection(true);
        } else {
                // FIXME LFUN
                // If we used a LFUN, dispatch would do all of this for us
                int const size = end.pos() - from.pos();
                bv->putSelectionAt(from, size, false);
        }
-       bv->processUpdateFlags(Update::Force | Update::FitCursor);      
+       bv->processUpdateFlags(Update::Force | Update::FitCursor);
 }
 
 void SpellcheckerWidget::Private::forward()
@@ -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,12 +479,19 @@ 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));
        d->forward();
+       // replace all wraps around
+       d->wrapAround(true);
        d->check(); // continue spellchecking
        d->canCheck();
 }
@@ -604,7 +616,7 @@ void GuiSpellchecker::updateView()
 Dialog * createGuiSpellchecker(GuiView & lv) 
 { 
        GuiSpellchecker * gui = new GuiSpellchecker(lv, Qt::RightDockWidgetArea);
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
        gui->setFloating(true);
 #endif
        return gui;