summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2005-01-31 12:52:22 +0000
committerRüdiger Timm <rt@openoffice.org>2005-01-31 12:52:22 +0000
commitd005b64f53f1eb33e21354bf3a9b360a171b32de (patch)
tree9afbae38f8aee7227e5ebb66f0c3c1c9f052c976 /svtools
parent50531e992357f3c6a6113ef5a27a1100db1c7a77 (diff)
INTEGRATION: CWS frrtf01 (1.16.12); FILE MERGED
2004/12/22 13:22:59 flr 1.16.12.3: #117881# multiple table problems 2004/12/14 15:08:13 flr 1.16.12.2: #i29453# Made SkipGroup reentrant 2004/12/13 09:51:41 flr 1.16.12.1: #117891# added support for outline numbering in rtf import; this was a 'superbug' - so if you have any RTF problems try this fix ;-)
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/svrtf/parrtf.cxx27
1 files changed, 23 insertions, 4 deletions
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index 58c497a2a86c..c86cbe3e3639 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: parrtf.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: obo $ $Date: 2004-11-16 12:44:52 $
+ * last change: $Author: rt $ $Date: 2005-01-31 13:52:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -98,6 +98,9 @@ SvRTFParser::~SvRTFParser()
{
}
+
+
+
int SvRTFParser::_GetNextToken()
{
int nRet = 0;
@@ -185,6 +188,7 @@ int SvRTFParser::_GetNextToken()
} while( RTF_ISDIGIT( nNextCh ) );
if( bNegValue )
nTokenValue = -nTokenValue;
+ bTokenHasValue=true;
}
else if( bNegValue ) // das Minus wieder zurueck
{
@@ -225,6 +229,7 @@ int SvRTFParser::_GetNextToken()
break;
case RTF_UPR:
+ if (!_inSkipGroup) {
// UPR - overread the group with the ansi
// informations
while( '{' != _GetNextToken() )
@@ -232,6 +237,7 @@ int SvRTFParser::_GetNextToken()
SkipGroup();
_GetNextToken(); // overread the last bracket
nRet = 0;
+ }
break;
case RTF_U:
@@ -535,9 +541,15 @@ void SvRTFParser::ScanText( const sal_Unicode cBreak )
aToken += aStrBuffer;
}
+
+short SvRTFParser::_inSkipGroup=0;
+
void SvRTFParser::SkipGroup()
{
- short nBrackets = 1;
+short nBrackets=1;
+if (_inSkipGroup>0)
+ return;
+_inSkipGroup++;
#if 1 //#i16185# fecking \bin keyword
do
{
@@ -547,8 +559,10 @@ void SvRTFParser::SkipGroup()
++nBrackets;
break;
case '}':
- if (!--nBrackets)
+ if (!--nBrackets) {
+ _inSkipGroup--;
return;
+ }
break;
}
int nToken = _GetNextToken();
@@ -558,6 +572,10 @@ void SvRTFParser::SkipGroup()
rInput.SeekRel(nTokenValue);
nNextCh = GetNextChar();
}
+ while (nNextCh==0xa || nNextCh==0xd)
+ {
+ nNextCh = GetNextChar();
+ }
} while (sal_Unicode(EOF) != nNextCh && IsParserWorking());
#else
sal_Unicode cPrev = 0;
@@ -586,6 +604,7 @@ void SvRTFParser::SkipGroup()
if( SVPAR_PENDING != eState && '}' != nNextCh )
eState = SVPAR_ERROR;
+ _inSkipGroup--;
}
void SvRTFParser::ReadUnknownData() { SkipGroup(); }