diff options
Diffstat (limited to 'src/xmlcomposer.cpp')
-rw-r--r-- | src/xmlcomposer.cpp | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/src/xmlcomposer.cpp b/src/xmlcomposer.cpp index 93bd8f3..10b476f 100644 --- a/src/xmlcomposer.cpp +++ b/src/xmlcomposer.cpp @@ -525,6 +525,8 @@ bool XmlComposer::BaseAnalyser::processTextFormatting(const string& cw, int flag format.textSetFont(param); else if(cw == "fs" && HAS_PARAM) format.textSetFontSize(param); + else if(cw == "cs" && HAS_PARAM) + format.textSetStyle(param); else return false; @@ -640,8 +642,16 @@ ON_INITIALIZE(Style) ON_CONTROLWORD(Style) { - // Get the style id - if(flags & kAsterisk) + bool use = false; + + // The style id + if((cw == "s" && (flags & kHasParam)) || + (cw == "cs" && (flags & kAsterisk) && (flags & kHasParam))) + { + use = true; + } + + else if (flags & kAsterisk) { AN_ANALYSER(Skip); return; @@ -655,18 +665,19 @@ ON_CONTROLWORD(Style) haveStyle = true; } - // The style id - if(cw == "s" && flags & kHasParam) + if (use) { AN_ATTRIBUTE(kAtId, param); } // Otherwise get as much formatting out of the tag as possible - else if(processTextFormatting(cw, flags, param)) - DUMMY; - else - DEFAULT_CONTROLWORD; + { + if(processTextFormatting(cw, flags, param)) + DUMMY; + else + DEFAULT_CONTROLWORD; + } } ON_GROUPSTART(Style) @@ -1081,6 +1092,13 @@ ON_CHARDATA(Content) } } + if(format.textStyle() != -1) + { + AN_ELEMENT(kElSpan); + AN_ATTRIBUTE(kElStyle, format.textStyle()); + elements++; + } + // Now do text Properties if necessary if(format.textIsBold()) |