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
|
// Editing
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxRichTextCtrl::Replace(long WXUNUSED(from), long WXUNUSED(to),
|
void wxRichTextCtrl::Replace(long from, long to,
|
||||||
const wxString& value)
|
const wxString& value)
|
||||||
{
|
{
|
||||||
BeginBatchUndo(_("Replace"));
|
BeginBatchUndo(_("Replace"));
|
||||||
|
|
||||||
|
SetSelection(from, to);
|
||||||
|
|
||||||
|
wxRichTextAttr attr = GetDefaultStyle();
|
||||||
|
|
||||||
DeleteSelectedContent();
|
DeleteSelectedContent();
|
||||||
|
|
||||||
|
SetDefaultStyle(attr);
|
||||||
|
|
||||||
DoWriteText(value, SetValue_SelectionOnly);
|
DoWriteText(value, SetValue_SelectionOnly);
|
||||||
|
|
||||||
EndBatchUndo();
|
EndBatchUndo();
|
||||||
|
Reference in New Issue
Block a user