Don't add space before para twice in paragraph layout
Discard attributes from empty text object when merging git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@65441 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -4130,7 +4130,7 @@ bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style)
|
|||||||
ApplyParagraphStyle(attr, rect);
|
ApplyParagraphStyle(attr, rect);
|
||||||
g_globalDC = NULL;
|
g_globalDC = NULL;
|
||||||
|
|
||||||
SetCachedSize(wxSize(maxWidth, currentPosition.y + spaceBeforePara + spaceAfterPara));
|
SetCachedSize(wxSize(maxWidth, currentPosition.y + spaceAfterPara));
|
||||||
|
|
||||||
m_dirty = false;
|
m_dirty = false;
|
||||||
|
|
||||||
@@ -5701,7 +5701,12 @@ bool wxRichTextPlainText::Merge(wxRichTextObject* object)
|
|||||||
|
|
||||||
if (textObject)
|
if (textObject)
|
||||||
{
|
{
|
||||||
|
bool isEmpty = m_text.IsEmpty();
|
||||||
m_text += textObject->GetText();
|
m_text += textObject->GetText();
|
||||||
|
// Don't keep an empty object's attributes
|
||||||
|
if (isEmpty)
|
||||||
|
m_attributes = textObject->GetAttributes();
|
||||||
|
else
|
||||||
wxRichTextApplyStyle(m_attributes, textObject->GetAttributes());
|
wxRichTextApplyStyle(m_attributes, textObject->GetAttributes());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user