X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fcontrollers%2FControlSearch.C;h=e7ac92f0367f05c5495c3735cb393201d99a95bd;hb=7ea7dabed1b72cc25dcbdc482ac006f2b61dacfd;hp=ca077e000b3fa0d2b809be9c7090e6c2912f8d56;hpb=b63ac8a6c3830802c5fd1e51dfb93aa867144a82;p=lyx.git diff --git a/src/frontends/controllers/ControlSearch.C b/src/frontends/controllers/ControlSearch.C index ca077e000b..e7ac92f036 100644 --- a/src/frontends/controllers/ControlSearch.C +++ b/src/frontends/controllers/ControlSearch.C @@ -17,6 +17,8 @@ #pragma implementation #endif +#include "ViewBase.h" +#include "ButtonControllerBase.h" #include "ControlSearch.h" #include "Dialogs.h" #include "Liason.h" @@ -24,12 +26,15 @@ #include "buffer.h" #include "lyxfind.h" #include "debug.h" +#include "gettext.h" +#include "BufferView.h" +#include "support/lstrings.h" using Liason::setMinibuffer; using SigC::slot; ControlSearch::ControlSearch(LyXView & lv, Dialogs & d) - : ControlDialog(lv, d) + : ControlDialogBD(lv, d) { d_.showSearch.connect(SigC::slot(this, &ControlSearch::show)); @@ -42,8 +47,8 @@ ControlSearch::ControlSearch(LyXView & lv, Dialogs & d) void ControlSearch::find(string const & search, bool casesensitive, bool matchword, bool forward) const { - bool const found = LyXFind(lv_.view(), search, casesensitive, - matchword, forward); + bool const found = LyXFind(lv_.view(), search, + forward, false, casesensitive, matchword); if (!found) setMinibuffer(&lv_, _("String not found!")); @@ -53,9 +58,13 @@ void ControlSearch::find(string const & search, void ControlSearch::replace(string const & search, string const & replace, bool casesensitive, bool matchword, bool all) const { + // If not replacing all instances of the word, then do not + // move on to the next instance once the present instance has been + // changed + bool const once = !all; int const replace_count = LyXReplace(lv_.view(), - search, replace, casesensitive, - matchword, true, all); + search, replace, true, casesensitive, + matchword, all, once); if (replace_count == 0) { setMinibuffer(&lv_, _("String not found!"));