X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiSpellchecker.cpp;h=537d9d79b50184b8e652d75aac0ab3369db54e2e;hb=b7f6b979d0f889f08e735f35378bb20ba3788b4b;hp=aa62a9a448ccd7ead8149f010b58cf018c50b69e;hpb=9c55af4a223ce4db29d643251109e245665344bd;p=lyx.git diff --git a/src/frontends/qt4/GuiSpellchecker.cpp b/src/frontends/qt4/GuiSpellchecker.cpp index aa62a9a448..537d9d79b5 100644 --- a/src/frontends/qt4/GuiSpellchecker.cpp +++ b/src/frontends/qt4/GuiSpellchecker.cpp @@ -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 languages = + std::set 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);