From e3bb4c547ac76ef71674511b7f91218bbbdaa778 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 22 Jul 2011 13:07:40 +0000 Subject: [PATCH] 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 --- src/richtext/richtextctrl.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(); -- 2.47.2