summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2005-06-08 22:29:56 +0000
committerStef Walter <stef@memberwebs.com>2005-06-08 22:29:56 +0000
commitaa35c653ec5fe40c50426873ca1dbe3122428709 (patch)
treed432ebc113cbca72ca50dd9b4b127d9e626b50f4 /src
parented6394b56047af2db69e08280972657c4561fbad (diff)
Bookmark support in rtfx.
Diffstat (limited to 'src')
-rw-r--r--src/tags.h1
-rw-r--r--src/xmlcomposer.cpp101
-rw-r--r--src/xmlcomposer.h5
3 files changed, 61 insertions, 46 deletions
diff --git a/src/tags.h b/src/tags.h
index fefcdc9..be140d1 100644
--- a/src/tags.h
+++ b/src/tags.h
@@ -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__