aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHumdinger <humdingerb@gmail.com>2012-07-25 20:24:00 +0200
committerHumdinger <humdingerb@gmail.com>2012-07-25 20:24:00 +0200
commitbed0d7384bb16feb34e1e1d84fcd50039159d99c (patch)
tree68b36456e3b733e9238b203e3722d2557da0d58e
parent48249b20646d5a6a58b084eee73827953df407ca (diff)
Pulling declarations back into loop, plus small style change.hrev44407
Pointed out by Jérô and John. Thanks,
-rw-r--r--src/apps/stylededit/StyledEditWindow.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/apps/stylededit/StyledEditWindow.cpp b/src/apps/stylededit/StyledEditWindow.cpp
index 61e7c1a6c9..0601b0bdec 100644
--- a/src/apps/stylededit/StyledEditWindow.cpp
+++ b/src/apps/stylededit/StyledEditWindow.cpp
@@ -1481,7 +1481,8 @@ StyledEditWindow::_Replace(BString findThis, BString replaceWith,
bool caseSensitive, bool wrap, bool backSearch)
{
if (_Search(findThis, caseSensitive, wrap, backSearch)) {
- int32 start, finish;
+ int32 start;
+ int32 finish;
fTextView->GetSelection(&start, &finish);
_UpdateCleanUndoRedoSaveRevert();
@@ -1507,8 +1508,6 @@ StyledEditWindow::_ReplaceAll(BString findThis, BString replaceWith,
// start from the beginning of text
fTextView->Select(0, 0);
-
- int32 start, finish;
// iterate occurences of findThis without wrapping around
while (_Search(findThis, caseSensitive, false, false, false)) {
@@ -1516,7 +1515,9 @@ StyledEditWindow::_ReplaceAll(BString findThis, BString replaceWith,
_UpdateCleanUndoRedoSaveRevert();
first = false;
}
-
+ int32 start;
+ int32 finish;
+
fTextView->GetSelection(&start, &finish);
fTextView->Delete(start, start + findThis.Length());
fTextView->Insert(start, replaceWith.String(), replaceWith.Length());