summaryrefslogtreecommitdiff
path: root/src/rtfparser.cpp
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2005-06-08 19:01:49 +0000
committerStef Walter <stef@memberwebs.com>2005-06-08 19:01:49 +0000
commitbcd05eba8c68c27cedd24b816969ae0146dc7901 (patch)
tree2ab80cdcae7eb1d690d8ec15c522d2698d3dd689 /src/rtfparser.cpp
parent48228b26155ad4f5dd744482c4fd0b0c2163b02e (diff)
Unicode should now work properly. See #37
Diffstat (limited to 'src/rtfparser.cpp')
-rw-r--r--src/rtfparser.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/rtfparser.cpp b/src/rtfparser.cpp
index 31e5971..7e70fe5 100644
--- a/src/rtfparser.cpp
+++ b/src/rtfparser.cpp
@@ -363,6 +363,10 @@ bool RtfParser::parseControlWord()
else if(ch >= '0' && ch <= '9')
param.append(1, (char)ch);
+ // Hyphens are part of the parameter of a control word
+ else if(ch == '-' && !controlword.empty())
+ param.append(1, (char)ch);
+
// Now handle escapes and other special types of
// control words. These are all only valid at beginning
// of the "control word"
@@ -475,16 +479,11 @@ bool RtfParser::parseControlWord()
else if(m_parseUnicode && flags & RtfHandler::kHasParam &&
controlword == "u" )
{
- sendData(numPar);
+ // RTF plays hokey and uses negative values in unicode
+ sendData((unsigned short)((short)numPar));
m_uniEat = m_uniEatStack.top();
}
- // Unicode destination
- else if(m_parseUnicode && controlword == "ud")
- {
-
- }
-
// Skip value for unicode characters
else if(m_parseUnicode && controlword == "uc")
{