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
This commit is contained in:
Angus Leeming 2001-09-07 17:52:50 +00:00
parent bb6f1f7c41
commit 8e92d36142
2 changed files with 11 additions and 1 deletions

View 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.

View 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!"));