[Libreoffice-commits] core.git: sax/source
Michael Meeks
michael.meeks at collabora.com
Sat Nov 23 02:04:09 PST 2013
sax/source/fastparser/fastparser.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit b7a8fc55854bbd7b977783e76e9a19354d0e74a6
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Sat Nov 23 10:02:34 2013 +0000
fastparser: avoid allocation and conversion of elementnames we don't need.
Change-Id: I4c09aaa12b53181e50662de2721d170c195c7c86
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 8f68051..da224d0 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -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
More information about the Libreoffice-commits
mailing list