X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0ec6da024886a8cb387f2d8c5f293edf5a16e231..d475dd224790d3fcd530492228eee431a1e44356:/src/richtext/richtextbuffer.cpp diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index c8547b38a2..de36d33ceb 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -595,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) @@ -604,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;