]> git.lyx.org Git - features.git/commitdiff
Fix semantics of Replace in Find & Replace dialog
authorAngus Leeming <leeming@lyx.org>
Fri, 7 Sep 2001 17:52:50 +0000 (17:52 +0000)
committerAngus Leeming <leeming@lyx.org>
Fri, 7 Sep 2001 17:52:50 +0000 (17:52 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2711 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlSearch.C

index edfd3d11efd9d84530fc8b7c9e74fd408fd3ce85..23464f2aff4be39f01e698b91de85dd0a615d3d3 100644 (file)
@@ -1,3 +1,9 @@
+2001-09-07  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * ControlSearch (replace): change semantics of replace to NOT move on
+       to the next instance of a word once the present instance has been
+       replaced unless we are replacing ALL instances of the word.
+
 2001-09-07  Rob Lahaye  <lahaye@users.sourceforge.net>
 
        * ControlButtons.[Ch]: added publicly accessible IconifyWithMain method.
index 7315d7139bc2702070a2ee5227cb3c7140c95272..9121822b8957705ff87a8f01891d00c10bde31e0 100644 (file)
@@ -58,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!"));