X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5219cf0588852d7f1cfeab0df74314589a9d1e22..c13d6ac1ea199d1e3908d40d129e2fd5a4d82df7:/src/richtext/richtextctrl.cpp?ds=sidebyside diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index abc5b0f6be..f5039443c5 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -568,12 +568,7 @@ void wxRichTextCtrl::OnLeftClick(wxMouseEvent& event) // For now, don't handle shift-click when we're selecting multiple objects. if (event.ShiftDown() && GetFocusObject() == oldFocusObject && m_selectionState == wxRichTextCtrlSelectionState_Normal) - { - if (!m_selection.IsValid()) - ExtendSelection(oldCaretPos, m_caretPosition, wxRICHTEXT_SHIFT_DOWN); - else - ExtendSelection(m_caretPosition, m_caretPosition, wxRICHTEXT_SHIFT_DOWN); - } + ExtendSelection(oldCaretPos, m_caretPosition, wxRICHTEXT_SHIFT_DOWN); else SelectNone(); } @@ -2930,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();