From 4a5ae79a36c0a8e70e1c4af19ea43e2d0506ffa8 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 21 Jan 2015 14:31:28 +0000 Subject: [PATCH] Remove selection before container is deleted or it could cause a crash later. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 3c6724929b..66e81f224d 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -11798,10 +11798,10 @@ bool wxRichTextAction::Do() while (c) { if (c == container) - { m_ctrl->StoreFocusObject(container); - break; - } + + if (m_ctrl && (c == m_ctrl->GetSelection().GetContainer())) + m_ctrl->SelectNone(); c = c->GetParent(); } } @@ -11979,10 +11979,10 @@ bool wxRichTextAction::Undo() while (c) { if (c == container) - { m_ctrl->StoreFocusObject(container); - break; - } + + if (m_ctrl && (c == m_ctrl->GetSelection().GetContainer())) + m_ctrl->SelectNone(); c = c->GetParent(); } }