diff options
author | Stef Walter <stef@memberwebs.com> | 2005-06-07 17:57:14 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2005-06-07 17:57:14 +0000 |
commit | 8803295019b0fe0b56c08899adf3f8231effb0f5 (patch) | |
tree | 0cf83c42731e7d90fcbc6e50eaaa2e2bd65e3c32 /src | |
parent | c386abd496f61f4628446f27b771529699c0ea45 (diff) |
Add <highlight> tag for highlighted text.
Diffstat (limited to 'src')
-rw-r--r-- | src/domcxx.h | 4 | ||||
-rw-r--r-- | src/rtfformatting.h | 8 | ||||
-rw-r--r-- | src/tags.h | 1 | ||||
-rw-r--r-- | src/xmlcomposer.cpp | 18 |
4 files changed, 24 insertions, 7 deletions
diff --git a/src/domcxx.h b/src/domcxx.h index abdd622..2e7e9ec 100644 --- a/src/domcxx.h +++ b/src/domcxx.h @@ -54,8 +54,8 @@ namespace DOM extern "C" { #define this _this - #include <domc.h> - #include <dom.h> + #include "domc.h" + #include "dom.h" #undef this } diff --git a/src/rtfformatting.h b/src/rtfformatting.h index 3085198..db687eb 100644 --- a/src/rtfformatting.h +++ b/src/rtfformatting.h @@ -68,6 +68,7 @@ public: m_hidden == format.m_hidden && m_underline == format.m_underline && m_color == format.m_color && + m_highlight == format.m_highlight && m_suscript == format.m_suscript && m_font == format.m_font && m_fsize == format.m_fsize && @@ -89,6 +90,7 @@ public: m_hidden = format.m_hidden; m_underline = format.m_underline; m_color = format.m_color; + m_highlight = format.m_highlight; m_suscript = format.m_suscript; m_font = format.m_font; m_fsize = format.m_fsize; @@ -104,6 +106,7 @@ public: m_bold = m_italic = m_strike = m_underline = m_hidden = false; m_color = -1; + m_highlight = -1; m_suscript = 0; m_fsize = -1; m_font = -1; @@ -128,6 +131,8 @@ public: { return m_hidden; } int textColor() const { return m_color; } + int textHighlight() const + { return m_highlight; } int textSuScript() const { return m_suscript; } int textFont() const @@ -155,6 +160,8 @@ public: { m_hidden = hidden; } void textSetColor(int color) { m_color = color; } + void textSetHighlight(int color) + { m_highlight = color; } void textSetSuScript(int suscript) { m_suscript = suscript; } void textSetFont(int font) @@ -184,6 +191,7 @@ protected: bool m_hidden; int m_suscript; int m_color; + int m_highlight; int m_font; int m_fsize; int m_charstyle; @@ -80,6 +80,7 @@ static const char* kElStrike = "strike"; static const char* kElU = "u"; static const char* kElSuper = "super"; static const char* kElSub = "sub"; +static const char* kElHighlight = "highlight"; static const char* kElCell = "cell"; static const char* kElRow = "row"; static const char* kElTable = "table"; diff --git a/src/xmlcomposer.cpp b/src/xmlcomposer.cpp index 10b476f..0bcfbcc 100644 --- a/src/xmlcomposer.cpp +++ b/src/xmlcomposer.cpp @@ -519,13 +519,15 @@ bool XmlComposer::BaseAnalyser::processTextFormatting(const string& cw, int flag format.textSetSuScript(RtfFormatting::SUPERSCRIPT); else if(cw == "sub") format.textSetSuScript(RtfFormatting::SUBSCRIPT); - else if(cw == "cf" && HAS_PARAM) - format.textSetColor(param); - else if(cw == "f" && HAS_PARAM) + else if(cw == "cf" && (flags & HAS_PARAM)) + format.textSetColor(param); + else if(cw == "highlight" && (flags & HAS_PARAM)) + format.textSetHighlight(param); + else if(cw == "f" && (flags & HAS_PARAM)) format.textSetFont(param); - else if(cw == "fs" && HAS_PARAM) + else if(cw == "fs" && (flags & HAS_PARAM)) format.textSetFontSize(param); - else if(cw == "cs" && HAS_PARAM) + else if(cw == "cs" && (flags & HAS_PARAM)) format.textSetStyle(param); else return false; @@ -1131,6 +1133,12 @@ ON_CHARDATA(Content) elements++; } + if(format.textHighlight() != -1) + { + AN_ELEMENT(kElHighlight); + elements++; + } + if(format.textSuScript() == RtfFormatting::SUPERSCRIPT) { AN_ELEMENT(kElSuper); |