From eadb039ed5d0ad0d5aee428949d7aeb11bb9e6f3 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 30 Dec 2011 17:22:11 +0000 Subject: [PATCH] When the focus object changes, the old selection should be cancelled explicitly to avoid seeing multiple selections until the next refresh. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextctrl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 63cc1a2887..a06d393f0c 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -4142,6 +4142,9 @@ bool wxRichTextCtrl::SetFocusObject(wxRichTextParagraphLayoutBox* obj, bool setC wxRichTextParagraphLayoutBox* oldContainer = GetFocusObject(); bool changingContainer = (m_focusObject != obj); + if (changingContainer && HasSelection()) + SelectNone(); + m_focusObject = obj; if (!obj)