From 44580804c2b478ebd36f59c9b416be560c4ef5bf Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 27 Jan 2008 17:37:17 +0000 Subject: [PATCH] Take basic style into account when applying style sheet git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51414 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index ac3e1c4399..651b5ac107 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -2474,6 +2474,29 @@ bool wxRichTextParagraphLayoutBox::ApplyStyleSheet(wxRichTextStyleSheet* styleSh 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(); while (node) {