diff options
Diffstat (limited to 'src/xmlcomposer.cpp')
-rw-r--r-- | src/xmlcomposer.cpp | 101 |
1 files changed, 55 insertions, 46 deletions
diff --git a/src/xmlcomposer.cpp b/src/xmlcomposer.cpp index 93ae306..b23a06c 100644 --- a/src/xmlcomposer.cpp +++ b/src/xmlcomposer.cpp @@ -1093,6 +1093,59 @@ ON_CONTROLWORD(Field) DEFAULT_CONTROLWORD; } + +// FootNote Analyser ---------------------------------------------------------------- + +ON_INITIALIZE(FootNote) +{ + int ac = m_composer->getAutoCount(AUTOCOUNT_FOOTNOTE); + + AN_ELEMENT(kElFootNote); + AN_ATTRIBUTE(kAtId, ac); + AN_DESTINATION(Content); +} + +ON_CONTROLWORD(FootNote) +{ + // Inside foot notes there's no link to the foot note + if(cw == "chftn") + { + // Only put actual text when in extras mode + if(DO_EXTRAS()) + { + DestinationPtr dest = m_composer->getDestination(); + ASSERT(dest != NULL); + int ac = m_composer->getAutoCount(AUTOCOUNT_FOOTNOTE); + dest->charData(formatInt(ac)); + } + + return; + } + + // Process text content in the foot note + else if(processTextContent(cw, flags, param)) + DUMMY; + else if(processTextAutoContent(cw, flags, param)) + DUMMY; + else if(processTextFormatting(cw, flags, param)) + DUMMY; + else + DEFAULT_CONTROLWORD; +} + +ON_DONE(FootNote) +{ + m_composer->incrementAutoCount(AUTOCOUNT_FOOTNOTE); +} + +// Bookmark Analyzer ---------------------------------------------------------------- + +ON_INITIALIZE(Bookmark) +{ + AN_ELEMENT(kElBookmark); + AN_DESTINATION_ARG(Attribute, kAtId); +} + // Root Analyser -------------------------------------------------------------------- ON_INITIALIZE(Root) @@ -1122,6 +1175,8 @@ ON_CONTROLWORD(Root) AN_ANALYSER(Skip); else if(cw == "footnote") AN_ANALYSER(FootNote); + else if(cw == "bkmkstart") + AN_ANALYSER(Bookmark); else if(cw == "pict") { AN_ANALYSER(Skip); @@ -1271,52 +1326,6 @@ ON_CHARDATA(Content) AN_POP_ELEMENT(); } - -// FootNote Analyser ---------------------------------------------------------------- - -ON_INITIALIZE(FootNote) -{ - int ac = m_composer->getAutoCount(AUTOCOUNT_FOOTNOTE); - - AN_ELEMENT(kElFootNote); - AN_ATTRIBUTE(kAtId, ac); - AN_DESTINATION(Content); -} - -ON_CONTROLWORD(FootNote) -{ - // Inside foot notes there's no link to the foot note - if(cw == "chftn") - { - // Only put actual text when in extras mode - if(DO_EXTRAS()) - { - DestinationPtr dest = m_composer->getDestination(); - ASSERT(dest != NULL); - int ac = m_composer->getAutoCount(AUTOCOUNT_FOOTNOTE); - dest->charData(formatInt(ac)); - } - - return; - } - - // Process text content in the foot note - else if(processTextContent(cw, flags, param)) - DUMMY; - else if(processTextAutoContent(cw, flags, param)) - DUMMY; - else if(processTextFormatting(cw, flags, param)) - DUMMY; - else - DEFAULT_CONTROLWORD; -} - -ON_DONE(FootNote) -{ - m_composer->incrementAutoCount(AUTOCOUNT_FOOTNOTE); -} - - // Raw Destination ------------------------------------------------------------------ ON_CHARDATA(Raw) |