Fixed Replace() to use the passed range instead of current selection

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68329 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2011-07-22 13:07:40 +00:00
parent 9f6e407c7d
commit e3bb4c547a

View File

@@ -2925,13 +2925,19 @@ void wxRichTextCtrl::SetSelection(long from, long to)
// Editing
// ----------------------------------------------------------------------------
void wxRichTextCtrl::Replace(long WXUNUSED(from), long WXUNUSED(to),
void wxRichTextCtrl::Replace(long from, long to,
const wxString& value)
{
BeginBatchUndo(_("Replace"));
SetSelection(from, to);
wxRichTextAttr attr = GetDefaultStyle();
DeleteSelectedContent();
SetDefaultStyle(attr);
DoWriteText(value, SetValue_SelectionOnly);
EndBatchUndo();