diff options
-rw-r--r-- | l10ntools/source/help/HelpLinker.cxx | 4 | ||||
-rw-r--r-- | sax/source/expatwrap/sax_expat.cxx | 2 | ||||
-rw-r--r-- | sax/source/fastparser/fastparser.cxx | 3 | ||||
-rw-r--r-- | shell/source/all/xml_parser.cxx | 4 | ||||
-rw-r--r-- | xmlhelp/source/treeview/tvread.cxx | 6 |
5 files changed, 11 insertions, 8 deletions
diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx index f61c5cd4dd38..dd1057a3d25b 100644 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -1065,9 +1065,9 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp aFile.close(); XML_Parser parser = XML_ParserCreate( 0 ); - int parsed = XML_Parse( parser, s, int( len ), true ); + XML_Status parsed = XML_Parse( parser, s, int( len ), true ); - if( parsed == 0 ) + if (XML_STATUS_ERROR == parsed) { XML_Error nError = XML_GetErrorCode( parser ); o_rHelpProcessingErrorInfo.m_eErrorClass = HELPPROCESSING_XMLPARSING_ERROR; diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index c4d214b3a9e1..33707c440d9b 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -740,7 +740,7 @@ void SaxExpatParser_Impl::parse( ) sal_Bool bContinue = ( XML_Parse( getEntity().pParser , (const char *) seqOut.getArray(), nRead, - 0 ) != 0 ); + 0 ) != XML_STATUS_ERROR ); if( ! bContinue || this->bExceptionWasThrown ) { diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 965a1a82b4d5..4f63130f1393 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -658,7 +658,8 @@ void FastSaxParser::parse() break; } - bool bContinue = XML_Parse( rEntity.mpParser, (const char*) seqOut.getConstArray(), nRead, 0 ) != 0; + bool const bContinue = XML_STATUS_ERROR != XML_Parse(rEntity.mpParser, + reinterpret_cast<const char*>(seqOut.getConstArray()), nRead, 0); // callbacks used inside XML_Parse may have caught an exception if( !bContinue || rEntity.maSavedException.hasValue() ) { diff --git a/shell/source/all/xml_parser.cxx b/shell/source/all/xml_parser.cxx index e7740d0f4a5c..6c2daaa8a82f 100644 --- a/shell/source/all/xml_parser.cxx +++ b/shell/source/all/xml_parser.cxx @@ -177,13 +177,15 @@ void xml_parser::init() void xml_parser::parse(const char* XmlData, size_t Length, bool IsFinal) { - if (0 == XML_Parse(xml_parser_, XmlData, Length, IsFinal)) + if (XML_STATUS_ERROR == XML_Parse(xml_parser_, XmlData, Length, IsFinal)) + { throw xml_parser_exception( (char*)XML_ErrorString(XML_GetErrorCode(xml_parser_)), (int)XML_GetErrorCode(xml_parser_), XML_GetCurrentLineNumber(xml_parser_), XML_GetCurrentColumnNumber(xml_parser_), XML_GetCurrentByteIndex(xml_parser_)); + } } void xml_parser::set_document_handler( diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 0510ebf838c0..8357a3bc7f0f 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -528,9 +528,9 @@ TVChildTarget::TVChildTarget( const Reference< XMultiServiceFactory >& xMSF ) data_handler); XML_SetUserData( parser,&pTVDom ); // does not return this - int parsed = XML_Parse( parser,s,int( len ),j==0 ); - (void)parsed; - OSL_ENSURE( parsed, "TVChildTarget::TVChildTarget(): Tree file parsing failed" ); + XML_Status const parsed = XML_Parse(parser, s, int(len), j==0); + SAL_WARN_IF(XML_STATUS_ERROR == parsed, "xmlhelp", + "TVChildTarget::TVChildTarget(): Tree file parsing failed"); XML_ParserFree( parser ); delete[] s; |