Pulling declarations back into loop, plus small style change.

Pointed out by Jérô and John. Thanks,
This commit is contained in:
Humdinger
2012-07-25 20:24:00 +02:00
parent 48249b2064
commit bed0d7384b
+4 -3
View File
@@ -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();
@@ -1508,14 +1509,14 @@ 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)) {
if (first) {
_UpdateCleanUndoRedoSaveRevert();
first = false;
}
int32 start;
int32 finish;
fTextView->GetSelection(&start, &finish);
fTextView->Delete(start, start + findThis.Length());