summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-01-15 21:13:41 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-01-15 21:13:41 +0000
commitb1b10adec4c2730640e09aee8afed7ef393e338f (patch)
tree229832294557b8d7c7bbf8e6913c516a9a1264b2
parente25d8eb4ae77230a4f98bd811d6be647b69ace6c (diff)
microopts equalsAsciiL faster than compareToAscii(const sal_Char*)
-rw-r--r--desktop/source/app/desktopcontext.cxx2
-rw-r--r--ucb/source/core/provprox.cxx2
-rw-r--r--ucb/source/ucp/file/bc.cxx28
-rw-r--r--ucb/source/ucp/file/shell.cxx6
4 files changed, 19 insertions, 19 deletions
diff --git a/desktop/source/app/desktopcontext.cxx b/desktop/source/app/desktopcontext.cxx
index 8a9b14e351cd..bed77fae9f69 100644
--- a/desktop/source/app/desktopcontext.cxx
+++ b/desktop/source/app/desktopcontext.cxx
@@ -49,7 +49,7 @@ Any SAL_CALL DesktopContext::getValueByName( const OUString& Name) throw (Runtim
{
Any retVal;
- if ( 0 == Name.compareToAscii( JAVA_INTERACTION_HANDLER_NAME ))
+ if (Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(JAVA_INTERACTION_HANDLER_NAME)))
{
retVal = makeAny( Reference< XInteractionHandler >( new svt::JavaInteractionHandler()) );
}
diff --git a/ucb/source/core/provprox.cxx b/ucb/source/core/provprox.cxx
index 664d85372baa..774c0780a63e 100644
--- a/ucb/source/core/provprox.cxx
+++ b/ucb/source/core/provprox.cxx
@@ -348,7 +348,7 @@ UcbContentProviderProxy::getContentProvider()
m_xProvider
= Reference< XContentProvider >(
m_xSMgr->createInstance( m_aService ), UNO_QUERY );
- if(m_aArguments.compareToAscii("NoConfig") == 0)
+ if(m_aArguments.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("NoConfig")))
{
Reference<XInitialization> xInit(m_xProvider,UNO_QUERY);
if(xInit.is()) {
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index ae661d18dcf4..444ba7055881 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -276,7 +276,7 @@ sal_Bool SAL_CALL
BaseContent::supportsService( const rtl::OUString& ServiceName )
throw( RuntimeException)
{
- if( ServiceName.compareToAscii( "com.sun.star.ucb.FileContent" ) == 0 )
+ if (ServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.ucb.FileContent")))
return true;
else
return false;
@@ -349,15 +349,15 @@ BaseContent::execute( const Command& aCommand,
Any aAny;
- if( ! aCommand.Name.compareToAscii( "getPropertySetInfo" ) ) // No exceptions
+ if (aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("getPropertySetInfo"))) // No exceptions
{
aAny <<= getPropertySetInfo( CommandId );
}
- else if( ! aCommand.Name.compareToAscii( "getCommandInfo" ) ) // no exceptions
+ else if (aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("getCommandInfo"))) // no exceptions
{
aAny <<= getCommandInfo();
}
- else if( ! aCommand.Name.compareToAscii( "setPropertyValues" ) )
+ else if (aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("setPropertyValues")))
{
Sequence< beans::PropertyValue > sPropertyValues;
@@ -367,7 +367,7 @@ BaseContent::execute( const Command& aCommand,
else
aAny <<= setPropertyValues( CommandId,sPropertyValues ); // calls endTask by itself
}
- else if( ! aCommand.Name.compareToAscii( "getPropertyValues" ) )
+ else if (aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("getPropertyValues")))
{
Sequence< beans::Property > ListOfRequestedProperties;
@@ -378,7 +378,7 @@ BaseContent::execute( const Command& aCommand,
aAny <<= getPropertyValues( CommandId,
ListOfRequestedProperties );
}
- else if( ! aCommand.Name.compareToAscii( "open" ) )
+ else if (aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("open")))
{
OpenCommandArgument2 aOpenArgument;
if( ! ( aCommand.Argument >>= aOpenArgument ) )
@@ -391,7 +391,7 @@ BaseContent::execute( const Command& aCommand,
aAny <<= result;
}
}
- else if( ! aCommand.Name.compareToAscii( "delete" ) )
+ else if (aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("delete")))
{
if( ! aCommand.Argument.has< sal_Bool >() )
m_pMyShell->installError( CommandId,
@@ -399,7 +399,7 @@ BaseContent::execute( const Command& aCommand,
else
deleteContent( CommandId );
}
- else if( ! aCommand.Name.compareToAscii( "transfer" ) )
+ else if (aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("transfer")))
{
TransferInfo aTransferInfo;
if( ! ( aCommand.Argument >>= aTransferInfo ) )
@@ -408,7 +408,7 @@ BaseContent::execute( const Command& aCommand,
else
transfer( CommandId, aTransferInfo );
}
- else if( ! aCommand.Name.compareToAscii( "insert" ) )
+ else if (aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("insert")))
{
InsertCommandArgument aInsertArgument;
if( ! ( aCommand.Argument >>= aInsertArgument ) )
@@ -417,7 +417,7 @@ BaseContent::execute( const Command& aCommand,
else
insert( CommandId,aInsertArgument );
}
- else if( ! aCommand.Name.compareToAscii( "getCasePreservingURL" ) )
+ else if (aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("getCasePreservingURL")))
{
Sequence< beans::Property > seq(1);
seq[0] = beans::Property(
@@ -430,7 +430,7 @@ BaseContent::execute( const Command& aCommand,
if(!xRow->wasNull())
aAny <<= CasePreservingURL;
}
- else if( ! aCommand.Name.compareToAscii( "createNewContent" ) )
+ else if (aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("createNewContent")))
{
ucb::ContentInfo aArg;
if ( !( aCommand.Argument >>= aArg ) )
@@ -836,16 +836,16 @@ BaseContent::getPropertyValues(
const beans::Property& rProp = pProps[ n ];
Any& rValue = pValues[ n ];
- if( rProp.Name.compareToAscii( "ContentType" ) == 0 )
+ if (rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ContentType")))
{
rValue <<= m_bFolder ? m_pMyShell->FolderContentType
: m_pMyShell->FileContentType;
}
- else if( rProp.Name.compareToAscii( "IsFolder" ) == 0 )
+ else if (rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IsFolder")))
{
rValue <<= m_bFolder;
}
- else if( rProp.Name.compareToAscii( "IsDocument" ) == 0 )
+ else if (rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IsDocument")))
{
rValue <<= sal_Bool( !m_bFolder );
}
diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx
index d4c09b0444b2..6e6f9931ef8e 100644
--- a/ucb/source/ucp/file/shell.cxx
+++ b/ucb/source/ucp/file/shell.cxx
@@ -1977,9 +1977,9 @@ void SAL_CALL shell::insertDefaultProperties( const rtl::OUString& aUnqPath )
sal_Bool SAL_CALL shell::getUnqFromUrl( const rtl::OUString& Url,rtl::OUString& Unq )
{
- if( 0 == Url.compareToAscii( "file:///" ) ||
- 0 == Url.compareToAscii( "file://localhost/" ) ||
- 0 == Url.compareToAscii( "file://127.0.0.1/" ) )
+ if (Url.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("file:///")) ||
+ Url.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("file://localhost/")) ||
+ Url.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("file://127.0.0.1/")))
{
Unq = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///"));
return false;