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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user