From 2a7f5127e9600966f305da1843b4fe6038bf22e4 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 31 Oct 2013 06:53:55 +0000 Subject: [PATCH] Fixed selection bug. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75107 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index de274ee281..08f6ffff20 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -1867,8 +1867,7 @@ bool wxRichTextParagraphLayoutBox::Draw(wxDC& dc, wxRichTextDrawingContext& cont int flags = style; if (selection.IsValid() && - ((GetParentContainer() != this && selection.GetContainer() == this && selection.WithinSelection(GetRange().GetStart(), GetParentContainer())) || - (selection.WithinSelection(GetRange().GetStart(), this)))) + ((GetParentContainer() != this && selection.GetContainer() == this && selection.WithinSelection(GetRange().GetStart(), GetParentContainer())))) { flags |= wxRICHTEXT_DRAW_SELECTED; } @@ -9330,6 +9329,12 @@ wxRichTextCell::wxRichTextCell(wxRichTextObject* parent): /// Draw the item bool wxRichTextCell::Draw(wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& range, const wxRichTextSelection& selection, const wxRect& rect, int descent, int style) { + if (selection.IsValid() && + (selection.WithinSelection(GetRange().GetStart(), this))) + { + style |= wxRICHTEXT_DRAW_SELECTED; + } + return wxRichTextBox::Draw(dc, context, range, selection, rect, descent, style); }