fastparser: avoid allocation and conversion of elementnames we don't need.

Change-Id: I4c09aaa12b53181e50662de2721d170c195c7c86
This commit is contained in:
Michael Meeks
2013-11-23 10:02:34 +00:00
parent 3e7b69ae35
commit b7a8fc5585

View File

@@ -998,14 +998,18 @@ void FastSaxParser::callbackStartElement( const XML_Char* pwName, const XML_Char
rEvent.mnElementToken = GetToken( pName );
if( rEvent.mnElementToken == FastToken::DONTKNOW )
{
if( nPrefixLen > 0 )
{
rEvent.msNamespace = GetNamespaceURL( pPrefix, nPrefixLen );
nNamespaceToken = GetNamespaceToken( rEvent.msNamespace );
}
rEvent.msElementName = OUString( pName, nNameLen, RTL_TEXTENCODING_UTF8 );
}
else // token is always preferred.
rEvent.msElementName = OUString( "" );
rEntity.maNamespaceStack.push( NameWithToken(rEvent.msNamespace, nNamespaceToken) );
rEvent.msElementName = OUString(pName, nNameLen, RTL_TEXTENCODING_UTF8);
if (rEntity.mbEnableThreads)
produce( START_ELEMENT );
else