X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ea6c48d33d32836030d4ae631df3d61427f70f..d2e66707deb10dea6f92e3e4092f8a43ef942a5d:/src/richtext/richtextctrl.cpp?ds=inline 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();