]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlSearch.C
to much stuff for my liking...
[lyx.git] / src / frontends / controllers / ControlSearch.C
index 9f03e815acaa54d0d47da742fc2685f497b5e929..e7ac92f0367f05c5495c3735cb393201d99a95bd 100644 (file)
 #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<ControlConnectBD>(lv, d)
+       : ControlDialogBD(lv, d)
 {
        d_.showSearch.connect(SigC::slot(this, &ControlSearch::show));
 
@@ -57,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, true, casesensitive, 
-                                            matchword, all);
+                                            matchword, all, once);
                                  
        if (replace_count == 0) {
                setMinibuffer(&lv_, _("String not found!"));