X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ea6c48d33d32836030d4ae631df3d61427f70f..b7d3a622aa58729f92941c2b6710c5481b16f19e:/src/richtext/richtextctrl.cpp diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index baf346df1c..f5039443c5 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -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();