diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/tags.h | 1 | ||||
| -rw-r--r-- | src/xmlcomposer.cpp | 101 | ||||
| -rw-r--r-- | src/xmlcomposer.h | 5 | 
3 files changed, 61 insertions, 46 deletions
@@ -85,6 +85,7 @@ static const char* kElCell = "cell";  static const char* kElRow = "row";  static const char* kElTable = "table";  static const char* kElFootNote = "footnote"; +static const char* kElBookmark = "bookmark";  static const char* kElRef = "ref";  static const char* kElFont = "font";  static const char* kElOptions = "options"; 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) diff --git a/src/xmlcomposer.h b/src/xmlcomposer.h index c9c321c..f2c9336 100644 --- a/src/xmlcomposer.h +++ b/src/xmlcomposer.h @@ -321,6 +321,11 @@ protected:          CONTROLWORD          DONE      END_ANALYSER + +	// Handles bookmarks +	ANALYSER(Bookmark) +		INITIALIZE +	END_ANALYSER  };  #endif // __XMLCOMPOSER_H__  | 
