Fixed bug in optimization for character input, affecting first paragraph in the buffer.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49436 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user