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:
@@ -925,10 +925,24 @@ StyledEditWindow::ReplaceAll(BString findIt, BString replaceWith, bool caseSens)
|
|||||||
int32 oldstart;
|
int32 oldstart;
|
||||||
|
|
||||||
BString viewText(fTextView->Text());
|
BString viewText(fTextView->Text());
|
||||||
|
if (caseSens)
|
||||||
|
viewText.ReplaceAll(findIt.String(),replaceWith.String());
|
||||||
|
else
|
||||||
|
viewText.IReplaceAll(findIt.String(),replaceWith.String());
|
||||||
|
|
||||||
int32 textStart, textFinish;
|
int32 textStart, textFinish;
|
||||||
fTextView->GetSelection(&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();
|
start = viewText.Length();
|
||||||
while (start > 0) {
|
while (start > 0) {
|
||||||
oldstart = start;
|
oldstart = start;
|
||||||
@@ -944,7 +958,7 @@ StyledEditWindow::ReplaceAll(BString findIt, BString replaceWith, bool caseSens)
|
|||||||
} else {
|
} else {
|
||||||
start--; // we prefer not to get stuck
|
start--; // we prefer not to get stuck
|
||||||
}
|
}
|
||||||
}
|
} */
|
||||||
|
|
||||||
}/***StyledEditWindow::ReplaceAll()***/
|
}/***StyledEditWindow::ReplaceAll()***/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user