summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-27 12:08:15 +0100
committerAndras Timar <andras.timar@collabora.com>2018-04-12 10:54:34 +0200
commit3b4b5b3ffaa03919a66aef2ec84dfa6d3267b4e1 (patch)
tree00795fe5b0a0d2e6cb4fecba618da55a7ffb479b /svtools
parentc483ed87ec89e17aaebbae0a99c0246be374c1c2 (diff)
Resolves: tdf#116540 Revert "ofz infinite loop"
This reverts commit e4551b905e12aa92b7509d9b994bfae5dec3d8e0. Change-Id: I95634dd166c51586b5da47b996993a098823ca32 Reviewed-on: https://gerrit.libreoffice.org/51942 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 35f5f4c1537eadab85cddde5f9fd47a7421ebf3d)
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/svrtf/parrtf.cxx8
-rw-r--r--svtools/source/svrtf/svparser.cxx5
2 files changed, 1 insertions, 12 deletions
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index 52e350f52442..53bb4c7c8d32 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -602,12 +602,8 @@ void SvRTFParser::Continue( int nToken )
if( !nToken )
nToken = GetNextToken();
- bool bLooping = false;
-
- while (IsParserWorking() && !bLooping)
+ while( IsParserWorking() )
{
- auto nCurrentTokenIndex = m_nTokenIndex;
-
SaveState( nToken );
switch( nToken )
{
@@ -664,8 +660,6 @@ NEXTTOKEN:
SaveState( 0 ); // processed till here,
// continue with new token!
nToken = GetNextToken();
-
- bLooping = nCurrentTokenIndex == m_nTokenIndex;
}
if( SvParserState::Accepted == eState && 0 < nOpenBrakets )
eState = SvParserState::Error;
diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx
index 021fa7255f77..b8d313e25e77 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -76,7 +76,6 @@ SvParser<T>::SvParser( SvStream& rIn, sal_uInt8 nStackSize )
, nlLineNr( 1 )
, nlLinePos( 1 )
, pImplData( nullptr )
- , m_nTokenIndex(0)
, nTokenValue( 0 )
, bTokenHasValue( false )
, eState( SvParserState::NotStarted )
@@ -476,7 +475,6 @@ T SvParser<T>::GetNextToken()
bTokenHasValue = pTokenStackPos->bTokenHasValue;
aToken = pTokenStackPos->sToken;
nRet = pTokenStackPos->nTokenId;
- ++m_nTokenIndex;
}
// no, now push actual value on stack
else if( SvParserState::Working == eState )
@@ -485,7 +483,6 @@ T SvParser<T>::GetNextToken()
pTokenStackPos->nTokenValue = nTokenValue;
pTokenStackPos->bTokenHasValue = bTokenHasValue;
pTokenStackPos->nTokenId = nRet;
- ++m_nTokenIndex;
}
else if( SvParserState::Accepted != eState && SvParserState::Pending != eState )
eState = SvParserState::Error; // an error occurred
@@ -504,8 +501,6 @@ T SvParser<T>::SkipToken( short nCnt ) // "skip" n Tokens backward
nTmp = nTokenStackSize;
nTokenStackPos = sal_uInt8(nTmp);
- m_nTokenIndex -= nTmp;
-
// restore values
aToken = pTokenStackPos->sToken;
nTokenValue = pTokenStackPos->nTokenValue;