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)
|
if (invalidRange == wxRICHTEXT_ALL)
|
||||||
layoutAll = true;
|
layoutAll = true;
|
||||||
else // If we know what range is affected, start laying out from that point on.
|
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());
|
wxRichTextParagraph* firstParagraph = GetParagraphAtPosition(invalidRange.GetStart());
|
||||||
if (firstParagraph)
|
if (firstParagraph)
|
||||||
@@ -604,10 +604,13 @@ bool wxRichTextParagraphLayoutBox::Layout(wxDC& dc, const wxRect& rect, int styl
|
|||||||
wxRichTextObjectList::compatibility_iterator previousNode;
|
wxRichTextObjectList::compatibility_iterator previousNode;
|
||||||
if ( firstNode )
|
if ( firstNode )
|
||||||
previousNode = firstNode->GetPrevious();
|
previousNode = firstNode->GetPrevious();
|
||||||
if (firstNode && previousNode)
|
if (firstNode)
|
||||||
{
|
{
|
||||||
wxRichTextParagraph* previousParagraph = wxDynamicCast(previousNode->GetData(), wxRichTextParagraph);
|
if (previousNode)
|
||||||
availableSpace.y = previousParagraph->GetPosition().y + previousParagraph->GetCachedSize().y;
|
{
|
||||||
|
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.
|
// Now we're going to start iterating from the first affected paragraph.
|
||||||
node = firstNode;
|
node = firstNode;
|
||||||
|
Reference in New Issue
Block a user