From 6d7536ce4e6b51f499ccdd6aa0e749bda2d63d46 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 16 Jan 2011 14:12:57 +0000 Subject: equalsAsciiL faster than equalsAscii & comparetoAscii(const sal_Char*) --- xmlhelp/source/cxxhelp/provider/content.cxx | 38 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'xmlhelp/source/cxxhelp/provider/content.cxx') diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx index 895a02e1a882..b0612f026a51 100644 --- a/xmlhelp/source/cxxhelp/provider/content.cxx +++ b/xmlhelp/source/cxxhelp/provider/content.cxx @@ -313,7 +313,7 @@ uno::Any SAL_CALL Content::execute( { uno::Any aRet; - if ( aCommand.Name.compareToAscii( "getPropertyValues" ) == 0 ) + if ( aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("getPropertyValues")) ) { uno::Sequence< beans::Property > Properties; if ( !( aCommand.Argument >>= Properties ) ) @@ -324,7 +324,7 @@ uno::Any SAL_CALL Content::execute( aRet <<= getPropertyValues( Properties ); } - else if ( aCommand.Name.compareToAscii( "setPropertyValues" ) == 0 ) + else if ( aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("setPropertyValues")) ) { uno::Sequence propertyValues; @@ -347,17 +347,17 @@ uno::Any SAL_CALL Content::execute( aRet <<= ret; } - else if ( aCommand.Name.compareToAscii( "getPropertySetInfo" ) == 0 ) + else if ( aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("getPropertySetInfo")) ) { // Note: Implemented by base class. aRet <<= getPropertySetInfo( Environment ); } - else if ( aCommand.Name.compareToAscii( "getCommandInfo" ) == 0 ) + else if ( aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("getCommandInfo")) ) { // Note: Implemented by base class. aRet <<= getCommandInfo( Environment ); } - else if ( aCommand.Name.compareToAscii( "open" ) == 0 ) + else if ( aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("open")) ) { ucb::OpenCommandArgument2 aOpenCommand; if ( !( aCommand.Argument >>= aOpenCommand ) ) @@ -459,26 +459,26 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( { const beans::Property& rProp = rProperties[n]; - if ( rProp.Name.compareToAscii( "ContentType" ) == 0 ) + if ( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ContentType")) ) xRow->appendString( rProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "application/vnd.sun.star.help" )) ); - else if( rProp.Name.compareToAscii( "Title" ) == 0 ) + else if( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Title")) ) xRow->appendString ( rProp,m_aURLParameter.get_title() ); - else if( rProp.Name.compareToAscii( "IsReadOnly" ) == 0 ) + else if( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IsReadOnly")) ) xRow->appendBoolean( rProp,true ); - else if( rProp.Name.compareToAscii( "IsDocument" ) == 0 ) + else if( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IsDocument")) ) xRow->appendBoolean( rProp, m_aURLParameter.isFile() || m_aURLParameter.isRoot() ); - else if( rProp.Name.compareToAscii( "IsFolder" ) == 0 ) + else if( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IsFolder")) ) xRow->appendBoolean( rProp, ! m_aURLParameter.isFile() || m_aURLParameter.isRoot() ); - else if( rProp.Name.compareToAscii( "IsErrorDocument" ) == 0 ) + else if( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IsErrorDocument")) ) xRow->appendBoolean( rProp, m_aURLParameter.isErrorDocument() ); - else if( rProp.Name.compareToAscii( "MediaType" ) == 0 ) + else if( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MediaType")) ) if( m_aURLParameter.isPicture() ) xRow->appendString( rProp, @@ -497,7 +497,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( else xRow->appendVoid( rProp ); else if( m_aURLParameter.isModule() ) - if( rProp.Name.compareToAscii( "KeywordList" ) == 0 ) + if( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KeywordList")) ) { KeywordInfo *inf = m_pDatabases->getKeyword( m_aURLParameter.get_module(), @@ -508,7 +508,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( aAny <<= inf->getKeywordList(); xRow->appendObject( rProp,aAny ); } - else if( rProp.Name.compareToAscii( "KeywordRef" ) == 0 ) + else if( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KeywordRef")) ) { KeywordInfo *inf = m_pDatabases->getKeyword( m_aURLParameter.get_module(), @@ -519,7 +519,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( aAny <<= inf->getIdList(); xRow->appendObject( rProp,aAny ); } - else if( rProp.Name.compareToAscii( "KeywordAnchorForRef" ) == 0 ) + else if( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KeywordAnchorForRef")) ) { KeywordInfo *inf = m_pDatabases->getKeyword( m_aURLParameter.get_module(), @@ -530,7 +530,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( aAny <<= inf->getAnchorList(); xRow->appendObject( rProp,aAny ); } - else if( rProp.Name.compareToAscii( "KeywordTitleForRef" ) == 0 ) + else if( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KeywordTitleForRef")) ) { KeywordInfo *inf = m_pDatabases->getKeyword( m_aURLParameter.get_module(), @@ -541,7 +541,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( aAny <<= inf->getTitleList(); xRow->appendObject( rProp,aAny ); } - else if( rProp.Name.compareToAscii( "SearchScopes" ) == 0 ) + else if( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SearchScopes")) ) { uno::Sequence< rtl::OUString > seq( 2 ); seq[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Heading" )); @@ -550,7 +550,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( aAny <<= seq; xRow->appendObject( rProp,aAny ); } - else if( rProp.Name.compareToAscii( "Order" ) == 0 ) + else if( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Order")) ) { StaticModuleInformation *inf = m_pDatabases->getStaticInformationForModule( @@ -564,7 +564,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( } else xRow->appendVoid( rProp ); - else if( rProp.Name.compareToAscii( "AnchorName" ) == 0 && + else if( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("AnchorName")) && m_aURLParameter.isFile() ) xRow->appendString( rProp,m_aURLParameter.get_tag() ); else -- cgit