X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/caad01090aa9537446fadd3c333edb9a5ebeb310..9d5507f7a2701395e1d5c121bd877bb9066ee6ea:/src/richtext/richtextbuffer.cpp?ds=sidebyside diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 3f69ec35f6..de36d33ceb 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -28,6 +28,7 @@ #include "wx/module.h" #endif +#include "wx/settings.h" #include "wx/filename.h" #include "wx/clipbrd.h" #include "wx/wfstream.h" @@ -594,7 +595,7 @@ bool wxRichTextParagraphLayoutBox::Layout(wxDC& dc, const wxRect& rect, int styl if (invalidRange == wxRICHTEXT_ALL) layoutAll = true; else // If we know what range is affected, start laying out from that point on. - if (invalidRange.GetStart() > GetRange().GetStart()) + if (invalidRange.GetStart() >= GetRange().GetStart()) { wxRichTextParagraph* firstParagraph = GetParagraphAtPosition(invalidRange.GetStart()); if (firstParagraph) @@ -603,10 +604,13 @@ bool wxRichTextParagraphLayoutBox::Layout(wxDC& dc, const wxRect& rect, int styl wxRichTextObjectList::compatibility_iterator previousNode; if ( firstNode ) previousNode = firstNode->GetPrevious(); - if (firstNode && previousNode) + if (firstNode) { - wxRichTextParagraph* previousParagraph = wxDynamicCast(previousNode->GetData(), wxRichTextParagraph); - availableSpace.y = previousParagraph->GetPosition().y + previousParagraph->GetCachedSize().y; + if (previousNode) + { + wxRichTextParagraph* previousParagraph = wxDynamicCast(previousNode->GetData(), wxRichTextParagraph); + availableSpace.y = previousParagraph->GetPosition().y + previousParagraph->GetCachedSize().y; + } // Now we're going to start iterating from the first affected paragraph. node = firstNode; @@ -4258,9 +4262,12 @@ bool wxRichTextPlainText::DrawTabbedString(wxDC& dc, const wxTextAttr& attr, con if (selected) { - dc.SetBrush(*wxBLACK_BRUSH); - dc.SetPen(*wxBLACK_PEN); - dc.SetTextForeground(*wxWHITE); + wxColour highlightColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)); + wxColour highlightTextColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT)); + + dc.SetBrush(wxBrush(highlightColour)); + dc.SetPen(wxPen(highlightColour)); + dc.SetTextForeground(highlightTextColour); dc.SetBackgroundMode(wxTRANSPARENT); } else