From a4c0a06821a6f77ee1d7aebeb2eee02bb7aa913d Mon Sep 17 00:00:00 2001 From: Stef Date: Wed, 31 Mar 2004 04:04:16 +0000 Subject: Unix porting Unix porting --- src/rtfparser.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/rtfparser.cpp') 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(); } - -- cgit v1.2.3