diff options
author | Noel Grandin <noel@peralex.com> | 2013-11-05 14:39:55 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-11-11 12:58:13 +0200 |
commit | fcd1637d5101b9142e6808edfb77b01122857901 (patch) | |
tree | 5fd09f97de80cf2a9481bd55a798015db35f1d0c /dbaccess | |
parent | ef90021abe3735fba57145598fd7c3d359d2718e (diff) |
convert OUString compareToAscii == 0 to equalsAscii
Convert code like
aStr.compareToAscii("XXX") == 0
to
aStr.equalsAscii("XXX")
which is both easier to read and faster.
Change-Id: I448abf58f2fa0e7715dba53f8e8825ca0587c83f
Diffstat (limited to 'dbaccess')
6 files changed, 11 insertions, 11 deletions
diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx index 9f36d7b70325..da438d7ab28c 100644 --- a/dbaccess/source/core/dataaccess/ContentHelper.cxx +++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx @@ -157,7 +157,7 @@ sal_Int32 SAL_CALL OContentHelper::createCommandIdentifier( ) throw (RuntimeExc Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*CommandId*/, const Reference< XCommandEnvironment >& Environment ) throw (Exception, CommandAbortedException, RuntimeException) { Any aRet; - if ( aCommand.Name.compareToAscii( "getPropertyValues" ) == 0 ) + if ( aCommand.Name.equalsAscii( "getPropertyValues" ) ) { // getPropertyValues @@ -175,7 +175,7 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma } aRet <<= getPropertyValues( Properties); } - else if ( aCommand.Name.compareToAscii( "setPropertyValues" ) == 0 ) + else if ( aCommand.Name.equalsAscii( "setPropertyValues" ) ) { // setPropertyValues @@ -206,7 +206,7 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma aRet <<= setPropertyValues( aProperties, Environment ); } - else if ( aCommand.Name.compareToAscii( "getPropertySetInfo" ) == 0 ) + else if ( aCommand.Name.equalsAscii( "getPropertySetInfo" ) ) { // getPropertySetInfo diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index d3b4e47839b0..7d2bb79a22ef 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -763,7 +763,7 @@ sal_Bool ODatabaseDocument::impl_attachResource( const OUString& i_rLogicalDocum { if ( ( i_rLogicalDocumentURL == getURL() ) && ( i_rMediaDescriptor.getLength() == 1 ) - && ( i_rMediaDescriptor[0].Name.compareToAscii( "BreakMacroSignature" ) == 0 ) + && ( i_rMediaDescriptor[0].Name.equalsAscii( "BreakMacroSignature" ) ) ) { // this is a BAD hack of the Basic importer code ... there should be a dedicated API for this, diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx index 155c1bdf940a..bfacec0188fe 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.cxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx @@ -397,7 +397,7 @@ Sequence< OUString > SAL_CALL ODocumentContainer::getAvailableServiceNames( ) t Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 CommandId, const Reference< XCommandEnvironment >& Environment ) throw (Exception, CommandAbortedException, RuntimeException) { Any aRet; - if ( aCommand.Name.compareToAscii( "open" ) == 0 ) + if ( aCommand.Name.equalsAscii( "open" ) ) { // open command for a folder content OpenCommandArgument2 aOpenCommand; diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx index d5e6d6bcd047..221d3c8d30e3 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.cxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx @@ -1084,14 +1084,14 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co dispose(); } - else if ( ( aCommand.Name.compareToAscii( "storeOwn" ) == 0 ) // compatibility - || ( aCommand.Name.compareToAscii( "store" ) == 0 ) + else if ( aCommand.Name.equalsAscii( "storeOwn" ) // compatibility + || aCommand.Name.equalsAscii( "store" ) ) { impl_store_throw(); } - else if ( ( aCommand.Name.compareToAscii( "shutdown" ) == 0 ) // compatibility - || ( aCommand.Name.compareToAscii( "close" ) == 0 ) + else if ( aCommand.Name.equalsAscii( "shutdown" ) // compatibility + || aCommand.Name.equalsAscii( "close" ) ) { aRet <<= impl_close_throw(); diff --git a/dbaccess/source/core/dataaccess/documentevents.cxx b/dbaccess/source/core/dataaccess/documentevents.cxx index d4e9fbe895cc..959d6787bf0b 100644 --- a/dbaccess/source/core/dataaccess/documentevents.cxx +++ b/dbaccess/source/core/dataaccess/documentevents.cxx @@ -137,7 +137,7 @@ namespace dbaccess const DocumentEventData* pEventData = lcl_getDocumentEventData(); while ( pEventData->pAsciiEventName ) { - if ( _rEventName.compareToAscii( pEventData->pAsciiEventName ) == 0 ) + if ( _rEventName.equalsAscii( pEventData->pAsciiEventName ) ) return pEventData->bNeedsSyncNotify; ++pEventData; } diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 249d0d1ae14d..dd362aaf8dfe 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -439,7 +439,7 @@ Sequence< OUString > SAL_CALL SbaXDataBrowserController::FormControllerImpl::get ::sal_Bool SAL_CALL SbaXDataBrowserController::FormControllerImpl::supportsMode( const OUString& aMode ) throw (RuntimeException) { - return aMode.compareToAscii( "DataMode" ) == 0; + return aMode.equalsAscii( "DataMode" ); } void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setModel(const Reference< ::com::sun::star::awt::XTabControllerModel > & /*Model*/) throw( RuntimeException ) |