From f510ad8b7ce4928f2f687f9cfe4cefaa376e9140 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 17 Nov 2013 10:23:45 +0000 Subject: [PATCH] Backported r75107: Fixed selection bug. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75219 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 c4e6cbf8ed..0d7f8294b2 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); }