Undo a replace all action correctly (Bug #2825280)

This commit is contained in:
Zane U. Ji 2012-08-11 08:33:17 +08:00
parent 6d6ade623e
commit cc30ea4961
1 changed files with 5 additions and 1 deletions

View File

@ -1908,6 +1908,8 @@ void MyFrame::OnDialogReplaceAll ( wxFindDialogEvent& event )
doc->SetTargetEnd ( doc->GetLength() );
doc->SetSearchFlags ( flags );
doc->BeginUndoAction();
int newLocation, replacementCount, regexWidth;
newLocation = replacementCount = regexWidth = 0;
@ -1926,8 +1928,10 @@ void MyFrame::OnDialogReplaceAll ( wxFindDialogEvent& event )
doc->SetTargetEnd ( doc->GetLength() );
++replacementCount;
}
wxString msg;
doc->EndUndoAction();
wxString msg;
msg.Printf (
ngettext ( L"%i replacement made", L"%i replacements made", replacementCount ),
replacementCount );