Fixed #688, related to "Replace All" always being case sensitive

Originally committed to SVN as r1952.
This commit is contained in:
Alysson Souza 2008-03-07 05:34:01 +00:00
parent d40168007f
commit c93d6d57b2
1 changed files with 16 additions and 4 deletions

View File

@ -477,12 +477,24 @@ void SearchReplaceEngine::ReplaceAll() {
count += reps;
}
}
// Normal replace
else {
if (Text->Contains(LookFor)) {
count += Text->Replace(LookFor,ReplaceWith);
replaced = true;
if (!Search.matchCase) {
wxString Left, Right;
int pos;
while(Text->Lower().Contains(LookFor.Lower())) {
pos = Text->Lower().Find(LookFor.Lower());
Left = pos ? Text->Left(pos) : _T("");
Right = Text->Mid(pos+LookFor.Len());
*Text = Left + ReplaceWith + Right;
count++;
}
}
else {
if(Text->Contains(LookFor)) {
count += Text->Replace(LookFor, ReplaceWith);
replaced = true;
}
}
}