]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSpellchecker.cpp
Do not compute caret geometry when we are not ready to do so.
[lyx.git] / src / frontends / qt4 / GuiSpellchecker.cpp
index aa62a9a448ccd7ead8149f010b58cf018c50b69e..537d9d79b50184b8e652d75aac0ab3369db54e2e 100644 (file)
@@ -113,7 +113,7 @@ struct SpellcheckerWidget::Private
        SpellcheckerWidget * p;
        ///
        DockView * dv_;
-       /// 
+       ///
        GuiView * gv_;
        /// current word being checked and lang code
        WordLangTuple word_;
@@ -321,7 +321,7 @@ void SpellcheckerWidget::Private::hide() const
                        // restore cursor position
                        bvcur.setCursor(start_);
                        bvcur.clearSelection();
-                       bv->processUpdateFlags(Update::Force | Update::FitCursor);      
+                       bv->processUpdateFlags(Update::Force | Update::FitCursor);
                }
        }
 }
@@ -333,20 +333,20 @@ void SpellcheckerWidget::Private::setSelection(
        DocIterator end = to;
 
        if (from.pit() != end.pit()) {
-               // there are multiple paragraphs in selection 
+               // there are multiple paragraphs in selection
                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()
@@ -388,7 +388,7 @@ bool SpellcheckerWidget::initialiseParams(std::string const &)
        BufferView * bv = d->gv_->documentBufferView();
        if (bv == 0)
                return false;
-       std::set<Language const *> languages = 
+       std::set<Language const *> languages =
                bv->buffer().masterBuffer()->getLanguages();
        if (!languages.empty())
                d->setLanguage(*languages.begin());
@@ -457,7 +457,7 @@ 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 = 
+       docstring const datastring =
                replace2string(replacement, textfield,
                        true,   // case sensitive
                        true,   // match word
@@ -490,6 +490,8 @@ void SpellcheckerWidget::on_replaceAllPB_clicked()
        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();
 }
@@ -529,7 +531,7 @@ void SpellcheckerWidget::Private::check()
                return;
 
        fixPositionsIfBroken();
-       
+
        SpellChecker * speller = theSpellChecker();
        if (speller && !speller->hasDictionary(bv->buffer().language())) {
                int dsize = speller->numDictionaries();
@@ -611,8 +613,8 @@ void GuiSpellchecker::updateView()
 }
 
 
-Dialog * createGuiSpellchecker(GuiView & lv) 
-{ 
+Dialog * createGuiSpellchecker(GuiView & lv)
+{
        GuiSpellchecker * gui = new GuiSpellchecker(lv, Qt::RightDockWidgetArea);
 #ifdef Q_OS_MAC
        gui->setFloating(true);