Kaydet (Commit) 4db5b17c authored tarafından Michael Stahl's avatar Michael Stahl

sax: convert some legacy assertions

Change-Id: I3b4f1caa2c2d7a0fd88ea53bf05d01b2c7cc115a
üst ed09e6b2
...@@ -237,6 +237,7 @@ certain functionality. ...@@ -237,6 +237,7 @@ certain functionality.
@li @c linguistic @li @c linguistic
@li @c oox @li @c oox
@li @c rsc @li @c rsc
@li @c sax
@li @c shell @li @c shell
@li @c stoc @li @c stoc
@li @c svx @li @c svx
......
...@@ -794,7 +794,7 @@ void SaxExpatParser_Impl::callbackStartElement( void *pvThis , ...@@ -794,7 +794,7 @@ void SaxExpatParser_Impl::callbackStartElement( void *pvThis ,
pImpl->pAttrList->clear(); pImpl->pAttrList->clear();
while( awAttributes[i] ) { while( awAttributes[i] ) {
OSL_ASSERT( awAttributes[i+1] ); assert(awAttributes[i+1]);
pImpl->pAttrList->addAttribute( pImpl->pAttrList->addAttribute(
XML_CHAR_TO_OUSTRING( awAttributes[i] ) , XML_CHAR_TO_OUSTRING( awAttributes[i] ) ,
pImpl->sCDATA, // expat doesn't know types pImpl->sCDATA, // expat doesn't know types
...@@ -853,10 +853,10 @@ void SaxExpatParser_Impl::callbackEntityDecl( ...@@ -853,10 +853,10 @@ void SaxExpatParser_Impl::callbackEntityDecl(
{ {
SaxExpatParser_Impl *pImpl = ((SaxExpatParser_Impl*)pvThis); SaxExpatParser_Impl *pImpl = ((SaxExpatParser_Impl*)pvThis);
if (value) { // value != 0 means internal entity if (value) { // value != 0 means internal entity
OSL_TRACE("SaxExpatParser: internal entity declaration, stopping"); SAL_INFO("sax","SaxExpatParser: internal entity declaration, stopping");
XML_StopParser(pImpl->getEntity().pParser, XML_FALSE); XML_StopParser(pImpl->getEntity().pParser, XML_FALSE);
pImpl->exception = SAXParseException( pImpl->exception = SAXParseException(
::rtl::OUString( "SaxExpatParser: internal entity declaration, stopping"), "SaxExpatParser: internal entity declaration, stopping",
0, Any(), 0, Any(),
pImpl->rDocumentLocator->getPublicId(), pImpl->rDocumentLocator->getPublicId(),
pImpl->rDocumentLocator->getSystemId(), pImpl->rDocumentLocator->getSystemId(),
......
...@@ -235,7 +235,7 @@ void FastSaxParser::pushContext() ...@@ -235,7 +235,7 @@ void FastSaxParser::pushContext()
void FastSaxParser::popContext() void FastSaxParser::popContext()
{ {
Entity& rEntity = getEntity(); Entity& rEntity = getEntity();
OSL_ENSURE( !rEntity.maContextStack.empty(), "sax::FastSaxParser::popContext(), pop without push?" ); assert(!rEntity.maContextStack.empty()); // pop without push?
if( !rEntity.maContextStack.empty() ) if( !rEntity.maContextStack.empty() )
rEntity.maContextStack.pop(); rEntity.maContextStack.pop();
} }
...@@ -245,7 +245,7 @@ void FastSaxParser::popContext() ...@@ -245,7 +245,7 @@ void FastSaxParser::popContext()
void FastSaxParser::DefineNamespace( const OString& rPrefix, const sal_Char* pNamespaceURL ) void FastSaxParser::DefineNamespace( const OString& rPrefix, const sal_Char* pNamespaceURL )
{ {
Entity& rEntity = getEntity(); Entity& rEntity = getEntity();
OSL_ENSURE( !rEntity.maContextStack.empty(), "sax::FastSaxParser::DefineNamespace(), I need a context!" ); assert(!rEntity.maContextStack.empty()); // need a context!
if( !rEntity.maContextStack.empty() ) if( !rEntity.maContextStack.empty() )
{ {
sal_uInt32 nOffset = rEntity.maContextStack.top()->mnNamespaceCount++; sal_uInt32 nOffset = rEntity.maContextStack.top()->mnNamespaceCount++;
...@@ -743,7 +743,7 @@ void FastSaxParser::callbackStartElement( const XML_Char* pwName, const XML_Char ...@@ -743,7 +743,7 @@ void FastSaxParser::callbackStartElement( const XML_Char* pwName, const XML_Char
// #158414# first: get namespaces // #158414# first: get namespaces
for( ; awAttributes[i]; i += 2 ) for( ; awAttributes[i]; i += 2 )
{ {
OSL_ASSERT( awAttributes[i+1] ); assert(awAttributes[i+1]);
splitName( awAttributes[i], pPrefix, nPrefixLen, pName, nNameLen ); splitName( awAttributes[i], pPrefix, nPrefixLen, pName, nNameLen );
if( nPrefixLen ) if( nPrefixLen )
...@@ -853,7 +853,7 @@ void FastSaxParser::callbackStartElement( const XML_Char* pwName, const XML_Char ...@@ -853,7 +853,7 @@ void FastSaxParser::callbackStartElement( const XML_Char* pwName, const XML_Char
void FastSaxParser::callbackEndElement( SAL_UNUSED_PARAMETER const XML_Char* ) void FastSaxParser::callbackEndElement( SAL_UNUSED_PARAMETER const XML_Char* )
{ {
Entity& rEntity = getEntity(); Entity& rEntity = getEntity();
OSL_ENSURE( !rEntity.maContextStack.empty(), "FastSaxParser::callbackEndElement - no context" ); assert(!rEntity.maContextStack.empty()); // no context?
if( !rEntity.maContextStack.empty() ) if( !rEntity.maContextStack.empty() )
{ {
SaxContextImplPtr pContext = rEntity.maContextStack.top(); SaxContextImplPtr pContext = rEntity.maContextStack.top();
...@@ -900,18 +900,17 @@ void FastSaxParser::callbackEntityDecl( ...@@ -900,18 +900,17 @@ void FastSaxParser::callbackEntityDecl(
SAL_UNUSED_PARAMETER const XML_Char * /*notationName*/) SAL_UNUSED_PARAMETER const XML_Char * /*notationName*/)
{ {
if (value) { // value != 0 means internal entity if (value) { // value != 0 means internal entity
OSL_TRACE("FastSaxParser: internal entity declaration, stopping"); SAL_INFO("sax", "FastSaxParser: internal entity declaration, stopping");
XML_StopParser(getEntity().mpParser, XML_FALSE); XML_StopParser(getEntity().mpParser, XML_FALSE);
getEntity().maSavedException <<= SAXParseException( getEntity().maSavedException <<= SAXParseException(
::rtl::OUString( "FastSaxParser: internal entity declaration, stopping",
"FastSaxParser: internal entity declaration, stopping"),
static_cast<OWeakObject*>(this), Any(), static_cast<OWeakObject*>(this), Any(),
mxDocumentLocator->getPublicId(), mxDocumentLocator->getPublicId(),
mxDocumentLocator->getSystemId(), mxDocumentLocator->getSystemId(),
mxDocumentLocator->getLineNumber(), mxDocumentLocator->getLineNumber(),
mxDocumentLocator->getColumnNumber() ); mxDocumentLocator->getColumnNumber() );
} else { } else {
OSL_TRACE("FastSaxParser: ignoring external entity declaration"); SAL_INFO("sax", "FastSaxParser: ignoring external entity declaration");
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment