diff options
author | Stef Walter <stef@memberwebs.com> | 2004-03-31 04:04:16 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2004-03-31 04:04:16 +0000 |
commit | 474de82693ec571097f355703557f48453f76392 (patch) | |
tree | 3de5c30f7fd9239c8db38fb1a5a8518064fa38b4 /src/rtfparser.cpp | |
parent | c60a35fc2a50f938e0d2dcd726784afbb001a756 (diff) |
Unix porting
Unix porting
Diffstat (limited to 'src/rtfparser.cpp')
-rw-r--r-- | src/rtfparser.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rtfparser.cpp b/src/rtfparser.cpp index 336847f..589ef71 100644 --- a/src/rtfparser.cpp +++ b/src/rtfparser.cpp @@ -60,7 +60,10 @@ void RtfReader::sendData(RtfContext& cx, wstring data) { if(m_uniEat > 0) { - int len = __min(data.size(), m_uniEat); + int len = data.size(); + if(len > m_uniEat) + len = m_uniEat; + cx.data.append(data.substr(len)); m_uniEat -= len; } @@ -134,11 +137,11 @@ bool RtfReader::parseControlWord(RtfContext& cx) // NOTE: Although the RTF specification prohibits upercase // control words, MS Word uses them :-/ if(ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z') - controlword.append(1, ch); + controlword.append(1, (char)ch); // Part of the parameter of a control word else if(ch >= '0' && ch <= '9') - param.append(1, ch); + param.append(1, (char)ch); // Now handle escapes and other special types of // control words. These are all only valid at beginning @@ -199,7 +202,7 @@ bool RtfReader::parseControlWord(RtfContext& cx) // a hyphen right after control word is part of number else if(!empty && param.empty() && ch == '-') { - param.append(1, ch); + param.append(1, (char)ch); } // TODO: This looks real hokey and acts that @@ -399,4 +402,3 @@ done: return m_parseErrors.empty(); } - |