I think replace all is fixed now?

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1868 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
shatty 2002-11-07 12:03:23 +00:00
parent 7c7e9acdad
commit 80f5cbb0a5

View File

@ -925,10 +925,24 @@ StyledEditWindow::ReplaceAll(BString findIt, BString replaceWith, bool caseSens)
int32 oldstart;
BString viewText(fTextView->Text());
if (caseSens)
viewText.ReplaceAll(findIt.String(),replaceWith.String());
else
viewText.IReplaceAll(findIt.String(),replaceWith.String());
int32 textStart, textFinish;
fTextView->GetSelection(&textStart, &textFinish);
// we search backwards because we are disturbing everything after the point we insert
fTextView->SetText(viewText.String());
if (viewText.Length() < textStart)
textStart = viewText.Length();
if (viewText.Length() < textFinish)
textFinish = viewText.Length();
fTextView->Select(textStart,textFinish);
fTextView->ScrollToSelection();
/* // we search backwards because we are disturbing everything after the point we insert
start = viewText.Length();
while (start > 0) {
oldstart = start;
@ -944,7 +958,7 @@ StyledEditWindow::ReplaceAll(BString findIt, BString replaceWith, bool caseSens)
} else {
start--; // we prefer not to get stuck
}
}
} */
}/***StyledEditWindow::ReplaceAll()***/