]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextctrl.cpp
Rework IE virtual file system support to use new syntax. Remove now unused code for...
[wxWidgets.git] / src / richtext / richtextctrl.cpp
index baf346df1ca4e5d4a70e587857fb0ba7f86f6bbf..f5039443c53ca55def1aacda60d6fd5128189d2d 100644 (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();