Take basic style into account when applying style sheet
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@51415 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2544,6 +2544,29 @@ bool wxRichTextParagraphLayoutBox::ApplyStyleSheet(wxRichTextStyleSheet* styleSh
|
|||||||
|
|
||||||
int foundCount = 0;
|
int foundCount = 0;
|
||||||
|
|
||||||
|
wxRichTextAttr attr(GetBasicStyle());
|
||||||
|
if (GetBasicStyle().HasParagraphStyleName())
|
||||||
|
{
|
||||||
|
wxRichTextParagraphStyleDefinition* paraDef = styleSheet->FindParagraphStyle(GetBasicStyle().GetParagraphStyleName());
|
||||||
|
if (paraDef)
|
||||||
|
{
|
||||||
|
attr.Apply(paraDef->GetStyleMergedWithBase(styleSheet));
|
||||||
|
SetBasicStyle(attr);
|
||||||
|
foundCount ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GetBasicStyle().HasCharacterStyleName())
|
||||||
|
{
|
||||||
|
wxRichTextCharacterStyleDefinition* charDef = styleSheet->FindCharacterStyle(GetBasicStyle().GetCharacterStyleName());
|
||||||
|
if (charDef)
|
||||||
|
{
|
||||||
|
attr.Apply(charDef->GetStyleMergedWithBase(styleSheet));
|
||||||
|
SetBasicStyle(attr);
|
||||||
|
foundCount ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst();
|
wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user