summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-14 12:53:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-14 14:22:24 +0200
commit52305b662033ebbac6e09aa66622f7eef2bfccae (patch)
treed25c90e302557323ca821a45b3c13513752e2aa9
parent5a5940858e1f860101c5cb74921e44f2917b37c8 (diff)
convert SvParserState to scoped enum
and drop unused WAITFORDATA enumerator Change-Id: I658802d88a19dcc2d378456375810454e7426447
-rw-r--r--dbaccess/source/ui/misc/HtmlReader.cxx2
-rw-r--r--dbaccess/source/ui/misc/RtfReader.cxx10
-rw-r--r--dbaccess/source/ui/misc/TokenWriter.cxx8
-rw-r--r--editeng/source/editeng/eehtml.cxx2
-rw-r--r--editeng/source/editeng/impedit4.cxx4
-rw-r--r--editeng/source/rtf/svxrtf.cxx12
-rw-r--r--include/svtools/svparser.hxx15
-rw-r--r--svtools/source/svhtml/parhtml.cxx28
-rw-r--r--svtools/source/svrtf/parrtf.cxx28
-rw-r--r--svtools/source/svrtf/svparser.cxx28
-rw-r--r--sw/source/filter/html/htmlcss1.cxx2
-rw-r--r--sw/source/filter/html/htmltab.cxx30
-rw-r--r--sw/source/filter/html/swhtml.cxx36
13 files changed, 100 insertions, 105 deletions
diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx
index a2aaf9d03340..6ab40504d6ee 100644
--- a/dbaccess/source/ui/misc/HtmlReader.cxx
+++ b/dbaccess/source/ui/misc/HtmlReader.cxx
@@ -114,7 +114,7 @@ SvParserState OHTMLReader::CallParser()
rInput.ResetError();
SvParserState eParseState = HTMLParser::CallParser();
SetColumnTypes(m_pColumnList,m_pInfoMap);
- return m_bFoundTable ? eParseState : SVPAR_ERROR;
+ return m_bFoundTable ? eParseState : SvParserState::Error;
}
void OHTMLReader::NextToken( int nToken )
diff --git a/dbaccess/source/ui/misc/RtfReader.cxx b/dbaccess/source/ui/misc/RtfReader.cxx
index 4adee9797122..268845c31cec 100644
--- a/dbaccess/source/ui/misc/RtfReader.cxx
+++ b/dbaccess/source/ui/misc/RtfReader.cxx
@@ -92,7 +92,7 @@ SvParserState ORTFReader::CallParser()
rInput.ResetError();
SvParserState eParseState = SvRTFParser::CallParser();
SetColumnTypes(m_pColumnList,m_pInfoMap);
- return m_bFoundTable ? eParseState : SVPAR_ERROR;
+ return m_bFoundTable ? eParseState : SvParserState::Error;
}
void ORTFReader::NextToken( int nToken )
@@ -122,11 +122,11 @@ void ORTFReader::NextToken( int nToken )
}
nTmpToken2 = GetNextToken();
}
- while(aToken[0] != ';' && eState != SVPAR_ERROR && eState != SVPAR_ACCEPTED);
+ while(aToken[0] != ';' && eState != SvParserState::Error && eState != SvParserState::Accepted);
m_vecColor.push_back(aColor.GetRGBColor());
nTmpToken2 = GetNextToken();
}
- while(nTmpToken2 == RTF_RED && eState != SVPAR_ERROR && eState != SVPAR_ACCEPTED);
+ while(nTmpToken2 == RTF_RED && eState != SvParserState::Error && eState != SvParserState::Accepted);
SkipToken();
}
break;
@@ -221,7 +221,7 @@ void ORTFReader::NextToken( int nToken )
{
do
{}
- while(GetNextToken() != RTF_ROW && eState != SVPAR_ERROR && eState != SVPAR_ACCEPTED);
+ while(GetNextToken() != RTF_ROW && eState != SvParserState::Error && eState != SvParserState::Accepted);
m_bHead = false;
}
break;
@@ -302,7 +302,7 @@ bool ORTFReader::CreateTable(int nToken)
}
nToken = GetNextToken();
}
- while(nToken != RTF_TROWD && eState != SVPAR_ERROR && eState != SVPAR_ACCEPTED);
+ while(nToken != RTF_TROWD && eState != SvParserState::Error && eState != SvParserState::Accepted);
bool bOk = !m_vDestVector.empty();
if(bOk)
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx
index 8b63406349aa..e2edd92abd4e 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -590,7 +590,7 @@ void ORTFImportExport::appendRow(OString* pHorzChar,sal_Int32 _nColumnCount,sal_
bool ORTFImportExport::Read()
{
ODatabaseImportExport::Read();
- SvParserState eState = SVPAR_ERROR;
+ SvParserState eState = SvParserState::Error;
if ( m_pStream )
{
m_pReader = new ORTFReader((*m_pStream),m_xConnection,m_xFormatter,m_xContext);
@@ -602,7 +602,7 @@ bool ORTFImportExport::Read()
m_pReader = nullptr;
}
- return eState != SVPAR_ERROR;
+ return eState != SvParserState::Error;
}
const sal_Int16 OHTMLImportExport::nDefaultFontSize[SBA_HTML_FONTSIZES] =
@@ -661,7 +661,7 @@ bool OHTMLImportExport::Write()
bool OHTMLImportExport::Read()
{
ODatabaseImportExport::Read();
- SvParserState eState = SVPAR_ERROR;
+ SvParserState eState = SvParserState::Error;
if ( m_pStream )
{
m_pReader = new OHTMLReader((*m_pStream),m_xConnection,m_xFormatter,m_xContext);
@@ -674,7 +674,7 @@ bool OHTMLImportExport::Read()
m_pReader = nullptr;
}
- return eState != SVPAR_ERROR;
+ return eState != SvParserState::Error;
}
void OHTMLImportExport::WriteHeader()
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index f0f6cd3ffec7..b76fbe86b67f 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -73,7 +73,7 @@ SvParserState EditHTMLParser::CallParser(EditEngine* pEE, const EditPaM& rPaM)
{
DBG_ASSERT(pEE, "CallParser: ImpEditEngine ?!");
mpEditEngine = pEE;
- SvParserState _eState = SVPAR_NOTSTARTED;
+ SvParserState _eState = SvParserState::NotStarted;
if ( mpEditEngine )
{
// Build in wrap mimic in RTF import?
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 55e175cf0474..0c457228676e 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -164,7 +164,7 @@ EditPaM ImpEditEngine::ReadRTF( SvStream& rInput, EditSelection aSel )
EditRTFParserRef xPrsr = new EditRTFParser(rInput, aSel, *pPool, pEditEngine);
SvParserState eState = xPrsr->CallParser();
- if ( ( eState != SVPAR_ACCEPTED ) && ( !rInput.GetError() ) )
+ if ( ( eState != SvParserState::Accepted ) && ( !rInput.GetError() ) )
{
rInput.SetError( EE_READWRITE_WRONGFORMAT );
return aSel.Min();
@@ -179,7 +179,7 @@ EditPaM ImpEditEngine::ReadHTML( SvStream& rInput, const OUString& rBaseURL, Edi
EditHTMLParserRef xPrsr = new EditHTMLParser( rInput, rBaseURL, pHTTPHeaderAttrs );
SvParserState eState = xPrsr->CallParser(pEditEngine, aSel.Max());
- if ( ( eState != SVPAR_ACCEPTED ) && ( !rInput.GetError() ) )
+ if ( ( eState != SvParserState::Accepted ) && ( !rInput.GetError() ) )
{
rInput.SetError( EE_READWRITE_WRONGFORMAT );
return aSel.Min();
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index c88070c22f26..0aef5b3e32cf 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -107,7 +107,7 @@ SvParserState SvxRTFParser::CallParser()
DBG_ASSERT( pInsPos, "no insertion position");
if( !pInsPos )
- return SVPAR_ERROR;
+ return SvParserState::Error;
if( !aColorTbl.empty() )
ClearColorTbl();
@@ -134,7 +134,7 @@ void SvxRTFParser::Continue( int nToken )
{
SvRTFParser::Continue( nToken );
- if( SVPAR_PENDING != GetStatus() )
+ if( SvParserState::Pending != GetStatus() )
{
SetAllAttrOfStk();
//Regardless of what "color 0" is, word defaults to auto as the default colour.
@@ -328,7 +328,7 @@ void SvxRTFParser::ReadStyleTable()
ReadUnknownData();
nToken = GetNextToken();
if( '}' != nToken )
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
break;
}
++_nOpenBrakets;
@@ -486,7 +486,7 @@ void SvxRTFParser::ReadFontTable()
ReadUnknownData();
nToken = GetNextToken();
if( '}' != nToken )
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
break;
}
++_nOpenBrakets;
@@ -602,7 +602,7 @@ OUString& SvxRTFParser::GetTextToEndGroup( OUString& rStr )
ReadUnknownData();
int nToken = GetNextToken();
if( '}' != nToken )
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
break;
}
++_nOpenBrakets;
@@ -666,7 +666,7 @@ void SvxRTFParser::ReadInfo()
ReadUnknownData();
nToken = GetNextToken();
if( '}' != nToken )
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
break;
}
++_nOpenBrakets;
diff --git a/include/svtools/svparser.hxx b/include/svtools/svparser.hxx
index 03da935fdd9d..ff699e3f5fe1 100644
--- a/include/svtools/svparser.hxx
+++ b/include/svtools/svparser.hxx
@@ -32,14 +32,13 @@
struct SvParser_Impl;
class SvStream;
-enum SvParserState
+enum class SvParserState
{
- SVPAR_ACCEPTED = 0,
- SVPAR_NOTSTARTED,
- SVPAR_WORKING,
- SVPAR_PENDING,
- SVPAR_WAITFORDATA,
- SVPAR_ERROR
+ Accepted = 0,
+ NotStarted,
+ Working,
+ Pending,
+ Error
};
class SVT_DLLPUBLIC SvParser : public SvRefBase
@@ -123,7 +122,7 @@ public:
sal_uInt32 GetNextChar(); // Return next Unicode codepoint in UTF32.
void RereadLookahead();
- inline bool IsParserWorking() const { return SVPAR_WORKING == eState; }
+ inline bool IsParserWorking() const { return SvParserState::Working == eState; }
Link<LinkParamNone*,void> GetAsynchCallLink() const
{ return LINK( const_cast<SvParser*>(this), SvParser, NewDataRead ); }
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index c09ecc59c58c..9df8ceaa796e 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -273,7 +273,7 @@ HTMLParser::~HTMLParser()
SvParserState HTMLParser::CallParser()
{
- eState = SVPAR_WORKING;
+ eState = SvParserState::Working;
nNextCh = GetNextChar();
SaveState( 0 );
@@ -282,7 +282,7 @@ SvParserState HTMLParser::CallParser()
AddFirstRef();
Continue( 0 );
- if( SVPAR_PENDING != eState )
+ if( SvParserState::Pending != eState )
ReleaseRef(); // Parser not needed anymore
return eState;
@@ -607,7 +607,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
if( cChar )
sTmpBuffer.appendUtf32( cChar );
}
- else if( SVPAR_PENDING==eState && '>'!=cBreak )
+ else if( SvParserState::Pending==eState && '>'!=cBreak )
{
// Restart with '&', the remainder is returned as
// text token.
@@ -1080,7 +1080,7 @@ int HTMLParser::GetNextToken_()
if( !IsParserWorking() )
{
- if( SVPAR_PENDING == eState )
+ if( SvParserState::Pending == eState )
bReadNextChar = bReadNextCharSave;
break;
}
@@ -1188,7 +1188,7 @@ int HTMLParser::GetNextToken_()
break;
}
}
- if( SVPAR_PENDING == eState )
+ if( SvParserState::Pending == eState )
bReadNextChar = bReadNextCharSave;
}
else
@@ -1212,7 +1212,7 @@ int HTMLParser::GetNextToken_()
bNextCh = false;
break;
}
- if( SVPAR_PENDING == eState )
+ if( SvParserState::Pending == eState )
bReadNextChar = bReadNextCharSave;
aToken.clear();
}
@@ -1299,7 +1299,7 @@ int HTMLParser::GetNextToken_()
case sal_Unicode(EOF):
if( rInput.IsEof() )
{
- eState = SVPAR_ACCEPTED;
+ eState = SvParserState::Accepted;
nRet = nNextCh;
}
else
@@ -1346,28 +1346,28 @@ scan_text:
bNextCh = 0 == aToken.getLength();
// the text should be processed
- if( !bNextCh && eState == SVPAR_PENDING )
+ if( !bNextCh && eState == SvParserState::Pending )
{
- eState = SVPAR_WORKING;
+ eState = SvParserState::Working;
bReadNextChar = true;
}
break;
}
- if( bNextCh && SVPAR_WORKING == eState )
+ if( bNextCh && SvParserState::Working == eState )
{
nNextCh = GetNextChar();
- if( SVPAR_PENDING == eState && nRet && HTML_TEXTTOKEN != nRet )
+ if( SvParserState::Pending == eState && nRet && HTML_TEXTTOKEN != nRet )
{
bReadNextChar = true;
- eState = SVPAR_WORKING;
+ eState = SvParserState::Working;
}
}
- } while( !nRet && SVPAR_WORKING == eState );
+ } while( !nRet && SvParserState::Working == eState );
- if( SVPAR_PENDING == eState )
+ if( SvParserState::Pending == eState )
nRet = -1; // s.th. invalid
return nRet;
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index d65868cf396b..b822146f8b2d 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -208,10 +208,10 @@ int SvRTFParser::GetNextToken_()
break;
}
}
- else if( SVPAR_PENDING != eState )
+ else if( SvParserState::Pending != eState )
{
// Bug 34631 - "\ " read on - Blank as character
- // eState = SVPAR_ERROR;
+ // eState = SvParserState::Error;
bNextCh = false;
}
break;
@@ -220,7 +220,7 @@ int SvRTFParser::GetNextToken_()
break;
case sal_Unicode(EOF):
- eState = SVPAR_ACCEPTED;
+ eState = SvParserState::Accepted;
nRet = nNextCh;
break;
@@ -278,7 +278,7 @@ int SvRTFParser::GetNextToken_()
if( bNextCh )
nNextCh = GetNextChar();
- } while( !nRet && SVPAR_WORKING == eState );
+ } while( !nRet && SvParserState::Working == eState );
return nRet;
}
@@ -467,7 +467,7 @@ void SvRTFParser::ScanText()
break;
case sal_Unicode(EOF):
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
SAL_FALLTHROUGH;
case '{':
case '}':
@@ -547,8 +547,8 @@ _inSkipGroup++;
}
} while (sal_Unicode(EOF) != nNextCh && IsParserWorking());
- if( SVPAR_PENDING != eState && '}' != nNextCh )
- eState = SVPAR_ERROR;
+ if( SvParserState::Pending != eState && '}' != nNextCh )
+ eState = SvParserState::Error;
_inSkipGroup--;
}
@@ -561,7 +561,7 @@ SvParserState SvRTFParser::CallParser()
sal_Char cFirstCh;
nNextChPos = rInput.Tell();
rInput.ReadChar( cFirstCh ); nNextCh = cFirstCh;
- eState = SVPAR_WORKING;
+ eState = SvParserState::Working;
nOpenBrakets = 0;
SetSrcEncoding( eCodeSet = RTL_TEXTENCODING_MS_1252 );
@@ -570,11 +570,11 @@ SvParserState SvRTFParser::CallParser()
{
AddFirstRef();
Continue( 0 );
- if( SVPAR_PENDING != eState )
+ if( SvParserState::Pending != eState )
ReleaseRef(); // now parser is not needed anymore
}
else
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
return eState;
}
@@ -595,7 +595,7 @@ void SvRTFParser::Continue( int nToken )
case '}':
if( nOpenBrakets )
goto NEXTTOKEN;
- eState = SVPAR_ACCEPTED;
+ eState = SvParserState::Accepted;
break;
case '{':
@@ -611,7 +611,7 @@ void SvRTFParser::Continue( int nToken )
ReadUnknownData();
nToken = GetNextToken();
if( '}' != nToken )
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
break; // move to next token!!
}
}
@@ -646,8 +646,8 @@ NEXTTOKEN:
// continue with new token!
nToken = GetNextToken();
}
- if( SVPAR_ACCEPTED == eState && 0 < nOpenBrakets )
- eState = SVPAR_ERROR;
+ if( SvParserState::Accepted == eState && 0 < nOpenBrakets )
+ eState = SvParserState::Error;
}
void SvRTFParser::SetEncoding( rtl_TextEncoding eEnc )
diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx
index 0540e172be10..f7bb5a8551f8 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -67,7 +67,7 @@ SvParser::SvParser( SvStream& rIn, sal_uInt8 nStackSize )
, pImplData( nullptr )
, nTokenValue( 0 )
, bTokenHasValue( false )
- , eState( SVPAR_NOTSTARTED )
+ , eState( SvParserState::NotStarted )
, eSrcEnc( RTL_TEXTENCODING_DONTKNOW )
, nNextChPos(0)
, nNextCh(0)
@@ -77,7 +77,7 @@ SvParser::SvParser( SvStream& rIn, sal_uInt8 nStackSize )
, nTokenStackSize( nStackSize )
, nTokenStackPos( 0 )
{
- eState = SVPAR_NOTSTARTED;
+ eState = SvParserState::NotStarted;
if( nTokenStackSize < 3 )
nTokenStackSize = 3;
pTokenStack = new TokenStackType[ nTokenStackSize ];
@@ -397,7 +397,7 @@ sal_uInt32 SvParser::GetNextChar()
{
if( ERRCODE_IO_PENDING == rInput.GetError() )
{
- eState = SVPAR_PENDING;
+ eState = SvParserState::Pending;
return c;
}
else
@@ -426,7 +426,7 @@ int SvParser::GetNextToken()
bTokenHasValue = false;
nRet = GetNextToken_();
- if( SVPAR_PENDING == eState )
+ if( SvParserState::Pending == eState )
return nRet;
}
@@ -444,15 +444,15 @@ int SvParser::GetNextToken()
nRet = pTokenStackPos->nTokenId;
}
// no, now push actual value on stack
- else if( SVPAR_WORKING == eState )
+ else if( SvParserState::Working == eState )
{
pTokenStackPos->sToken = aToken;
pTokenStackPos->nTokenValue = nTokenValue;
pTokenStackPos->bTokenHasValue = bTokenHasValue;
pTokenStackPos->nTokenId = nRet;
}
- else if( SVPAR_ACCEPTED != eState && SVPAR_PENDING != eState )
- eState = SVPAR_ERROR; // an error occurred
+ else if( SvParserState::Accepted != eState && SvParserState::Pending != eState )
+ eState = SvParserState::Error; // an error occurred
return nRet;
}
@@ -618,8 +618,8 @@ IMPL_LINK_NOARG( SvParser, NewDataRead, LinkParamNone*, void )
{
switch( eState )
{
- case SVPAR_PENDING:
- eState = SVPAR_WORKING;
+ case SvParserState::Pending:
+ eState = SvParserState::Working;
RestoreState();
Continue( pImplData->nToken );
@@ -627,16 +627,12 @@ IMPL_LINK_NOARG( SvParser, NewDataRead, LinkParamNone*, void )
if( ERRCODE_IO_PENDING == rInput.GetError() )
rInput.ResetError();
- if( SVPAR_PENDING != eState )
+ if( SvParserState::Pending != eState )
ReleaseRef(); // ready otherwise!
break;
- case SVPAR_WAITFORDATA:
- eState = SVPAR_WORKING;
- break;
-
- case SVPAR_NOTSTARTED:
- case SVPAR_WORKING:
+ case SvParserState::NotStarted:
+ case SvParserState::Working:
break;
default:
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index bc3dece541ca..6c0e7be260e1 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -1715,7 +1715,7 @@ bool SwHTMLParser::FileDownload( const OUString& rURL,
|| 1 == m_xDoc->getReferenceCount() )
{
// wurde der Import vom SFX abgebrochen?
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
pStream = nullptr;
}
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 8de1d9ebcf48..f0705e586555 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -3391,7 +3391,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
delete m_pPendStack;
m_pPendStack = pTmp;
nToken = m_pPendStack ? m_pPendStack->nToken : GetSaveToken();
- bPending = SVPAR_ERROR == eState && m_pPendStack != nullptr;
+ bPending = SvParserState::Error == eState && m_pPendStack != nullptr;
SaveState( nToken );
}
@@ -3873,7 +3873,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
bHead,
pSaveStruct->IsInSection(),
bHasToFly );
- if( SVPAR_PENDING != GetStatus() )
+ if( SvParserState::Pending != GetStatus() )
{
// nur wenn die Tabelle wirklich zu Ende ist!
if( pSubTable )
@@ -3994,7 +3994,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
nToken = GetNextToken();
}
- if( SVPAR_PENDING == GetStatus() )
+ if( SvParserState::Pending == GetStatus() )
{
m_pPendStack = new SwPendingStack( bHead ? HTML_TABLEHEADER_ON
: HTML_TABLEDATA_ON, m_pPendStack );
@@ -4111,7 +4111,7 @@ void SwHTMLParser::BuildTableRow( HTMLTable *pCurTable, bool bReadOptions,
delete m_pPendStack;
m_pPendStack = pTmp;
nToken = m_pPendStack ? m_pPendStack->nToken : GetSaveToken();
- bPending = SVPAR_ERROR == eState && m_pPendStack != nullptr;
+ bPending = SvParserState::Error == eState && m_pPendStack != nullptr;
SaveState( nToken );
}
@@ -4223,7 +4223,7 @@ void SwHTMLParser::BuildTableRow( HTMLTable *pCurTable, bool bReadOptions,
case HTML_TABLEHEADER_ON:
case HTML_TABLEDATA_ON:
BuildTableCell( pCurTable, true, HTML_TABLEHEADER_ON==nToken );
- if( SVPAR_PENDING != GetStatus() )
+ if( SvParserState::Pending != GetStatus() )
{
pSaveStruct->bHasCells = true;
bDone = m_pTable->IsOverflowing();
@@ -4283,7 +4283,7 @@ void SwHTMLParser::BuildTableRow( HTMLTable *pCurTable, bool bReadOptions,
nToken = GetNextToken();
}
- if( SVPAR_PENDING == GetStatus() )
+ if( SvParserState::Pending == GetStatus() )
{
m_pPendStack = new SwPendingStack( HTML_TABLEROW_ON, m_pPendStack );
m_pPendStack->pData = pSaveStruct;
@@ -4317,7 +4317,7 @@ void SwHTMLParser::BuildTableSection( HTMLTable *pCurTable,
delete m_pPendStack;
m_pPendStack = pTmp;
nToken = m_pPendStack ? m_pPendStack->nToken : GetSaveToken();
- bPending = SVPAR_ERROR == eState && m_pPendStack != nullptr;
+ bPending = SvParserState::Error == eState && m_pPendStack != nullptr;
SaveState( nToken );
}
@@ -4445,7 +4445,7 @@ void SwHTMLParser::BuildTableSection( HTMLTable *pCurTable,
nToken = GetNextToken();
}
- if( SVPAR_PENDING == GetStatus() )
+ if( SvParserState::Pending == GetStatus() )
{
m_pPendStack = new SwPendingStack( bHead ? HTML_THEAD_ON
: HTML_TBODY_ON, m_pPendStack );
@@ -4505,7 +4505,7 @@ void SwHTMLParser::BuildTableColGroup( HTMLTable *pCurTable,
delete m_pPendStack;
m_pPendStack = pTmp;
nToken = m_pPendStack ? m_pPendStack->nToken : GetSaveToken();
- bPending = SVPAR_ERROR == eState && m_pPendStack != nullptr;
+ bPending = SvParserState::Error == eState && m_pPendStack != nullptr;
SaveState( nToken );
}
@@ -4662,7 +4662,7 @@ void SwHTMLParser::BuildTableColGroup( HTMLTable *pCurTable,
nToken = GetNextToken();
}
- if( SVPAR_PENDING == GetStatus() )
+ if( SvParserState::Pending == GetStatus() )
{
m_pPendStack = new SwPendingStack( HTML_COL_ON, m_pPendStack );
m_pPendStack->pData = pSaveStruct;
@@ -4808,7 +4808,7 @@ void SwHTMLParser::BuildTableCaption( HTMLTable *pCurTable )
{
BuildTable( SVX_ADJUST_END );
}
- if( SVPAR_PENDING != GetStatus() )
+ if( SvParserState::Pending != GetStatus() )
{
m_pTable = pSaveStruct->m_pTable;
}
@@ -4848,7 +4848,7 @@ void SwHTMLParser::BuildTableCaption( HTMLTable *pCurTable )
nToken = GetNextToken();
}
- if( SVPAR_PENDING==GetStatus() )
+ if( SvParserState::Pending==GetStatus() )
{
m_pPendStack = new SwPendingStack( HTML_CAPTION_ON, m_pPendStack );
m_pPendStack->pData = pSaveStruct;
@@ -5103,7 +5103,7 @@ HTMLTable *SwHTMLParser::BuildTable( SvxAdjust eParentAdjust,
delete m_pPendStack;
m_pPendStack = pTmp;
nToken = m_pPendStack ? m_pPendStack->nToken : GetSaveToken();
- bPending = SVPAR_ERROR == eState && m_pPendStack != nullptr;
+ bPending = SvParserState::Error == eState && m_pPendStack != nullptr;
SaveState( nToken );
}
@@ -5227,7 +5227,7 @@ HTMLTable *SwHTMLParser::BuildTable( SvxAdjust eParentAdjust,
nToken = GetNextToken();
}
- if( SVPAR_PENDING == GetStatus() )
+ if( SvParserState::Pending == GetStatus() )
{
m_pPendStack = new SwPendingStack( HTML_TABLE_ON, m_pPendStack );
m_pPendStack->pData = pSaveStruct;
@@ -5338,7 +5338,7 @@ HTMLTable *SwHTMLParser::BuildTable( SvxAdjust eParentAdjust,
// kein Show aufgerufen werden, weil sonst waehrend des
// Reschedules der Parser zerstoert wird, wenn noch ein
// DataAvailable-Link kommt. Deshalb: Nur im WORKING-State.
- if( !m_nParaCnt && SVPAR_WORKING == GetStatus() )
+ if( !m_nParaCnt && SvParserState::Working == GetStatus() )
Show();
}
}
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index fc8bdc9878c5..639b5ca1eebb 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -218,9 +218,9 @@ sal_uLong HTMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPam,
SvParserState eState = xParser->CallParser();
- if( SVPAR_PENDING == eState )
+ if( SvParserState::Pending == eState )
pStrm->ResetError();
- else if( SVPAR_ACCEPTED != eState )
+ else if( SvParserState::Accepted != eState )
{
const OUString sErr(OUString::number((sal_Int32)xParser->GetLineNr())
+ "," + OUString::number((sal_Int32)xParser->GetLinePos()));
@@ -489,7 +489,7 @@ IMPL_LINK_NOARG( SwHTMLParser, AsyncCallback, void*, void )
|| 1 == m_xDoc->getReferenceCount() )
{
// wurde der Import vom SFX abgebrochen?
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
}
GetAsynchCallLink().Call(nullptr);
@@ -562,21 +562,21 @@ void SwHTMLParser::Continue( int nToken )
// Wenn der Import (vom SFX) abgebrochen wurde, wird ein Fehler
// gesetzt aber trotzdem noch weiter gemacht, damit vernuenftig
// aufgeraeumt wird.
- OSL_ENSURE( SVPAR_ERROR!=eState,
+ OSL_ENSURE( SvParserState::Error!=eState,
"SwHTMLParser::Continue: bereits ein Fehler gesetzt" );
if( m_xDoc->GetDocShell() && m_xDoc->GetDocShell()->IsAbortingImport() )
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
// Die SwViewShell vom Dokument holen, merken und als aktuelle setzen.
SwViewShell *pInitVSh = CallStartAction();
- if( SVPAR_ERROR != eState && GetMedium() && !m_bViewCreated )
+ if( SvParserState::Error != eState && GetMedium() && !m_bViewCreated )
{
// Beim ersten Aufruf erstmal returnen, Doc anzeigen
// und auf Timer Callback warten.
// An dieser Stelle wurde im CallParser gerade mal ein Zeichen
// gelesen und ein SaveState(0) gerufen.
- eState = SVPAR_PENDING;
+ eState = SvParserState::Pending;
m_bViewCreated = true;
m_xDoc->SetInLoadAsynchron( true );
@@ -609,7 +609,7 @@ void SwHTMLParser::Continue( int nToken )
// Falls ein Pending-Stack existiert aber durch einen Aufruf
// von NextToken dafuer sorgen, dass der Pending-Stack noch
// beendet wird.
- if( SVPAR_ERROR == eState )
+ if( SvParserState::Error == eState )
{
OSL_ENSURE( !m_pPendStack || m_pPendStack->nToken,
"SwHTMLParser::Continue: Pending-Stack ohne Token" );
@@ -627,7 +627,7 @@ void SwHTMLParser::Continue( int nToken )
EndProgress( m_xDoc->GetDocShell() );
bool bLFStripped = false;
- if( SVPAR_PENDING != GetStatus() )
+ if( SvParserState::Pending != GetStatus() )
{
// noch die letzten Attribute setzen
{
@@ -724,7 +724,7 @@ if( m_pSttNdIdx->GetIndex()+1 == m_pPam->GetBound( false ).nNode.GetIndex() )
}
}
- if( SVPAR_ACCEPTED == eState )
+ if( SvParserState::Accepted == eState )
{
if( m_nMissingImgMaps )
{
@@ -850,7 +850,7 @@ if( m_pSttNdIdx->GetIndex()+1 == m_pPam->GetBound( false ).nNode.GetIndex() )
}
}
- if( SVPAR_PENDING != GetStatus() )
+ if( SvParserState::Pending != GetStatus() )
{
delete m_pSttNdIdx;
m_pSttNdIdx = nullptr;
@@ -942,7 +942,7 @@ void SwHTMLParser::NextToken( int nToken )
{
// Was the import cancelled by SFX? If a pending stack
// exists, clean it.
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
OSL_ENSURE( !m_pPendStack || m_pPendStack->nToken,
"SwHTMLParser::NextToken: Pending-Stack without token" );
if( 1 == m_xDoc->getReferenceCount() || !m_pPendStack )
@@ -1492,7 +1492,7 @@ void SwHTMLParser::NextToken( int nToken )
// an error code
if( 1 == m_xDoc->getReferenceCount() )
{
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
}
break;
@@ -2473,7 +2473,7 @@ void SwHTMLParser::Show()
// - die eiegen View-Shell wieder gesetzt
// - und Start-Action gerufen
- OSL_ENSURE( SVPAR_WORKING==eState, "Show nicht im Working-State - Das kann ins Auge gehen" );
+ OSL_ENSURE( SvParserState::Working==eState, "Show nicht im Working-State - Das kann ins Auge gehen" );
SwViewShell *pOldVSh = CallEndAction();
Application::Reschedule();
@@ -2482,7 +2482,7 @@ void SwHTMLParser::Show()
|| 1 == m_xDoc->getReferenceCount() )
{
// wurde der Import vom SFX abgebrochen?
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
}
// Die SwViewShell nochmal holen, denn sie koennte im Reschedule
@@ -2505,7 +2505,7 @@ void SwHTMLParser::ShowStatline()
// - die eiegen View-Shell wieder gesetzt
// - ein Start/End-Action gerufen, wenn gescrollt wurde.
- OSL_ENSURE( SVPAR_WORKING==eState, "ShowStatLine nicht im Working-State - Das kann ins Auge gehen" );
+ OSL_ENSURE( SvParserState::Working==eState, "ShowStatLine nicht im Working-State - Das kann ins Auge gehen" );
// Laufbalkenanzeige
if( !GetMedium() || !GetMedium()->IsRemote() )
@@ -2520,7 +2520,7 @@ void SwHTMLParser::ShowStatline()
if( ( m_xDoc->GetDocShell() && m_xDoc->GetDocShell()->IsAbortingImport() )
|| 1 == m_xDoc->getReferenceCount() )
// wurde der Import vom SFX abgebrochen?
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
SwViewShell *pVSh = CheckActionViewShell();
if( pVSh && pVSh->HasInvalidRect() )
@@ -2606,7 +2606,7 @@ SwViewShell *SwHTMLParser::CallEndAction( bool bChkAction, bool bChkPtr )
// man hier abbrechen und einen Fehler setzen.
if( 1 == m_xDoc->getReferenceCount() )
{
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
}
SwViewShell *pVSh = m_pActionViewShell;