From 8e92d36142f581f02efad63ea9c56adc03b0d2bb Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Fri, 7 Sep 2001 17:52:50 +0000 Subject: [PATCH] Fix semantics of Replace in Find & Replace dialog git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2711 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/controllers/ChangeLog | 6 ++++++ src/frontends/controllers/ControlSearch.C | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index edfd3d11ef..23464f2aff 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,9 @@ +2001-09-07 Angus Leeming + + * 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 * ControlButtons.[Ch]: added publicly accessible IconifyWithMain method. diff --git a/src/frontends/controllers/ControlSearch.C b/src/frontends/controllers/ControlSearch.C index 7315d7139b..9121822b89 100644 --- a/src/frontends/controllers/ControlSearch.C +++ b/src/frontends/controllers/ControlSearch.C @@ -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!")); -- 2.39.2