From fcd1637d5101b9142e6808edfb77b01122857901 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 5 Nov 2013 14:39:55 +0200 Subject: 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 --- basic/source/classes/eventatt.cxx | 2 +- connectivity/source/cpool/Zregistration.cxx | 2 +- connectivity/source/drivers/hsqldb/HConnection.cxx | 2 +- connectivity/source/drivers/mork/MDriver.cxx | 4 +- connectivity/source/drivers/mork/MResultSet.cxx | 4 +- connectivity/source/drivers/mozab/MDriver.cxx | 2 +- connectivity/source/drivers/mozab/MResultSet.cxx | 4 +- connectivity/source/manager/mregistration.cxx | 2 +- cppuhelper/source/factory.cxx | 4 +- cpputools/source/unoexe/unoexe.cxx | 12 +-- dbaccess/source/core/dataaccess/ContentHelper.cxx | 6 +- .../source/core/dataaccess/databasedocument.cxx | 2 +- .../source/core/dataaccess/documentcontainer.cxx | 2 +- .../source/core/dataaccess/documentdefinition.cxx | 8 +- dbaccess/source/core/dataaccess/documentevents.cxx | 2 +- dbaccess/source/ui/browser/brwctrlr.cxx | 2 +- desktop/source/app/appinit.cxx | 2 +- desktop/source/offacc/acceptor.cxx | 6 +- extensions/source/plugin/base/xplugin.cxx | 2 +- forms/source/helper/formnavigation.cxx | 2 +- framework/source/jobs/joburl.cxx | 12 +-- framework/source/services/sessionlistener.cxx | 4 +- .../source/breakiterator/breakiteratorImpl.cxx | 6 +- .../defaultnumberingprovider.cxx | 2 +- i18npool/source/indexentry/indexentrysupplier.cxx | 2 +- .../indexentry/indexentrysupplier_common.cxx | 2 +- i18npool/source/localedata/LocaleNode.cxx | 10 +- .../source/nativenumber/nativenumbersupplier.cxx | 2 +- .../source/transliteration/transliterationImpl.cxx | 2 +- .../Addons/ProtocolHandlerAddon_cpp/addon.cxx | 16 +-- oox/source/drawingml/graphicshapecontext.cxx | 2 +- oox/source/drawingml/textfield.cxx | 2 +- oox/source/ppt/animationtypes.cxx | 4 +- oox/source/ppt/commonbehaviorcontext.cxx | 2 +- oox/source/ppt/pptfilterhelpers.cxx | 2 +- oox/source/ppt/timenodelistcontext.cxx | 2 +- package/source/manifest/UnoRegister.cxx | 8 +- padmin/source/padialog.cxx | 2 +- pyuno/source/module/pyuno_type.cxx | 2 +- reportdesign/source/ui/report/ReportController.cxx | 2 +- sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx | 4 +- sc/source/filter/xml/xmldrani.cxx | 2 +- sc/source/filter/xml/xmlfilti.cxx | 24 ++--- sc/source/filter/xml/xmlimprt.cxx | 46 ++++---- sc/source/filter/xml/xmlsorti.cxx | 2 +- sc/source/ui/unoobj/confuno.cxx | 120 ++++++++++----------- sc/source/ui/unoobj/defltuno.cxx | 8 +- sc/source/ui/unoobj/docuno.cxx | 2 +- sc/source/ui/unoobj/eventuno.cxx | 4 +- sc/source/ui/vba/vbachartobject.cxx | 2 +- sc/source/ui/view/prevwsh.cxx | 4 +- sc/source/ui/view/viewdata.cxx | 90 ++++++++-------- scaddins/source/analysis/analysis.cxx | 4 +- scaddins/source/pricing/pricing.cxx | 20 ++-- scripting/source/dlgprov/dlgevtatt.cxx | 2 +- sd/source/filter/eppt/pptexanimations.cxx | 2 +- sd/source/filter/ppt/pptinanimations.cxx | 4 +- sd/source/ui/dlg/dlgass.cxx | 4 +- .../ui/framework/factories/FullScreenPane.cxx | 2 +- sd/source/ui/remotecontrol/ImagePreparer.cxx | 2 +- sdext/source/minimizer/pppoptimizer.cxx | 8 +- sdext/source/minimizer/pppoptimizerdialog.cxx | 8 +- sdext/source/pdfimport/filterdet.cxx | 3 +- sdext/source/pdfimport/test/tests.cxx | 34 +++--- sdext/source/presenter/PresenterPaneFactory.cxx | 2 +- sfx2/source/control/unoctitm.cxx | 2 +- sfx2/source/doc/doctemplates.cxx | 6 +- sfx2/source/doc/printhelper.cxx | 26 ++--- store/workben/t_store.cxx | 2 +- svl/source/fsstor/fsfactory.cxx | 2 +- svl/source/numbers/numfmuno.cxx | 8 +- svl/source/passwordcontainer/passwordcontainer.cxx | 4 +- svl/source/uno/pathservice.cxx | 2 +- svtools/source/hatchwindow/hatchwindowfactory.cxx | 4 +- sw/source/core/unocore/unostyle.cxx | 32 +++--- sw/source/filter/html/htmlforw.cxx | 2 +- sw/source/ui/uno/unotxdoc.cxx | 2 +- testtools/source/performance/ubtest.cxx | 4 +- tools/qa/cppunit/test_urlobj.cxx | 94 +++++++--------- ucb/source/cacher/cacheserv.cxx | 8 +- ucb/source/core/ucbcmds.cxx | 4 +- ucb/source/core/ucbserv.cxx | 10 +- ucb/source/sorter/sortmain.cxx | 2 +- ucb/source/sorter/sortresult.cxx | 16 +-- ucb/source/ucp/file/prov.cxx | 16 +-- ucb/source/ucp/ftp/ftpcontent.cxx | 36 +++---- ucb/source/ucp/ftp/ftpresultsetI.cxx | 16 +-- ucb/source/ucp/ftp/ftpservices.cxx | 2 +- ucb/source/ucp/hierarchy/hierarchyservices.cxx | 4 +- ucb/source/ucp/package/pkgservices.cxx | 2 +- ucb/source/ucp/tdoc/tdoc_services.cxx | 4 +- ucb/source/ucp/webdav-neon/DateTimeHelper.cxx | 24 ++--- ucb/source/ucp/webdav-neon/webdavservices.cxx | 2 +- ucb/source/ucp/webdav/DateTimeHelper.cxx | 38 +++---- ucb/source/ucp/webdav/webdavservices.cxx | 2 +- ucb/workben/ucb/ucbdemo.cxx | 2 +- unotools/source/config/eventcfg.cxx | 2 +- unotools/source/config/securityoptions.cxx | 22 ++-- unotools/source/ucbhelper/xtempfile.cxx | 2 +- unoxml/source/events/eventdispatcher.cxx | 32 +++--- unoxml/source/service/services.cxx | 8 +- uui/source/iahndl-filter.cxx | 4 +- uui/source/iahndl.cxx | 2 +- uui/source/services.cxx | 2 +- vcl/unx/generic/dtrans/X11_selection.cxx | 10 +- vcl/unx/generic/printer/printerinfomanager.cxx | 2 +- xmlhelp/source/cxxhelp/provider/databases.cxx | 20 ++-- .../source/cxxhelp/provider/resultsetforquery.cxx | 2 +- xmlhelp/source/cxxhelp/provider/services.cxx | 2 +- xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 34 +++--- xmlhelp/source/treeview/tvfactory.cxx | 6 +- xmlhelp/source/treeview/tvread.cxx | 18 ++-- xmloff/source/chart/SchXMLExport.cxx | 2 +- xmloff/source/core/DocumentSettingsContext.cxx | 6 +- xmloff/source/draw/XMLNumberStyles.cxx | 2 +- xmloff/source/draw/animationexport.cxx | 2 +- xmloff/source/style/xmlnumfi.cxx | 4 +- xmloff/source/text/XMLTextMarkImportContext.cxx | 16 +-- .../source/component/certificatecontainer.cxx | 2 +- 119 files changed, 561 insertions(+), 580 deletions(-) diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index e7ab71579983..7df636f4312c 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -189,7 +189,7 @@ void BasicScriptListener_Impl::disposing(const EventObject& ) throw ( RuntimeExc void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any* pRet ) { - if( aScriptEvent.ScriptType.compareToAscii( "StarBasic" ) == 0 ) + if( aScriptEvent.ScriptType.equalsAscii( "StarBasic" ) ) { // Full qualified name? OUString aMacro( aScriptEvent.ScriptCode ); diff --git a/connectivity/source/cpool/Zregistration.cxx b/connectivity/source/cpool/Zregistration.cxx index 68039800a4d9..3d3d657d272a 100644 --- a/connectivity/source/cpool/Zregistration.cxx +++ b/connectivity/source/cpool/Zregistration.cxx @@ -38,7 +38,7 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL dbpool2_component_getFactory(const sal_Char* { void* pRet = NULL; - if (OPoolCollection::getImplementationName_Static().compareToAscii(_pImplName) == 0) + if (OPoolCollection::getImplementationName_Static().equalsAscii(_pImplName)) { Reference< XSingleServiceFactory > xFactory( ::cppu::createOneInstanceFactory( diff --git a/connectivity/source/drivers/hsqldb/HConnection.cxx b/connectivity/source/drivers/hsqldb/HConnection.cxx index 6d4577c40256..40e9a8237fc3 100644 --- a/connectivity/source/drivers/hsqldb/HConnection.cxx +++ b/connectivity/source/drivers/hsqldb/HConnection.cxx @@ -173,7 +173,7 @@ namespace connectivity { namespace hsqldb const PropertyValue* pEnd = pIter + aInfo.getLength(); for(;pIter != pEnd;++pIter) { - if ( pIter->Name.compareToAscii("readonly") == 0 ) + if ( pIter->Name.equalsAscii("readonly") ) m_bReadOnly = true; } } diff --git a/connectivity/source/drivers/mork/MDriver.cxx b/connectivity/source/drivers/mork/MDriver.cxx index 1a70ed251048..851e18e9a902 100644 --- a/connectivity/source/drivers/mork/MDriver.cxx +++ b/connectivity/source/drivers/mork/MDriver.cxx @@ -118,8 +118,8 @@ sal_Bool MorkDriver::acceptsURL(OUString const & url) aAddrbookScheme = aAddrbookURI.copy(0, nLen); } - if ((aAddrbookScheme.compareToAscii( "thunderbird" ) == 0) || - (aAddrbookScheme.compareToAscii( "mozilla" ) == 0)) + if (aAddrbookScheme.equalsAscii( "thunderbird" ) || + aAddrbookScheme.equalsAscii( "mozilla" ) ) { return true; } diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx index 163054e46110..99f7275559a8 100644 --- a/connectivity/source/drivers/mork/MResultSet.cxx +++ b/connectivity/source/drivers/mork/MResultSet.cxx @@ -875,8 +875,8 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT matchString = parseTree->getChild(2)->getTokenValue(); } - if ( columnName.compareToAscii("0") ==0 && op == MQueryOp::Is && - matchString.compareToAscii("1") == 0 ) { + if ( columnName.equalsAscii("0") && op == MQueryOp::Is && + matchString.equalsAscii("1") ) { OSL_TRACE("Query always evaluates to FALSE"); m_bIsAlwaysFalseQuery = sal_True; } diff --git a/connectivity/source/drivers/mozab/MDriver.cxx b/connectivity/source/drivers/mozab/MDriver.cxx index 766d251468c9..8d789380a255 100644 --- a/connectivity/source/drivers/mozab/MDriver.cxx +++ b/connectivity/source/drivers/mozab/MDriver.cxx @@ -245,7 +245,7 @@ EDriverType MozabDriver::impl_classifyURL( const OUString& url ) for ( size_t i=0; i < sizeof( aSchemeMap ) / sizeof( aSchemeMap[0] ); ++i ) { - if ( aAddrbookScheme.compareToAscii( aSchemeMap[i].pScheme ) == 0 ) + if ( aAddrbookScheme.equalsAscii( aSchemeMap[i].pScheme ) ) return aSchemeMap[i].eType; } diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx index 13ce879b32c2..d0e449e4be7a 100644 --- a/connectivity/source/drivers/mozab/MResultSet.cxx +++ b/connectivity/source/drivers/mozab/MResultSet.cxx @@ -857,8 +857,8 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT matchString = parseTree->getChild(2)->getTokenValue(); } - if ( columnName.compareToAscii("0") ==0 && op == MQueryOp::Is && - matchString.compareToAscii("1") == 0 ) { + if ( columnName.equalsAscii("0") && op == MQueryOp::Is && + matchString.equalsAscii("1") ) { OSL_TRACE("Query always evaluates to FALSE"); m_bIsAlwaysFalseQuery = sal_True; } diff --git a/connectivity/source/manager/mregistration.cxx b/connectivity/source/manager/mregistration.cxx index af01a22dd2b8..ce712f303eec 100644 --- a/connectivity/source/manager/mregistration.cxx +++ b/connectivity/source/manager/mregistration.cxx @@ -38,7 +38,7 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL sdbc2_component_getFactory(const sal_Char* _ { void* pRet = NULL; - if (::drivermanager::OSDBCDriverManager::getImplementationName_static().compareToAscii(_pImplName) == 0) + if (::drivermanager::OSDBCDriverManager::getImplementationName_static().equalsAscii(_pImplName)) { Reference< XSingleServiceFactory > xFactory( ::cppu::createOneInstanceFactory( diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx index aff6a5480507..b9e85c132c3b 100644 --- a/cppuhelper/source/factory.cxx +++ b/cppuhelper/source/factory.cxx @@ -809,9 +809,9 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory() if( nPos != -1 ) { aActivatorName = aLocation.copy( 0, nPos ); - if( aActivatorName.compareToAscii( "java" ) == 0 ) + if( aActivatorName.equalsAscii( "java" ) ) aActivatorName = "com.sun.star.loader.Java"; - else if( aActivatorName.compareToAscii( "module" ) == 0 ) + else if( aActivatorName.equalsAscii( "module" ) ) aActivatorName = "com.sun.star.loader.SharedLibrary"; aLocation = aLocation.copy( nPos + 3 ); } diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx index 971ce344b08a..e02003a995e9 100644 --- a/cpputools/source/unoexe/unoexe.cxx +++ b/cpputools/source/unoexe/unoexe.cxx @@ -200,16 +200,16 @@ static Reference< XInterface > loadComponent( OUString aExt( rLocation.copy( nDot +1 ) ); - if (aExt.compareToAscii( "dll" ) == 0 || - aExt.compareToAscii( "exe" ) == 0 || - aExt.compareToAscii( "dylib" ) == 0 || - aExt.compareToAscii( "so" ) == 0) + if (aExt.equalsAscii( "dll" ) || + aExt.equalsAscii( "exe" ) || + aExt.equalsAscii( "dylib" ) || + aExt.equalsAscii( "so" ) ) { createInstance( xLoader, xContext, OUString("com.sun.star.loader.SharedLibrary") ); } - else if (aExt.compareToAscii( "jar" ) == 0 || - aExt.compareToAscii( "class" ) == 0) + else if (aExt.equalsAscii( "jar" ) || + aExt.equalsAscii( "class" ) ) { createInstance( xLoader, xContext, OUString("com.sun.star.loader.Java") ); 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 ) diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 465b266be0e2..065bb3d0caab 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -231,7 +231,7 @@ void Desktop::destroyAcceptor(const OUString& aAcceptString) { // special case stop all acceptors AcceptorMap &rMap = acceptorMap::get(); - if (aAcceptString.compareToAscii("all") == 0) { + if (aAcceptString.equalsAscii("all")) { rMap.clear(); } else { diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx index 194d32e91e09..5d11e0f9cebb 100644 --- a/desktop/source/offacc/acceptor.cxx +++ b/desktop/source/offacc/acceptor.cxx @@ -230,15 +230,15 @@ Reference AccInstanceProvider::getInstance (const OUString& aName ) Reference rInstance; - if ( aName.compareToAscii( "StarOffice.ServiceManager" ) == 0) + if ( aName.equalsAscii( "StarOffice.ServiceManager" ) ) { rInstance = Reference< XInterface >( m_rContext->getServiceManager() ); } - else if(aName.compareToAscii( "StarOffice.ComponentContext" ) == 0 ) + else if(aName.equalsAscii( "StarOffice.ComponentContext" ) ) { rInstance = m_rContext; } - else if ( aName.compareToAscii("StarOffice.NamingService" ) == 0 ) + else if ( aName.equalsAscii("StarOffice.NamingService" ) ) { Reference< XNamingService > rNamingService( m_rContext->getServiceManager()->createInstanceWithContext("com.sun.star.uno.NamingService", m_rContext), diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx index 18e62a59d235..37028139e85b 100644 --- a/extensions/source/plugin/base/xplugin.cxx +++ b/extensions/source/plugin/base/xplugin.cxx @@ -898,7 +898,7 @@ PluginDescription XPlugin_Impl::fitDescription( const OUString& rURL ) { for( int i = 0; i < aDescrs.getLength(); i++ ) { - if( pDescrs[i].Mimetype.compareToAscii( m_pArgv[nArg] ) == 0 ) + if( pDescrs[i].Mimetype.equalsAscii( m_pArgv[nArg] ) ) return pDescrs[i]; } } diff --git a/forms/source/helper/formnavigation.cxx b/forms/source/helper/formnavigation.cxx index dea35af2bfe2..410b76a67d2f 100644 --- a/forms/source/helper/formnavigation.cxx +++ b/forms/source/helper/formnavigation.cxx @@ -462,7 +462,7 @@ namespace frm const FeatureURL* pFeatures = lcl_getFeatureTable(); while ( pFeatures->pAsciiURL ) { - if ( _rCompleteURL.compareToAscii( pFeatures->pAsciiURL ) == 0 ) + if ( _rCompleteURL.equalsAscii( pFeatures->pAsciiURL ) ) return pFeatures->nFormFeature; ++pFeatures; } diff --git a/framework/source/jobs/joburl.cxx b/framework/source/jobs/joburl.cxx index 8e48e7b24a98..71e7f51b6fab 100644 --- a/framework/source/jobs/joburl.cxx +++ b/framework/source/jobs/joburl.cxx @@ -390,14 +390,14 @@ void JobURL::impldbg_checkURL( /*IN*/ const sal_Char* pURL , (aURL.isValid() ) && (aURL.getEvent(sEvent) ) && (!sEvent.isEmpty() ) && - (sEvent.compareToAscii(pExpectedEvent)==0) + (sEvent.equalsAscii(pExpectedEvent)) ); if (bOK && pExpectedEventArgs!=NULL) { bOK = ( (aURL.getEventArgs(sEventArgs) ) && - (sEventArgs.compareToAscii(pExpectedEventArgs)==0) + (sEventArgs.equalsAscii(pExpectedEventArgs)) ); }; } @@ -426,14 +426,14 @@ void JobURL::impldbg_checkURL( /*IN*/ const sal_Char* pURL , (aURL.isValid() ) && (aURL.getAlias(sAlias) ) && (!sAlias.isEmpty() ) && - (sAlias.compareToAscii(pExpectedAlias)==0) + (sAlias.equalsAscii(pExpectedAlias)) ); if (bOK && pExpectedAliasArgs!=NULL) { bOK = ( (aURL.getAliasArgs(sAliasArgs) ) && - (sAliasArgs.compareToAscii(pExpectedAliasArgs)==0) + (sAliasArgs.equalsAscii(pExpectedAliasArgs)) ); }; } @@ -462,14 +462,14 @@ void JobURL::impldbg_checkURL( /*IN*/ const sal_Char* pURL , (aURL.isValid() ) && (aURL.getService(sService) ) && (!sService.isEmpty() ) && - (sService.compareToAscii(pExpectedService)==0) + (sService.equalsAscii(pExpectedService)) ); if (bOK && pExpectedServiceArgs!=NULL) { bOK = ( (aURL.getServiceArgs(sServiceArgs) ) && - (sServiceArgs.compareToAscii(pExpectedServiceArgs)==0) + (sServiceArgs.equalsAscii(pExpectedServiceArgs)) ); }; } diff --git a/framework/source/services/sessionlistener.cxx b/framework/source/services/sessionlistener.cxx index bb8be519ad3d..cb221ae1c8e6 100644 --- a/framework/source/services/sessionlistener.cxx +++ b/framework/source/services/sessionlistener.cxx @@ -204,13 +204,13 @@ void SAL_CALL SessionListener::statusChanged(const FeatureStateEvent& event) SAL_INFO("fwk.session", "SessionListener::statusChanged"); if ( event.FeatureURL.Complete == "vnd.sun.star.autorecovery:/doSessionRestore" ) { - if (event.FeatureDescriptor.compareToAscii("update")==0) + if (event.FeatureDescriptor.equalsAscii("update")) m_bRestored = sal_True; // a document was restored } else if ( event.FeatureURL.Complete == "vnd.sun.star.autorecovery:/doSessionSave" ) { - if (event.FeatureDescriptor.compareToAscii("stop")==0) + if (event.FeatureDescriptor.equalsAscii("stop")) { if (m_rSessionManager.is()) m_rSessionManager->saveDone(this); // done with save diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx index b5e4331768cb..0123583b0ad9 100644 --- a/i18npool/source/breakiterator/breakiteratorImpl.cxx +++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx @@ -587,9 +587,9 @@ BreakIteratorImpl::getLocaleSpecificBreakIterator(const Locale& rLocale) throw ( // load service with name __ createLocaleSpecificBreakIterator(aBuf.append(rLocale.Language).append(under).append( rLocale.Country).makeStringAndClear())) || - (l > 0 && c > 0 && rLocale.Language.compareToAscii("zh") == 0 && - (rLocale.Country.compareToAscii("HK") == 0 || - rLocale.Country.compareToAscii("MO") == 0) && + (l > 0 && c > 0 && rLocale.Language.equalsAscii("zh") && + (rLocale.Country.equalsAscii("HK") || + rLocale.Country.equalsAscii("MO") ) && // if the country code is HK or MO, one more step to try TW. createLocaleSpecificBreakIterator(aBuf.append(rLocale.Language).append(under).appendAscii( "TW").makeStringAndClear())) || diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index a4060d4c6f7e..bd926d1a8df7 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -525,7 +525,7 @@ static int should_ignore( OUString s ) { // return true if blank or null - return s.compareToAscii(" ")==0 || (!s.isEmpty() && s[0]==0); + return s.equalsAscii(" ") || (!s.isEmpty() && s[0]==0); } static diff --git a/i18npool/source/indexentry/indexentrysupplier.cxx b/i18npool/source/indexentry/indexentrysupplier.cxx index 6a4ef3b4b4ff..4f274935c2c2 100644 --- a/i18npool/source/indexentry/indexentrysupplier.cxx +++ b/i18npool/source/indexentry/indexentrysupplier.cxx @@ -184,7 +184,7 @@ IndexEntrySupplier::getImplementationName() throw( RuntimeException ) sal_Bool SAL_CALL IndexEntrySupplier::supportsService(const OUString& rServiceName) throw( RuntimeException ) { - return rServiceName.compareToAscii(implementationName) == 0; + return rServiceName.equalsAscii(implementationName); } Sequence< OUString > SAL_CALL diff --git a/i18npool/source/indexentry/indexentrysupplier_common.cxx b/i18npool/source/indexentry/indexentrysupplier_common.cxx index e4dba3822821..cdaf612ea876 100644 --- a/i18npool/source/indexentry/indexentrysupplier_common.cxx +++ b/i18npool/source/indexentry/indexentrysupplier_common.cxx @@ -126,7 +126,7 @@ IndexEntrySupplier_Common::getImplementationName() throw( RuntimeException ) sal_Bool SAL_CALL IndexEntrySupplier_Common::supportsService(const OUString& rServiceName) throw( RuntimeException ) { - return rServiceName.compareToAscii(implementationName) == 0; + return rServiceName.equalsAscii(implementationName); } Sequence< OUString > SAL_CALL diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index 46696770d5e0..ff4ce9784fdd 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -1297,7 +1297,7 @@ void LCCollationNode::generateCode (const OFileWriter &of) const for ( j = 0; j < getNumberOfChildren(); j++ ) { LocaleNode * currNode = getChildAt (j); - if( currNode->getName().compareToAscii("Collator") == 0 ) + if( currNode->getName().equalsAscii("Collator") ) { OUString str; str = currNode->getAttr().getValueByName("unoid"); @@ -1310,7 +1310,7 @@ void LCCollationNode::generateCode (const OFileWriter &of) const nbOfCollations++; } - if( currNode->getName().compareToAscii("CollationOptions") == 0 ) + if( currNode->getName().equalsAscii("CollationOptions") ) { LocaleNode* pCollationOptions = currNode; nbOfCollationOptions = sal::static_int_cast( pCollationOptions->getNumberOfChildren() ); @@ -1411,7 +1411,7 @@ void LCIndexNode::generateCode (const OFileWriter &of) const sal_Int16 i; for (i = 0; i< getNumberOfChildren();i++) { LocaleNode * currNode = getChildAt (i); - if( currNode->getName().compareToAscii("IndexKey") == 0 ) + if( currNode->getName().equalsAscii("IndexKey") ) { OUString str; str = currNode->getAttr().getValueByName("unoid"); @@ -1428,13 +1428,13 @@ void LCIndexNode::generateCode (const OFileWriter &of) const nbOfIndexs++; } - if( currNode->getName().compareToAscii("UnicodeScript") == 0 ) + if( currNode->getName().equalsAscii("UnicodeScript") ) { of.writeParameter("unicodeScript", currNode->getValue(), nbOfUnicodeScripts ); nbOfUnicodeScripts++; } - if( currNode->getName().compareToAscii("FollowPageWord") == 0 ) + if( currNode->getName().equalsAscii("FollowPageWord") ) { of.writeParameter("followPageWord", currNode->getValue(), nbOfPageWords); nbOfPageWords++; diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx index bf2ff1100b4c..38e7905031af 100644 --- a/i18npool/source/nativenumber/nativenumbersupplier.cxx +++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx @@ -898,7 +898,7 @@ OUString SAL_CALL NativeNumberSupplier::getImplementationName() throw( RuntimeEx sal_Bool SAL_CALL NativeNumberSupplier::supportsService(const OUString& rServiceName) throw( RuntimeException ) { - return rServiceName.compareToAscii(implementationName) == 0; + return rServiceName.equalsAscii(implementationName); } Sequence< OUString > SAL_CALL diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx index 2af62a742269..d700646dcfe2 100644 --- a/i18npool/source/transliteration/transliterationImpl.cxx +++ b/i18npool/source/transliteration/transliterationImpl.cxx @@ -613,7 +613,7 @@ TransliterationImpl::loadModuleByName( const OUString& implName, // if the module is ignore case/kana/width, load caseignore for equals/compareString mothed for (sal_Int16 i = 0; i < 3; i++) { - if (implName.compareToAscii(TMlist[i].implName) == 0) { + if (implName.equalsAscii(TMlist[i].implName)) { if (i == 0) // current module is caseignore body->loadModule(TMlist[0].tm, rLocale); // caseingore need to setup module name if (! caseignore.is()) { diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx index a9d78f988362..c9bd218046ba 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx +++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx @@ -115,13 +115,13 @@ Reference< XDispatch > SAL_CALL Addon::queryDispatch( const URL& aURL, const ::r throw( RuntimeException ) { Reference < XDispatch > xRet; - if ( aURL.Protocol.compareToAscii("org.openoffice.Office.addon.example:") == 0 ) + if ( aURL.Protocol.equalsAscii("org.openoffice.Office.addon.example:") ) { - if ( aURL.Path.compareToAscii( "Function1" ) == 0 ) + if ( aURL.Path.equalsAscii( "Function1" ) ) xRet = this; - else if ( aURL.Path.compareToAscii( "Function2" ) == 0 ) + else if ( aURL.Path.equalsAscii( "Function2" ) ) xRet = this; - else if ( aURL.Path.compareToAscii( "Help" ) == 0 ) + else if ( aURL.Path.equalsAscii( "Help" ) ) xRet = this; } @@ -134,21 +134,21 @@ Reference< XDispatch > SAL_CALL Addon::queryDispatch( const URL& aURL, const ::r */ void SAL_CALL Addon::dispatch( const URL& aURL, const Sequence < PropertyValue >& lArgs ) throw (RuntimeException) { - if ( aURL.Protocol.compareToAscii("org.openoffice.Office.addon.example:") == 0 ) + if ( aURL.Protocol.equalsAscii("org.openoffice.Office.addon.example:") ) { - if ( aURL.Path.compareToAscii( "Function1" ) == 0 ) + if ( aURL.Path.equalsAscii( "Function1" ) ) { ShowMessageBox( mxToolkit, mxFrame, OUString( "SDK Add-On example" ), OUString( "Function 1 activated" ) ); } - else if ( aURL.Path.compareToAscii( "Function2" ) == 0 ) + else if ( aURL.Path.equalsAscii( "Function2" ) ) { ShowMessageBox( mxToolkit, mxFrame, OUString( "SDK Add-On example" ), OUString( "Function 2 activated" ) ); } - else if ( aURL.Path.compareToAscii( "Help" ) == 0 ) + else if ( aURL.Path.equalsAscii( "Help" ) ) { // Show info box ShowMessageBox( mxToolkit, mxFrame, diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx index 73882f85d45a..4cf3366e1808 100644 --- a/oox/source/drawingml/graphicshapecontext.cxx +++ b/oox/source/drawingml/graphicshapecontext.cxx @@ -128,7 +128,7 @@ ContextHandlerRef GraphicalObjectFrameContext::onCreateContext( sal_Int32 aEleme return new DiagramGraphicDataContext( *this, mpShapePtr ); else if ( sUri == "http://schemas.openxmlformats.org/drawingml/2006/chart" ) return new ChartGraphicDataContext( *this, mpShapePtr, mbEmbedShapesInChart ); - else if ( sUri.compareToAscii( "http://schemas.openxmlformats.org/drawingml/2006/table" ) == 0 ) + else if ( sUri.equalsAscii( "http://schemas.openxmlformats.org/drawingml/2006/table" ) ) return new table::TableContext( *this, mpShapePtr ); else { diff --git a/oox/source/drawingml/textfield.cxx b/oox/source/drawingml/textfield.cxx index bf566bae218e..76d909b036ef 100644 --- a/oox/source/drawingml/textfield.cxx +++ b/oox/source/drawingml/textfield.cxx @@ -119,7 +119,7 @@ void lclCreateTextFields( std::list< Reference< XTextField > > & aFields, OSL_TRACE( "Exception %s", OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); } } - else if ( sType.compareToAscii( "slidenum" ) == 0 ) + else if ( sType.equalsAscii( "slidenum" ) ) { xIface = xFactory->createInstance( "com.sun.star.text.TextField.PageNumber" ); aFields.push_back( Reference< XTextField > ( xIface, UNO_QUERY ) ); diff --git a/oox/source/ppt/animationtypes.cxx b/oox/source/ppt/animationtypes.cxx index a6ba78872f76..4992fdd338f4 100644 --- a/oox/source/ppt/animationtypes.cxx +++ b/oox/source/ppt/animationtypes.cxx @@ -34,7 +34,7 @@ namespace oox { namespace ppt { Any GetTime( const OUString & val ) { Any aDuration; - if( val.compareToAscii( "indefinite" ) == 0 ) + if( val.equalsAscii( "indefinite" ) ) { aDuration <<= Timing_INDEFINITE; } @@ -50,7 +50,7 @@ Any GetTime( const OUString & val ) Any GetTimeAnimateValueTime( const OUString & val ) { Any aPercent; - if( val.compareToAscii( "indefinite" ) == 0 ) + if( val.equalsAscii( "indefinite" ) ) { aPercent <<= Timing_INDEFINITE; } diff --git a/oox/source/ppt/commonbehaviorcontext.cxx b/oox/source/ppt/commonbehaviorcontext.cxx index dd19deef6259..5cc23c562a08 100644 --- a/oox/source/ppt/commonbehaviorcontext.cxx +++ b/oox/source/ppt/commonbehaviorcontext.cxx @@ -89,7 +89,7 @@ namespace oox { namespace ppt { const ImplAttributeNameConversion *attrConv = gImplConversionList; while( attrConv->mpMSName != NULL ) { - if(msCurrentAttribute.compareToAscii( attrConv->mpMSName ) == 0 ) + if(msCurrentAttribute.equalsAscii( attrConv->mpMSName ) ) { Attribute attr; attr.name = OUString::intern( attrConv->mpAPIName, diff --git a/oox/source/ppt/pptfilterhelpers.cxx b/oox/source/ppt/pptfilterhelpers.cxx index 97e3e62858ec..e4f45fbcafa9 100644 --- a/oox/source/ppt/pptfilterhelpers.cxx +++ b/oox/source/ppt/pptfilterhelpers.cxx @@ -77,7 +77,7 @@ namespace oox { namespace ppt { while( p->mpName ) { - if( rName.compareToAscii( p->mpName ) == 0 ) + if( rName.equalsAscii( p->mpName ) ) return p; p++; diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx index 5e7227a95f0b..ca7f1cde248b 100644 --- a/oox/source/ppt/timenodelistcontext.cxx +++ b/oox/source/ppt/timenodelistcontext.cxx @@ -269,7 +269,7 @@ namespace oox { namespace ppt { { nCommand = EffectCommands::PLAY; } - else if( msCommand.compareToAscii( "playFrom" ) == 0 ) + else if( msCommand.equalsAscii( "playFrom" ) ) { const OUString aMediaTime( msCommand.copy( 9, msCommand.getLength() - 10 ) ); rtl_math_ConversionStatus eStatus; diff --git a/package/source/manifest/UnoRegister.cxx b/package/source/manifest/UnoRegister.cxx index b45cb4b8eef0..3d4756fb171f 100644 --- a/package/source/manifest/UnoRegister.cxx +++ b/package/source/manifest/UnoRegister.cxx @@ -49,13 +49,13 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL package2_component_getFactory( reinterpret_cast< XMultiServiceFactory * >( pServiceManager ) ); uno::Reference< XSingleServiceFactory > xFactory; - if (ManifestReader::static_getImplementationName().compareToAscii( pImplName ) == 0) + if (ManifestReader::static_getImplementationName().equalsAscii( pImplName ) ) xFactory = ManifestReader::createServiceFactory ( xSMgr ); - else if (ManifestWriter::static_getImplementationName().compareToAscii( pImplName ) == 0) + else if (ManifestWriter::static_getImplementationName().equalsAscii( pImplName ) ) xFactory = ManifestWriter::createServiceFactory ( xSMgr ); - else if (ZipPackage::static_getImplementationName().compareToAscii( pImplName ) == 0) + else if (ZipPackage::static_getImplementationName().equalsAscii( pImplName ) ) xFactory = ZipPackage::createServiceFactory ( xSMgr ); - else if ( OZipFileAccess::impl_staticGetImplementationName().compareToAscii( pImplName ) == 0 ) + else if ( OZipFileAccess::impl_staticGetImplementationName().equalsAscii( pImplName ) ) xFactory = ::cppu::createSingleFactory( xSMgr, OZipFileAccess::impl_staticGetImplementationName(), OZipFileAccess::impl_staticCreateSelfInstance, diff --git a/padmin/source/padialog.cxx b/padmin/source/padialog.cxx index 174e998db247..6cb37b764fde 100644 --- a/padmin/source/padialog.cxx +++ b/padmin/source/padialog.cxx @@ -695,7 +695,7 @@ void PADialog::UpdateDevice() OUString aToken( rInfo.m_aFeatures.getToken( 0, ',', nIndex ) ); if( !aToken.isEmpty() ) { - if( aToken.compareToAscii( "autoqueue" ) == 0 ) + if( aToken.equalsAscii( "autoqueue" ) ) bAutoQueue = true; else if( aToken.startsWith("pdf=") ) bPdf = true; diff --git a/pyuno/source/module/pyuno_type.cxx b/pyuno/source/module/pyuno_type.cxx index 2cd663ca9325..c23d1e7c29b5 100644 --- a/pyuno/source/module/pyuno_type.cxx +++ b/pyuno/source/module/pyuno_type.cxx @@ -185,7 +185,7 @@ Any PyEnum2Enum( PyObject *obj ) throw ( RuntimeException ) int i = 0; for( i = 0; i < pEnumDesc->nEnumValues ; i ++ ) { - if( (*((OUString *)&pEnumDesc->ppEnumNames[i])).compareToAscii( stringValue ) == 0 ) + if( (*((OUString *)&pEnumDesc->ppEnumNames[i])).equalsAscii( stringValue ) ) { break; } diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index c11ee3c1d1ca..4ed12273d14b 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -4181,7 +4181,7 @@ bool OReportController::impl_setPropertyAtControls_throw(const sal_uInt16 _nUndo void OReportController::impl_fillCustomShapeState_nothrow(const char* _pCustomShapeType,dbaui::FeatureState& _rState) const { _rState.bEnabled = isEditable(); - _rState.bChecked = getDesignView()->GetInsertObj() == OBJ_CUSTOMSHAPE && getDesignView()->GetInsertObjString().compareToAscii(_pCustomShapeType) == 0; + _rState.bChecked = getDesignView()->GetInsertObj() == OBJ_CUSTOMSHAPE && getDesignView()->GetInsertObjString().equalsAscii(_pCustomShapeType); } // ----------------------------------------------------------------------------- diff --git a/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx b/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx index c51fe8287773..55353039144f 100644 --- a/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx +++ b/sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx @@ -207,7 +207,7 @@ namespace rtl_Bootstrap aBootstrap.getFrom( suValuename, suValue ); sal_Char * pStr = getenv("ENABLE_JAVA"); // printUString( suGetname ); - CPPUNIT_ASSERT_MESSAGE("get the value of environment variable.", suValue.compareToAscii( pStr ) == 0 ); + CPPUNIT_ASSERT_MESSAGE("get the value of environment variable.", suValue.equalsAscii( pStr ) ); } /* Notes on Windows: void getFrom_001_1() @@ -219,7 +219,7 @@ namespace rtl_Bootstrap aBootstrap.getFrom( suValuename, suValue ); sal_Char * pStr = getenv("SRC_ROOT"); // printUString( suGetname ); - CPPUNIT_ASSERT_MESSAGE("get the value of environment variable.", suValue.compareToAscii( pStr ) == 0 ); + CPPUNIT_ASSERT_MESSAGE("get the value of environment variable.", suValue.equalsAscii( pStr ) ); } The result on Windows: # # the SRC_ROOT is e:\Qadev\cvs\m19 diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx index 97483e3d6433..9478b0ca73a5 100644 --- a/sc/source/filter/xml/xmldrani.cxx +++ b/sc/source/filter/xml/xmldrani.cxx @@ -860,7 +860,7 @@ ScXMLSortGroupsContext::ScXMLSortGroupsContext( ScXMLImport& rImport, if (sValue.getLength() > 8) { OUString sTemp = sValue.copy(0, 8); - if (sTemp.compareToAscii(SC_USERLIST) == 0) + if (sTemp.equalsAscii(SC_USERLIST)) { pDatabaseRangeContext->SetSubTotalsEnabledUserList(true); sTemp = sValue.copy(8); diff --git a/sc/source/filter/xml/xmlfilti.cxx b/sc/source/filter/xml/xmlfilti.cxx index 6e8f88b1c286..34327eb29a65 100644 --- a/sc/source/filter/xml/xmlfilti.cxx +++ b/sc/source/filter/xml/xmlfilti.cxx @@ -387,9 +387,9 @@ void ScXMLConditionContext::GetOperator( rParam.bRegExp = true; rEntry.eOp = SC_NOT_EQUAL; } - else if (aOpStr.compareToAscii("=") == 0) + else if (aOpStr.equalsAscii("=")) rEntry.eOp = SC_EQUAL; - else if (aOpStr.compareToAscii("!=") == 0) + else if (aOpStr.equalsAscii("!=")) rEntry.eOp = SC_NOT_EQUAL; else if (IsXMLToken(aOpStr, XML_BOTTOM_PERCENT)) rEntry.eOp = SC_BOTPERC; @@ -397,13 +397,13 @@ void ScXMLConditionContext::GetOperator( rEntry.eOp = SC_BOTVAL; else if (IsXMLToken(aOpStr, XML_EMPTY)) rEntry.SetQueryByEmpty(); - else if (aOpStr.compareToAscii(">") == 0) + else if (aOpStr.equalsAscii(">")) rEntry.eOp = SC_GREATER; - else if (aOpStr.compareToAscii(">=") == 0) + else if (aOpStr.equalsAscii(">=")) rEntry.eOp = SC_GREATER_EQUAL; - else if (aOpStr.compareToAscii("<") == 0) + else if (aOpStr.equalsAscii("<")) rEntry.eOp = SC_LESS; - else if (aOpStr.compareToAscii("<=") == 0) + else if (aOpStr.equalsAscii("<=")) rEntry.eOp = SC_LESS_EQUAL; else if (IsXMLToken(aOpStr, XML_NOEMPTY)) rEntry.SetQueryByNonEmpty(); @@ -827,21 +827,21 @@ void ScXMLDPConditionContext::getOperatorXML( bUseRegularExpressions = true; aFilterOperator = SC_NOT_EQUAL; } - else if (sTempOperator.compareToAscii("=") == 0) + else if (sTempOperator.equalsAscii("=")) aFilterOperator = SC_EQUAL; - else if (sTempOperator.compareToAscii("!=") == 0) + else if (sTempOperator.equalsAscii("!=")) aFilterOperator = SC_NOT_EQUAL; else if (IsXMLToken(sTempOperator, XML_BOTTOM_PERCENT)) aFilterOperator = SC_BOTPERC; else if (IsXMLToken(sTempOperator, XML_BOTTOM_VALUES)) aFilterOperator = SC_BOTVAL; - else if (sTempOperator.compareToAscii(">") == 0) + else if (sTempOperator.equalsAscii(">")) aFilterOperator = SC_GREATER; - else if (sTempOperator.compareToAscii(">=") == 0) + else if (sTempOperator.equalsAscii(">=")) aFilterOperator = SC_GREATER_EQUAL; - else if (sTempOperator.compareToAscii("<") == 0) + else if (sTempOperator.equalsAscii("<")) aFilterOperator = SC_LESS; - else if (sTempOperator.compareToAscii("<=") == 0) + else if (sTempOperator.equalsAscii("<=")) aFilterOperator = SC_LESS_EQUAL; else if (IsXMLToken(sTempOperator, XML_TOP_PERCENT)) aFilterOperator = SC_TOPPERC; diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 2c0f1b56c4f8..0999c04596bf 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -2444,20 +2444,20 @@ void ScXMLImport::SetChangeTrackingViewSettings(const com::sun::star::uno::Seque for (sal_Int32 i = 0; i < nCount; ++i) { OUString sName(rChangeProps[i].Name); - if (sName.compareToAscii("ShowChanges") == 0) + if (sName.equalsAscii("ShowChanges")) pViewSettings->SetShowChanges(::cppu::any2bool(rChangeProps[i].Value)); - else if (sName.compareToAscii("ShowAcceptedChanges") == 0) + else if (sName.equalsAscii("ShowAcceptedChanges")) pViewSettings->SetShowAccepted(::cppu::any2bool(rChangeProps[i].Value)); - else if (sName.compareToAscii("ShowRejectedChanges") == 0) + else if (sName.equalsAscii("ShowRejectedChanges")) pViewSettings->SetShowRejected(::cppu::any2bool(rChangeProps[i].Value)); - else if (sName.compareToAscii("ShowChangesByDatetime") == 0) + else if (sName.equalsAscii("ShowChangesByDatetime")) pViewSettings->SetHasDate(::cppu::any2bool(rChangeProps[i].Value)); - else if (sName.compareToAscii("ShowChangesByDatetimeMode") == 0) + else if (sName.equalsAscii("ShowChangesByDatetimeMode")) { if (rChangeProps[i].Value >>= nTemp16) pViewSettings->SetTheDateMode(ScChgsDateMode(nTemp16)); } - else if (sName.compareToAscii("ShowChangesByDatetimeFirstDatetime") == 0) + else if (sName.equalsAscii("ShowChangesByDatetimeFirstDatetime")) { util::DateTime aDateTime; if (rChangeProps[i].Value >>= aDateTime) @@ -2467,7 +2467,7 @@ void ScXMLImport::SetChangeTrackingViewSettings(const com::sun::star::uno::Seque pViewSettings->SetTheFirstDateTime(aCoreDateTime); } } - else if (sName.compareToAscii("ShowChangesByDatetimeSecondDatetime") == 0) + else if (sName.equalsAscii("ShowChangesByDatetimeSecondDatetime")) { util::DateTime aDateTime; if (rChangeProps[i].Value >>= aDateTime) @@ -2477,9 +2477,9 @@ void ScXMLImport::SetChangeTrackingViewSettings(const com::sun::star::uno::Seque pViewSettings->SetTheLastDateTime(aCoreDateTime); } } - else if (sName.compareToAscii("ShowChangesByAuthor") == 0) + else if (sName.equalsAscii("ShowChangesByAuthor")) pViewSettings->SetHasAuthor(::cppu::any2bool(rChangeProps[i].Value)); - else if (sName.compareToAscii("ShowChangesByAuthorName") == 0) + else if (sName.equalsAscii("ShowChangesByAuthorName")) { OUString sOUName; if (rChangeProps[i].Value >>= sOUName) @@ -2488,9 +2488,9 @@ void ScXMLImport::SetChangeTrackingViewSettings(const com::sun::star::uno::Seque pViewSettings->SetTheAuthorToShow(sAuthorName); } } - else if (sName.compareToAscii("ShowChangesByComment") == 0) + else if (sName.equalsAscii("ShowChangesByComment")) pViewSettings->SetHasComment(::cppu::any2bool(rChangeProps[i].Value)); - else if (sName.compareToAscii("ShowChangesByCommentText") == 0) + else if (sName.equalsAscii("ShowChangesByCommentText")) { OUString sOUComment; if (rChangeProps[i].Value >>= sOUComment) @@ -2499,9 +2499,9 @@ void ScXMLImport::SetChangeTrackingViewSettings(const com::sun::star::uno::Seque pViewSettings->SetTheComment(sComment); } } - else if (sName.compareToAscii("ShowChangesByRanges") == 0) + else if (sName.equalsAscii("ShowChangesByRanges")) pViewSettings->SetHasRange(::cppu::any2bool(rChangeProps[i].Value)); - else if (sName.compareToAscii("ShowChangesByRangesList") == 0) + else if (sName.equalsAscii("ShowChangesByRangesList")) { OUString sRanges; if ((rChangeProps[i].Value >>= sRanges) && !sRanges.isEmpty()) @@ -2528,15 +2528,15 @@ void ScXMLImport::SetViewSettings(const uno::Sequence& aVi for (sal_Int32 i = 0; i < nCount; ++i) { OUString sName(aViewProps[i].Name); - if (sName.compareToAscii("VisibleAreaHeight") == 0) + if (sName.equalsAscii("VisibleAreaHeight")) aViewProps[i].Value >>= nHeight; - else if (sName.compareToAscii("VisibleAreaLeft") == 0) + else if (sName.equalsAscii("VisibleAreaLeft")) aViewProps[i].Value >>= nLeft; - else if (sName.compareToAscii("VisibleAreaTop") == 0) + else if (sName.equalsAscii("VisibleAreaTop")) aViewProps[i].Value >>= nTop; - else if (sName.compareToAscii("VisibleAreaWidth") == 0) + else if (sName.equalsAscii("VisibleAreaWidth")) aViewProps[i].Value >>= nWidth; - else if (sName.compareToAscii("TrackedChangesViewSettings") == 0) + else if (sName.equalsAscii("TrackedChangesViewSettings")) { uno::Sequence aChangeProps; if(aViewProps[i].Value >>= aChangeProps) @@ -3025,13 +3025,13 @@ sal_Int32 ScXMLImport::GetRangeType(const OUString sRangeType) const if ((i == sRangeType.getLength()) || (sRangeType[i] == ' ')) { OUString sTemp = sBuffer.makeStringAndClear(); - if (sTemp.compareToAscii(SC_REPEAT_COLUMN) == 0) + if (sTemp.equalsAscii(SC_REPEAT_COLUMN)) nRangeType |= sheet::NamedRangeFlag::COLUMN_HEADER; - else if (sTemp.compareToAscii(SC_REPEAT_ROW) == 0) + else if (sTemp.equalsAscii(SC_REPEAT_ROW)) nRangeType |= sheet::NamedRangeFlag::ROW_HEADER; - else if (sTemp.compareToAscii(SC_FILTER) == 0) + else if (sTemp.equalsAscii(SC_FILTER)) nRangeType |= sheet::NamedRangeFlag::FILTER_CRITERIA; - else if (sTemp.compareToAscii(SC_PRINT_RANGE) == 0) + else if (sTemp.equalsAscii(SC_PRINT_RANGE)) nRangeType |= sheet::NamedRangeFlag::PRINT_AREA; } else if (i < sRangeType.getLength()) @@ -3219,7 +3219,7 @@ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeE for (sal_Int32 i = 0; i < nCount; ++i) { OUString sName(aSeq[i].Name); - if (sName.compareToAscii(SC_ACTIVETABLE) == 0) + if (sName.equalsAscii(SC_ACTIVETABLE)) { OUString sValue; if(aSeq[i].Value >>= sValue) diff --git a/sc/source/filter/xml/xmlsorti.cxx b/sc/source/filter/xml/xmlsorti.cxx index 175966f1e759..7792ec09fa9a 100644 --- a/sc/source/filter/xml/xmlsorti.cxx +++ b/sc/source/filter/xml/xmlsorti.cxx @@ -179,7 +179,7 @@ void ScXMLSortContext::AddSortField(const OUString& sFieldNumber, const OUString if (sDataType.getLength() > 8) { OUString sTemp = sDataType.copy(0, 8); - if (sTemp.compareToAscii(SC_USERLIST) == 0) + if (sTemp.equalsAscii(SC_USERLIST)) { bEnabledUserList = true; sTemp = sDataType.copy(8); diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx index ad06a9dc9d66..ebb4c0bd8fcc 100644 --- a/sc/source/ui/unoobj/confuno.cxx +++ b/sc/source/ui/unoobj/confuno.cxx @@ -137,17 +137,17 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( ScViewOptions aViewOpt(pDoc->GetViewOptions()); /*Stampit enable/disable print cancel */ - if ( aPropertyName.compareToAscii( SC_UNO_ALLOWPRINTJOBCANCEL ) == 0 ) + if ( aPropertyName.equalsAscii( SC_UNO_ALLOWPRINTJOBCANCEL ) ) pDocShell->Stamp_SetPrintCancelState( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); /*Stampit enable/disable print cancel */ - else if ( aPropertyName.compareToAscii( SC_UNO_SHOWZERO ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_SHOWZERO ) ) aViewOpt.SetOption(VOPT_NULLVALS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_SHOWNOTES ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_SHOWNOTES ) ) aViewOpt.SetOption(VOPT_NOTES, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_SHOWGRID ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_SHOWGRID ) ) aViewOpt.SetOption(VOPT_GRID, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_GRIDCOLOR ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_GRIDCOLOR ) ) { sal_Int64 nColor = 0; if (aValue >>= nColor) @@ -157,19 +157,19 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( aViewOpt.SetGridColor(aColor, aColorName); } } - else if ( aPropertyName.compareToAscii( SC_UNO_SHOWPAGEBR ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_SHOWPAGEBR ) ) aViewOpt.SetOption(VOPT_PAGEBREAKS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aPropertyName.compareToAscii( SC_UNONAME_LINKUPD ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNONAME_LINKUPD ) ) pDoc->SetLinkMode( static_cast ( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_COLROWHDR ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_COLROWHDR ) ) aViewOpt.SetOption(VOPT_HEADER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_SHEETTABS ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_SHEETTABS ) ) aViewOpt.SetOption(VOPT_TABCONTROLS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_OUTLSYMB ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_OUTLSYMB ) ) aViewOpt.SetOption(VOPT_OUTLINER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_AUTOCALC ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_AUTOCALC ) ) pDoc->SetAutoCalc( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_PRINTERNAME ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERNAME ) ) { OUString sPrinterName; if ( aValue >>= sPrinterName ) @@ -196,7 +196,7 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( else throw lang::IllegalArgumentException(); } - else if ( aPropertyName.compareToAscii( SC_UNO_PRINTERSETUP ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERSETUP ) ) { uno::Sequence aSequence; if ( aValue >>= aSequence ) @@ -217,47 +217,47 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( } } } - else if ( aPropertyName.compareToAscii( SC_UNO_APPLYDOCINF ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_APPLYDOCINF ) ) { sal_Bool bTmp=sal_True; if ( aValue >>= bTmp ) pDocShell->SetUseUserData( bTmp ); } - else if ( aPropertyName.compareToAscii( SC_UNO_FORBIDDEN ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_FORBIDDEN ) ) { // read-only - should not be set } - else if ( aPropertyName.compareToAscii( SC_UNO_CHARCOMP ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_CHARCOMP ) ) { // Int16 contains CharacterCompressionType values sal_Int16 nUno = ScUnoHelpFunctions::GetInt16FromAny( aValue ); pDoc->SetAsianCompression( (sal_uInt8) nUno ); bUpdateHeights = sal_True; } - else if ( aPropertyName.compareToAscii( SC_UNO_ASIANKERN ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_ASIANKERN ) ) { pDoc->SetAsianKerning( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); bUpdateHeights = sal_True; } - else if ( aPropertyName.compareToAscii( SCSAVEVERSION ) == 0) + else if ( aPropertyName.equalsAscii( SCSAVEVERSION ) ) { sal_Bool bTmp=false; if ( aValue >>= bTmp ) pDocShell->SetSaveVersionOnClose( bTmp ); } - else if ( aPropertyName.compareToAscii( SC_UNO_UPDTEMPL ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_UPDTEMPL ) ) { sal_Bool bTmp=sal_True; if ( aValue >>= bTmp ) pDocShell->SetQueryLoadTemplate( bTmp ); } - else if ( aPropertyName.compareToAscii( SC_UNO_LOADREADONLY ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_LOADREADONLY ) ) { sal_Bool bTmp=false; if ( aValue >>= bTmp ) pDocShell->SetLoadReadonly( bTmp ); } - else if ( aPropertyName.compareToAscii( SC_UNO_SHAREDOC ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_SHAREDOC ) ) { #if HAVE_FEATURE_MULTIUSER_ENVIRONMENT sal_Bool bDocShared = false; @@ -267,7 +267,7 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( } #endif } - else if ( aPropertyName.compareToAscii( SC_UNO_MODIFYPASSWORDINFO ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_MODIFYPASSWORDINFO ) ) { uno::Sequence< beans::PropertyValue > aInfo; if ( !( aValue >>= aInfo ) ) @@ -281,7 +281,7 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( OUString( "The hash is not allowed to be changed now!" ), uno::Reference< uno::XInterface >() ); } - else if ( aPropertyName.compareToAscii( SC_UNO_EMBED_FONTS ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_EMBED_FONTS ) ) { sal_Bool bVal = sal_False; if ( aValue >>=bVal ) @@ -293,19 +293,19 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( else { ScGridOptions aGridOpt(aViewOpt.GetGridOptions()); - if ( aPropertyName.compareToAscii( SC_UNO_SNAPTORASTER ) == 0 ) + if ( aPropertyName.equalsAscii( SC_UNO_SNAPTORASTER ) ) aGridOpt.SetUseGridSnap( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_RASTERVIS ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_RASTERVIS ) ) aGridOpt.SetGridVisible( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_RASTERRESX ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESX ) ) aGridOpt.SetFldDrawX( static_cast ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_RASTERRESY ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESY ) ) aGridOpt.SetFldDrawY( static_cast ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_RASTERSUBX ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBX ) ) aGridOpt.SetFldDivisionX( static_cast ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_RASTERSUBY ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBY ) ) aGridOpt.SetFldDivisionY( static_cast ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_RASTERSYNC ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSYNC ) ) aGridOpt.SetSynchronize( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); else throw beans::UnknownPropertyException(); @@ -345,35 +345,35 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const OUString& aPr const ScViewOptions& aViewOpt = pDoc->GetViewOptions(); /*Stampit enable/disable print cancel */ - if ( aPropertyName.compareToAscii( SC_UNO_ALLOWPRINTJOBCANCEL ) == 0 ) + if ( aPropertyName.equalsAscii( SC_UNO_ALLOWPRINTJOBCANCEL ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, pDocShell->Stamp_GetPrintCancelState() ); /*Stampit enable/disable print cancel */ - else if ( aPropertyName.compareToAscii( SC_UNO_SHOWZERO ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_SHOWZERO ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_NULLVALS ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_SHOWNOTES ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_SHOWNOTES ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_NOTES ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_SHOWGRID ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_SHOWGRID ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_GRID ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_GRIDCOLOR ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_GRIDCOLOR ) ) { OUString aColorName; Color aColor = aViewOpt.GetGridColor(&aColorName); aRet <<= static_cast(aColor.GetColor()); } - else if ( aPropertyName.compareToAscii( SC_UNO_SHOWPAGEBR ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_SHOWPAGEBR ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_PAGEBREAKS ) ); - else if ( aPropertyName.compareToAscii( SC_UNONAME_LINKUPD ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNONAME_LINKUPD ) ) aRet <<= static_cast ( pDoc->GetLinkMode() ); - else if ( aPropertyName.compareToAscii( SC_UNO_COLROWHDR ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_COLROWHDR ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_HEADER ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_SHEETTABS ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_SHEETTABS ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_TABCONTROLS ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_OUTLSYMB ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_OUTLSYMB ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_OUTLINER ) ); - else if ( aPropertyName.compareToAscii( SC_UNO_AUTOCALC ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_AUTOCALC ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, pDoc->GetAutoCalc() ); - else if ( aPropertyName.compareToAscii( SC_UNO_PRINTERNAME ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERNAME ) ) { // #i75610# don't create the printer, return empty string if no printer created yet // (as in SwXDocumentSettings) @@ -383,7 +383,7 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const OUString& aPr else aRet <<= OUString(); } - else if ( aPropertyName.compareToAscii( SC_UNO_PRINTERSETUP ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERSETUP ) ) { // #i75610# don't create the printer, return empty sequence if no printer created yet // (as in SwXDocumentSettings) @@ -402,31 +402,31 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const OUString& aPr else aRet <<= uno::Sequence(); } - else if ( aPropertyName.compareToAscii( SC_UNO_APPLYDOCINF ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_APPLYDOCINF ) ) aRet <<= pDocShell->IsUseUserData(); - else if ( aPropertyName.compareToAscii( SC_UNO_FORBIDDEN ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_FORBIDDEN ) ) { aRet <<= uno::Reference(new ScForbiddenCharsObj( pDocShell )); } - else if ( aPropertyName.compareToAscii( SC_UNO_CHARCOMP ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_CHARCOMP ) ) aRet <<= static_cast ( pDoc->GetAsianCompression() ); - else if ( aPropertyName.compareToAscii( SC_UNO_ASIANKERN ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_ASIANKERN ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, pDoc->GetAsianKerning() ); - else if ( aPropertyName.compareToAscii( SCSAVEVERSION ) == 0) + else if ( aPropertyName.equalsAscii( SCSAVEVERSION ) ) aRet <<= pDocShell->IsSaveVersionOnClose(); - else if ( aPropertyName.compareToAscii( SC_UNO_UPDTEMPL ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_UPDTEMPL ) ) aRet <<= pDocShell->IsQueryLoadTemplate(); - else if ( aPropertyName.compareToAscii( SC_UNO_LOADREADONLY ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_LOADREADONLY ) ) aRet <<= pDocShell->IsLoadReadonly(); - else if ( aPropertyName.compareToAscii( SC_UNO_SHAREDOC ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_SHAREDOC ) ) { #if HAVE_FEATURE_MULTIUSER_ENVIRONMENT ScUnoHelpFunctions::SetBoolInAny( aRet, pDocShell->HasSharedXMLFlagSet() ); #endif } - else if ( aPropertyName.compareToAscii( SC_UNO_MODIFYPASSWORDINFO ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_MODIFYPASSWORDINFO ) ) aRet <<= pDocShell->GetModifyPasswordInfo(); - else if ( aPropertyName.compareToAscii( SC_UNO_EMBED_FONTS ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_EMBED_FONTS ) ) { aRet <<= pDoc->IsUsingEmbededFonts(); } @@ -434,19 +434,19 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const OUString& aPr else { const ScGridOptions& aGridOpt = aViewOpt.GetGridOptions(); - if ( aPropertyName.compareToAscii( SC_UNO_SNAPTORASTER ) == 0 ) + if ( aPropertyName.equalsAscii( SC_UNO_SNAPTORASTER ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, aGridOpt.GetUseGridSnap() ); - else if ( aPropertyName.compareToAscii( SC_UNO_RASTERVIS ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_RASTERVIS ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, aGridOpt.GetGridVisible() ); - else if ( aPropertyName.compareToAscii( SC_UNO_RASTERRESX ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESX ) ) aRet <<= static_cast ( aGridOpt.GetFldDrawX() ); - else if ( aPropertyName.compareToAscii( SC_UNO_RASTERRESY ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESY ) ) aRet <<= static_cast ( aGridOpt.GetFldDrawY() ); - else if ( aPropertyName.compareToAscii( SC_UNO_RASTERSUBX ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBX ) ) aRet <<= static_cast ( aGridOpt.GetFldDivisionX() ); - else if ( aPropertyName.compareToAscii( SC_UNO_RASTERSUBY ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBY ) ) aRet <<= static_cast ( aGridOpt.GetFldDivisionY() ); - else if ( aPropertyName.compareToAscii( SC_UNO_RASTERSYNC ) == 0 ) + else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSYNC ) ) ScUnoHelpFunctions::SetBoolInAny( aRet, aGridOpt.GetSynchronize() ); else throw beans::UnknownPropertyException(); diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx index ab2306d95c71..5299528a46df 100644 --- a/sc/source/ui/unoobj/defltuno.cxx +++ b/sc/source/ui/unoobj/defltuno.cxx @@ -138,7 +138,7 @@ void SAL_CALL ScDocDefaultsObj::setPropertyValue( throw beans::UnknownPropertyException(); if(!pEntry->nWID) { - if(aPropertyName.compareToAscii(SC_UNO_STANDARDDEC) == 0) + if(aPropertyName.equalsAscii(SC_UNO_STANDARDDEC) ) { ScDocument* pDoc = pDocShell->GetDocument(); if (pDoc) @@ -154,7 +154,7 @@ void SAL_CALL ScDocDefaultsObj::setPropertyValue( else throw uno::RuntimeException(); } - else if (aPropertyName.compareToAscii(SC_UNO_TABSTOPDIS) == 0) + else if (aPropertyName.equalsAscii(SC_UNO_TABSTOPDIS) ) { ScDocument* pDoc = pDocShell->GetDocument(); if (pDoc) @@ -234,7 +234,7 @@ uno::Any SAL_CALL ScDocDefaultsObj::getPropertyValue( const OUString& aPropertyN if (!pEntry->nWID) { - if(aPropertyName.compareToAscii(SC_UNO_STANDARDDEC) == 0) + if(aPropertyName.equalsAscii(SC_UNO_STANDARDDEC) ) { ScDocument* pDoc = pDocShell->GetDocument(); if (pDoc) @@ -250,7 +250,7 @@ uno::Any SAL_CALL ScDocDefaultsObj::getPropertyValue( const OUString& aPropertyN else throw uno::RuntimeException(); } - else if (aPropertyName.compareToAscii(SC_UNO_TABSTOPDIS) == 0) + else if (aPropertyName.equalsAscii(SC_UNO_TABSTOPDIS) ) { ScDocument* pDoc = pDocShell->GetDocument(); if (pDoc) diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index a373bc2a8e0f..e55fe2119707 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -2179,7 +2179,7 @@ void ScModelObj::NotifyChanges( const OUString& rOperation, const ScRangeList& r // handle sheet events //! separate method with ScMarkData? Then change HasChangesListeners back. - if ( rOperation.compareToAscii("cell-change") == 0 && pDocShell ) + if ( rOperation.equalsAscii("cell-change") && pDocShell ) { ScMarkData aMarkData; aMarkData.MarkFromRangeList( rRanges, false ); diff --git a/sc/source/ui/unoobj/eventuno.cxx b/sc/source/ui/unoobj/eventuno.cxx index 5539a3f47fe9..5d2b140eb850 100644 --- a/sc/source/ui/unoobj/eventuno.cxx +++ b/sc/source/ui/unoobj/eventuno.cxx @@ -94,7 +94,7 @@ void SAL_CALL ScSheetEventsObj::replaceByName( const OUString& aName, const uno: for (sal_Int32 nPos=0; nPos>= aEventType ) @@ -104,7 +104,7 @@ void SAL_CALL ScSheetEventsObj::replaceByName( const OUString& aName, const uno: throw lang::IllegalArgumentException(); } } - else if ( rProp.Name.compareToAscii( SC_UNO_SCRIPT ) == 0 ) + else if ( rProp.Name.equalsAscii( SC_UNO_SCRIPT ) ) rProp.Value >>= aScript; } } diff --git a/sc/source/ui/vba/vbachartobject.cxx b/sc/source/ui/vba/vbachartobject.cxx index 1458b0bd81e7..e63141fd9569 100644 --- a/sc/source/ui/vba/vbachartobject.cxx +++ b/sc/source/ui/vba/vbachartobject.cxx @@ -57,7 +57,7 @@ ScVbaChartObject::setShape() throw ( script::BasicErrorException ) for (int i = 0; i < nItems; i++) { xShape.set( xDrawPage->getByIndex(i), uno::UNO_QUERY_THROW ); - if (xShape->getShapeType().compareToAscii("com.sun.star.drawing.OLE2Shape") == 0 ) + if (xShape->getShapeType().equalsAscii("com.sun.star.drawing.OLE2Shape") ) { uno::Reference< beans::XPropertySet > xShapePropertySet(xShape, uno::UNO_QUERY_THROW ); OUString sName; diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 77181cbd18fc..f2c8fea68d88 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -973,13 +973,13 @@ void ScPreviewShell::ReadUserDataSequence(const uno::Sequence < beans::PropertyV for(sal_Int32 i = 0; i < nCount; i++, pSeq++) { OUString sName(pSeq->Name); - if(sName.compareToAscii(SC_ZOOMVALUE) == 0) + if(sName.equalsAscii(SC_ZOOMVALUE)) { sal_Int32 nTemp = 0; if (pSeq->Value >>= nTemp) pPreview->SetZoom(sal_uInt16(nTemp)); } - else if (sName.compareToAscii("PageNumber") == 0) + else if (sName.equalsAscii("PageNumber")) { sal_Int32 nTemp = 0; if (pSeq->Value >>= nTemp) diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 1434cd49f508..4e3e0650c3ea 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -171,102 +171,102 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence >= nTemp32; nCurX = SanitizeCol( static_cast(nTemp32)); } - else if (sName.compareToAscii(SC_CURSORPOSITIONY) == 0) + else if (sName.equalsAscii(SC_CURSORPOSITIONY) ) { aSettings[i].Value >>= nTemp32; nCurY = SanitizeRow( static_cast(nTemp32)); } - else if (sName.compareToAscii(SC_HORIZONTALSPLITMODE) == 0) + else if (sName.equalsAscii(SC_HORIZONTALSPLITMODE) ) { aSettings[i].Value >>= nTemp16; eHSplitMode = static_cast(nTemp16); } - else if (sName.compareToAscii(SC_VERTICALSPLITMODE) == 0) + else if (sName.equalsAscii(SC_VERTICALSPLITMODE) ) { aSettings[i].Value >>= nTemp16; eVSplitMode = static_cast(nTemp16); } - else if (sName.compareToAscii(SC_HORIZONTALSPLITPOSITION) == 0) + else if (sName.equalsAscii(SC_HORIZONTALSPLITPOSITION) ) { aSettings[i].Value >>= nTempPosH; bHasHSplitInTwips = false; } - else if (sName.compareToAscii(SC_VERTICALSPLITPOSITION) == 0) + else if (sName.equalsAscii(SC_VERTICALSPLITPOSITION) ) { aSettings[i].Value >>= nTempPosV; bHasVSplitInTwips = false; } - else if (sName.compareToAscii(SC_HORIZONTALSPLITPOSITION_TWIPS) == 0) + else if (sName.equalsAscii(SC_HORIZONTALSPLITPOSITION_TWIPS) ) { aSettings[i].Value >>= nTempPosHTw; bHasHSplitInTwips = true; } - else if (sName.compareToAscii(SC_VERTICALSPLITPOSITION_TWIPS) == 0) + else if (sName.equalsAscii(SC_VERTICALSPLITPOSITION_TWIPS) ) { aSettings[i].Value >>= nTempPosVTw; bHasVSplitInTwips = true; } - else if (sName.compareToAscii(SC_ACTIVESPLITRANGE) == 0) + else if (sName.equalsAscii(SC_ACTIVESPLITRANGE) ) { aSettings[i].Value >>= nTemp16; eWhichActive = static_cast(nTemp16); } - else if (sName.compareToAscii(SC_POSITIONLEFT) == 0) + else if (sName.equalsAscii(SC_POSITIONLEFT) ) { aSettings[i].Value >>= nTemp32; nPosX[SC_SPLIT_LEFT] = SanitizeCol( static_cast(nTemp32)); } - else if (sName.compareToAscii(SC_POSITIONRIGHT) == 0) + else if (sName.equalsAscii(SC_POSITIONRIGHT) ) { aSettings[i].Value >>= nTemp32; nPosX[SC_SPLIT_RIGHT] = SanitizeCol( static_cast(nTemp32)); } - else if (sName.compareToAscii(SC_POSITIONTOP) == 0) + else if (sName.equalsAscii(SC_POSITIONTOP) ) { aSettings[i].Value >>= nTemp32; nPosY[SC_SPLIT_TOP] = SanitizeRow( static_cast(nTemp32)); } - else if (sName.compareToAscii(SC_POSITIONBOTTOM) == 0) + else if (sName.equalsAscii(SC_POSITIONBOTTOM) ) { aSettings[i].Value >>= nTemp32; nPosY[SC_SPLIT_BOTTOM] = SanitizeRow( static_cast(nTemp32)); } - else if (sName.compareToAscii(SC_ZOOMTYPE) == 0) + else if (sName.equalsAscii(SC_ZOOMTYPE) ) { aSettings[i].Value >>= nTemp16; eZoomType = SvxZoomType(nTemp16); rHasZoom = true; // set if there is any zoom information } - else if (sName.compareToAscii(SC_ZOOMVALUE) == 0) + else if (sName.equalsAscii(SC_ZOOMVALUE) ) { aSettings[i].Value >>= nTemp32; Fraction aZoom(nTemp32, 100); aZoomX = aZoomY = aZoom; rHasZoom = true; } - else if (sName.compareToAscii(SC_PAGEVIEWZOOMVALUE) == 0) + else if (sName.equalsAscii(SC_PAGEVIEWZOOMVALUE) ) { aSettings[i].Value >>= nTemp32; Fraction aZoom(nTemp32, 100); aPageZoomX = aPageZoomY = aZoom; rHasZoom = true; } - else if (sName.compareToAscii(SC_UNO_SHOWGRID) == 0) + else if (sName.equalsAscii(SC_UNO_SHOWGRID) ) { aSettings[i].Value >>= bShowGrid; } - else if (sName.compareToAscii(SC_TABLESELECTED) == 0) + else if (sName.equalsAscii(SC_TABLESELECTED) ) { bool bSelected = false; aSettings[i].Value >>= bSelected; rViewData.GetMarkData().SelectTable( nTab, bSelected ); } - else if (sName.compareToAscii(SC_UNONAME_TABCOLOR) == 0) + else if (sName.equalsAscii(SC_UNONAME_TABCOLOR) ) { // There are documents out there that have their tab color defined as a view setting. sal_Int32 nColor = COL_AUTO; @@ -2719,7 +2719,7 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence { // SC_VIEWID has to parse and use by mba OUString sName(rSettings[i].Name); - if (sName.compareToAscii(SC_TABLES) == 0) + if (sName.equalsAscii(SC_TABLES) ) { uno::Reference xNameContainer; if ((rSettings[i].Value >>= xNameContainer) && xNameContainer->hasElements()) @@ -2747,7 +2747,7 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence } } } - else if (sName.compareToAscii(SC_ACTIVETABLE) == 0) + else if (sName.equalsAscii(SC_ACTIVETABLE) ) { OUString sValue; if(rSettings[i].Value >>= sValue) @@ -2758,23 +2758,23 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence nTabNo = nTab; } } - else if (sName.compareToAscii(SC_HORIZONTALSCROLLBARWIDTH) == 0) + else if (sName.equalsAscii(SC_HORIZONTALSCROLLBARWIDTH) ) { if (rSettings[i].Value >>= nTemp32) pView->SetTabBarWidth(nTemp32); } - else if (sName.compareToAscii(SC_RELHORIZONTALTABBARWIDTH) == 0) + else if (sName.equalsAscii(SC_RELHORIZONTALTABBARWIDTH) ) { double fWidth = 0.0; if (rSettings[i].Value >>= fWidth) pView->SetPendingRelTabBarWidth( fWidth ); } - else if (sName.compareToAscii(SC_ZOOMTYPE) == 0) + else if (sName.equalsAscii(SC_ZOOMTYPE) ) { if (rSettings[i].Value >>= nTemp16) eDefZoomType = SvxZoomType(nTemp16); } - else if (sName.compareToAscii(SC_ZOOMVALUE) == 0) + else if (sName.equalsAscii(SC_ZOOMVALUE) ) { if (rSettings[i].Value >>= nTemp32) { @@ -2782,7 +2782,7 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence aDefZoomX = aDefZoomY = aZoom; } } - else if (sName.compareToAscii(SC_PAGEVIEWZOOMVALUE) == 0) + else if (sName.equalsAscii(SC_PAGEVIEWZOOMVALUE) ) { if (rSettings[i].Value >>= nTemp32) { @@ -2790,15 +2790,15 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence aDefPageZoomX = aDefPageZoomY = aZoom; } } - else if (sName.compareToAscii(SC_SHOWPAGEBREAKPREVIEW) == 0) + else if (sName.equalsAscii(SC_SHOWPAGEBREAKPREVIEW) ) bPageMode = ScUnoHelpFunctions::GetBoolFromAny( rSettings[i].Value ); - else if ( sName.compareToAscii( SC_UNO_SHOWZERO ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_SHOWZERO ) ) pOptions->SetOption(VOPT_NULLVALS, ScUnoHelpFunctions::GetBoolFromAny( rSettings[i].Value ) ); - else if ( sName.compareToAscii( SC_UNO_SHOWNOTES ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_SHOWNOTES ) ) pOptions->SetOption(VOPT_NOTES, ScUnoHelpFunctions::GetBoolFromAny( rSettings[i].Value ) ); - else if ( sName.compareToAscii( SC_UNO_SHOWGRID ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_SHOWGRID ) ) pOptions->SetOption(VOPT_GRID, ScUnoHelpFunctions::GetBoolFromAny( rSettings[i].Value ) ); - else if ( sName.compareToAscii( SC_UNO_GRIDCOLOR ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_GRIDCOLOR ) ) { sal_Int64 nColor = 0; if (rSettings[i].Value >>= nColor) @@ -2811,27 +2811,27 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence pOptions->SetGridColor(aColor, aColorName); } } - else if ( sName.compareToAscii( SC_UNO_SHOWPAGEBR ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_SHOWPAGEBR ) ) pOptions->SetOption(VOPT_PAGEBREAKS, ScUnoHelpFunctions::GetBoolFromAny( rSettings[i].Value ) ); - else if ( sName.compareToAscii( SC_UNO_COLROWHDR ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_COLROWHDR ) ) pOptions->SetOption(VOPT_HEADER, ScUnoHelpFunctions::GetBoolFromAny( rSettings[i].Value ) ); - else if ( sName.compareToAscii( SC_UNO_SHEETTABS ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_SHEETTABS ) ) pOptions->SetOption(VOPT_TABCONTROLS, ScUnoHelpFunctions::GetBoolFromAny( rSettings[i].Value ) ); - else if ( sName.compareToAscii( SC_UNO_OUTLSYMB ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_OUTLSYMB ) ) pOptions->SetOption(VOPT_OUTLINER, ScUnoHelpFunctions::GetBoolFromAny( rSettings[i].Value ) ); - else if ( sName.compareToAscii( SC_UNO_SHOWOBJ ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_SHOWOBJ ) ) { // #i80528# placeholders not supported anymore if ( rSettings[i].Value >>= nTemp16 ) pOptions->SetObjMode( VOBJ_TYPE_OLE, (nTemp16 == 1) ? VOBJ_MODE_HIDE : VOBJ_MODE_SHOW ); } - else if ( sName.compareToAscii( SC_UNO_SHOWCHARTS ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_SHOWCHARTS ) ) { // #i80528# placeholders not supported anymore if ( rSettings[i].Value >>= nTemp16 ) pOptions->SetObjMode( VOBJ_TYPE_CHART, (nTemp16 == 1) ? VOBJ_MODE_HIDE : VOBJ_MODE_SHOW ); } - else if ( sName.compareToAscii( SC_UNO_SHOWDRAW ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_SHOWDRAW ) ) { // #i80528# placeholders not supported anymore if ( rSettings[i].Value >>= nTemp16 ) @@ -2840,19 +2840,19 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence else { ScGridOptions aGridOpt(pOptions->GetGridOptions()); - if ( sName.compareToAscii( SC_UNO_SNAPTORASTER ) == 0 ) + if ( sName.equalsAscii( SC_UNO_SNAPTORASTER ) ) aGridOpt.SetUseGridSnap( ScUnoHelpFunctions::GetBoolFromAny( rSettings[i].Value ) ); - else if ( sName.compareToAscii( SC_UNO_RASTERVIS ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_RASTERVIS ) ) aGridOpt.SetGridVisible( ScUnoHelpFunctions::GetBoolFromAny( rSettings[i].Value ) ); - else if ( sName.compareToAscii( SC_UNO_RASTERRESX ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_RASTERRESX ) ) aGridOpt.SetFldDrawX( static_cast ( ScUnoHelpFunctions::GetInt32FromAny( rSettings[i].Value ) ) ); - else if ( sName.compareToAscii( SC_UNO_RASTERRESY ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_RASTERRESY )) aGridOpt.SetFldDrawY( static_cast ( ScUnoHelpFunctions::GetInt32FromAny( rSettings[i].Value ) ) ); - else if ( sName.compareToAscii( SC_UNO_RASTERSUBX ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_RASTERSUBX ) ) aGridOpt.SetFldDivisionX( static_cast ( ScUnoHelpFunctions::GetInt32FromAny( rSettings[i].Value ) ) ); - else if ( sName.compareToAscii( SC_UNO_RASTERSUBY ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_RASTERSUBY ) ) aGridOpt.SetFldDivisionY( static_cast ( ScUnoHelpFunctions::GetInt32FromAny( rSettings[i].Value ) ) ); - else if ( sName.compareToAscii( SC_UNO_RASTERSYNC ) == 0 ) + else if ( sName.equalsAscii( SC_UNO_RASTERSYNC ) ) aGridOpt.SetSynchronize( ScUnoHelpFunctions::GetBoolFromAny( rSettings[i].Value ) ); pOptions->SetGridOptions(aGridOpt); } diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx index d282df0f5b3a..27c0fda1fdaa 100644 --- a/scaddins/source/analysis/analysis.cxx +++ b/scaddins/source/analysis/analysis.cxx @@ -283,7 +283,7 @@ OUString SAL_CALL AnalysisAddIn::getImplementationName() throw( uno::RuntimeExce sal_Bool SAL_CALL AnalysisAddIn::supportsService( const OUString& aName ) throw( uno::RuntimeException ) { - return aName.compareToAscii( ADDIN_SERVICE ) == 0 || aName.compareToAscii( MY_SERVICE ) == 0; + return aName.equalsAscii( ADDIN_SERVICE ) || aName.equalsAscii( MY_SERVICE ); } @@ -1284,7 +1284,7 @@ OUString SAL_CALL AnalysisAddIn::getComplex( double fR, double fI, const uno::An case uno::TypeClass_STRING: { const OUString* pSuff = ( const OUString* ) rSuff.getValue(); - bi = pSuff->compareToAscii( "i" ) == 0 || pSuff->isEmpty(); + bi = pSuff->equalsAscii( "i" ) || pSuff->isEmpty(); if( !bi && pSuff->compareToAscii( "j" ) != 0 ) throw lang::IllegalArgumentException(); } diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx index 92048e623512..fc0d79afc954 100644 --- a/scaddins/source/pricing/pricing.cxx +++ b/scaddins/source/pricing/pricing.cxx @@ -612,24 +612,24 @@ bool getinput_greek(bs::types::Greeks& greek, const uno::Any& anyval) { return false; } - if(str.compareToAscii("value")==0 || str.compareToAscii("price")==0 || - str.compareToAscii("v")==0 || str.compareToAscii("p")==0 ) { + if(str.equalsAscii("value") || str.equalsAscii("price") || + str.equalsAscii("v") || str.equalsAscii("p") ) { greek=bs::types::Value; - } else if(str.compareToAscii("delta")==0||str.compareToAscii("d")==0) { + } else if(str.equalsAscii("delta") || str.equalsAscii("d")) { greek=bs::types::Delta; - } else if(str.compareToAscii("gamma")==0||str.compareToAscii("g")==0) { + } else if(str.equalsAscii("gamma") || str.equalsAscii("g")) { greek=bs::types::Gamma; - } else if(str.compareToAscii("theta")==0||str.compareToAscii("t")==0) { + } else if(str.equalsAscii("theta") || str.equalsAscii("t")) { greek=bs::types::Theta; - } else if(str.compareToAscii("vega")==0||str.compareToAscii("e")==0) { + } else if(str.equalsAscii("vega") || str.equalsAscii("e")) { greek=bs::types::Vega; - } else if(str.compareToAscii("volga")==0||str.compareToAscii("o")==0) { + } else if(str.equalsAscii("volga") || str.equalsAscii("o")) { greek=bs::types::Volga; - } else if(str.compareToAscii("vanna")==0||str.compareToAscii("a")==0) { + } else if(str.equalsAscii("vanna") || str.equalsAscii("a")) { greek=bs::types::Vanna; - } else if(str.compareToAscii("rho")==0||str.compareToAscii("r")==0) { + } else if(str.equalsAscii("rho") || str.equalsAscii("r")) { greek=bs::types::Rho_d; - } else if(str.compareToAscii("rhof")==0||str.compareToAscii("f")==0) { + } else if(str.equalsAscii("rhof") || str.equalsAscii("f")) { greek=bs::types::Rho_f; } else { return false; diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx index 6dfe69a05fbd..9fc11f39ddb4 100644 --- a/scripting/source/dlgprov/dlgevtatt.cxx +++ b/scripting/source/dlgprov/dlgevtatt.cxx @@ -527,7 +527,7 @@ namespace dlgprov OUString sScriptURL; OUString sScriptCode( aScriptEvent.ScriptCode ); - if ( aScriptEvent.ScriptType.compareToAscii( "StarBasic" ) == 0 ) + if ( aScriptEvent.ScriptType.equalsAscii( "StarBasic" ) ) { // StarBasic script: convert ScriptCode to scriptURL sal_Int32 nIndex = sScriptCode.indexOf( ':' ); diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx index 355877ce9e0b..6ad06d633759 100644 --- a/sd/source/filter/eppt/pptexanimations.cxx +++ b/sd/source/filter/eppt/pptexanimations.cxx @@ -98,7 +98,7 @@ void ImplTranslateAttribute( OUString& rString, const TranslateMode eTranslateMo const ImplAttributeNameConversion* p = gImplConversionList; while( p->mpAPIName ) { - if( rString.compareToAscii( p->mpAPIName ) == 0 ) + if( rString.equalsAscii( p->mpAPIName ) ) break; p++; } diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx index 5bfac6ade440..3d7daa85cc7d 100644 --- a/sd/source/filter/ppt/pptinanimations.cxx +++ b/sd/source/filter/ppt/pptinanimations.cxx @@ -91,7 +91,7 @@ const transition* transition::find( const OUString& rName ) while( p->mpName ) { - if( rName.compareToAscii( p->mpName ) == 0 ) + if( rName.equalsAscii( p->mpName ) ) return p; p++; @@ -698,7 +698,7 @@ bool AnimationImporter::convertAnimationNode( const Reference< XAnimationNode >& { while( p->mpMSName ) { - if( aAttributeName.compareToAscii( p->mpMSName ) == 0 ) + if( aAttributeName.equalsAscii( p->mpMSName ) ) break; p++; diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index 76179bd37cd4..58e5d25e3073 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -807,9 +807,9 @@ void AssistentDlgImpl::ScanDocmenu (void) OUString sFactoryName; for( sal_Int32 i=0; i>= sFactoryName) && - sFactoryName.compareToAscii( "com.sun.star.presentation.PresentationDocument" ) == 0 ) + sFactoryName.equalsAscii( "com.sun.star.presentation.PresentationDocument" ) ) { // yes, it's an impress document INetURLObject aURL; diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx index f2804c1f20b5..281c4650b5d5 100644 --- a/sd/source/ui/framework/factories/FullScreenPane.cxx +++ b/sd/source/ui/framework/factories/FullScreenPane.cxx @@ -270,7 +270,7 @@ void FullScreenPane::ExtractArguments ( const OUString sKey = aToken.copy(0, nAssign); const OUString sValue = aToken.copy(nAssign+1); - if (sKey.compareToAscii("ScreenNumber") == 0) + if (sKey.equalsAscii("ScreenNumber")) { rnScreenNumberReturnValue = sValue.toInt32(); } diff --git a/sd/source/ui/remotecontrol/ImagePreparer.cxx b/sd/source/ui/remotecontrol/ImagePreparer.cxx index f9641b0b4951..7baa1aa64c3f 100644 --- a/sd/source/ui/remotecontrol/ImagePreparer.cxx +++ b/sd/source/ui/remotecontrol/ImagePreparer.cxx @@ -305,7 +305,7 @@ sal_Bool ExportTo( uno::Reference< drawing::XDrawPage>& aNotesPage, OUString aUr for ( sal_Int32 nFilterProp = 0; nFilterProp>= aFilterImplName; break; diff --git a/sdext/source/minimizer/pppoptimizer.cxx b/sdext/source/minimizer/pppoptimizer.cxx index 3329e4854e09..b6679e82ad46 100644 --- a/sdext/source/minimizer/pppoptimizer.cxx +++ b/sdext/source/minimizer/pppoptimizer.cxx @@ -55,9 +55,9 @@ Reference< com::sun::star::frame::XDispatch > SAL_CALL PPPOptimizer::queryDispat const URL& aURL, const OUString& /* aTargetFrameName */, sal_Int32 /* nSearchFlags */ ) throw( RuntimeException ) { Reference < XDispatch > xRet; - if ( aURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.PPPOptimizer:" ) == 0 ) + if ( aURL.Protocol.equalsAscii( "vnd.com.sun.star.comp.PPPOptimizer:" ) ) { -// if ( aURL.Path.compareToAscii( "Function1" ) == 0 ) +// if ( aURL.Path.equalsAscii( "Function1" ) ) xRet = this; } return xRet; @@ -85,9 +85,9 @@ Sequence< Reference< com::sun::star::frame::XDispatch > > SAL_CALL PPPOptimizer: void SAL_CALL PPPOptimizer::dispatch( const URL& rURL, const Sequence< PropertyValue >& lArguments ) throw( RuntimeException ) { - if ( mxController.is() && ( rURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.PPPOptimizer:" ) == 0 ) ) + if ( mxController.is() && rURL.Protocol.equalsAscii( "vnd.com.sun.star.comp.PPPOptimizer:" ) ) { - if ( rURL.Path.compareToAscii( "optimize" ) == 0 ) + if ( rURL.Path.equalsAscii( "optimize" ) ) { Reference< XModel > xModel( mxController->getModel() ); if ( xModel.is() ) diff --git a/sdext/source/minimizer/pppoptimizerdialog.cxx b/sdext/source/minimizer/pppoptimizerdialog.cxx index 0ff0ed30aaa5..1cfc874a88fa 100644 --- a/sdext/source/minimizer/pppoptimizerdialog.cxx +++ b/sdext/source/minimizer/pppoptimizerdialog.cxx @@ -92,7 +92,7 @@ Reference< com::sun::star::frame::XDispatch > SAL_CALL PPPOptimizerDialog::query const URL& aURL, const OUString& /* aTargetFrameName */, sal_Int32 /* nSearchFlags */ ) throw( RuntimeException ) { Reference < XDispatch > xRet; - if ( aURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.PresentationMinimizer:" ) == 0 ) + if ( aURL.Protocol.equalsAscii( "vnd.com.sun.star.comp.PresentationMinimizer:" ) ) xRet = this; return xRet; @@ -122,9 +122,9 @@ void SAL_CALL PPPOptimizerDialog::dispatch( const URL& rURL, throw( RuntimeException ) { - if ( mxController.is() && ( rURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.PresentationMinimizer:" ) == 0 ) ) + if ( mxController.is() && rURL.Protocol.equalsAscii( "vnd.com.sun.star.comp.PresentationMinimizer:" ) ) { - if ( rURL.Path.compareToAscii( "execute" ) == 0 ) + if ( rURL.Path.equalsAscii( "execute" ) ) { try { @@ -157,7 +157,7 @@ void SAL_CALL PPPOptimizerDialog::dispatch( const URL& rURL, } } - else if ( rURL.Path.compareToAscii( "statusupdate" ) == 0 ) + else if ( rURL.Path.equalsAscii( "statusupdate" ) ) { if ( mpOptimizerDialog ) mpOptimizerDialog->UpdateStatus( rArguments ); diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx index d11d8f43adc6..7665be4d1e7d 100644 --- a/sdext/source/pdfimport/filterdet.cxx +++ b/sdext/source/pdfimport/filterdet.cxx @@ -158,8 +158,7 @@ namespace { const OUString& MethodName ) throw (lang::WrappedTargetException, uno::RuntimeException) { (void)MethodName; - OSL_ENSURE( MethodName.compareToAscii("SelectionChanged") == 0, - "Invalid event name" ); + OSL_ENSURE( MethodName.equalsAscii("SelectionChanged"), "Invalid event name" ); selectionChanged(getSelectedItem()); return sal_True; } diff --git a/sdext/source/pdfimport/test/tests.cxx b/sdext/source/pdfimport/test/tests.cxx index 4dc70a015489..a1cb3176507e 100644 --- a/sdext/source/pdfimport/test/tests.cxx +++ b/sdext/source/pdfimport/test/tests.cxx @@ -236,7 +236,7 @@ namespace const char* sExportString = "m53570 7650-35430 24100"; CPPUNIT_ASSERT_MESSAGE( "Stroke is m535.7 518.5-354.3-241", - basegfx::tools::exportToSvgD( aPath, true, true, false ).compareToAscii(sExportString) == 0 ); + basegfx::tools::exportToSvgD( aPath, true, true, false ).equalsAscii(sExportString) ); m_bGreenStrokeSeen = true; } @@ -259,7 +259,7 @@ namespace const char* sExportString = "m49890 5670.00000000001-35430 24090"; CPPUNIT_ASSERT_MESSAGE( "Stroke is m49890 5670.00000000001-35430 24090", - basegfx::tools::exportToSvgD( aPath, true, true, false ).compareToAscii(sExportString) == 0 ); + basegfx::tools::exportToSvgD( aPath, true, true, false ).equalsAscii(sExportString) ); m_bDashedLineSeen = true; } @@ -317,7 +317,7 @@ namespace const char* sExportString = "m12050 49610c-4310 0-7800-3490-7800-7800 0-4300 " "3490-7790 7800-7790 4300 0 7790 3490 7790 7790 0 4310-3490 7800-7790 7800z"; CPPUNIT_ASSERT_MESSAGE( "Stroke is a 4-bezier circle", - basegfx::tools::exportToSvgD( aPath, true, true, false ).compareToAscii(sExportString) == 0 ); + basegfx::tools::exportToSvgD( aPath, true, true, false ).equalsAscii(sExportString) ); m_bRedCircleSeen = true; } @@ -362,9 +362,9 @@ namespace CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMask received two properties", xBitmap.getLength(), (sal_Int32) 3 ); CPPUNIT_ASSERT_MESSAGE( "drawMask got URL param", - xBitmap[0].Name.compareToAscii( "URL" ) == 0 ); + xBitmap[0].Name.equalsAscii( "URL" ) ); CPPUNIT_ASSERT_MESSAGE( "drawMask got InputStream param", - xBitmap[1].Name.compareToAscii( "InputStream" ) == 0 ); + xBitmap[1].Name.equalsAscii( "InputStream" ) ); } virtual void drawImage(const uno::Sequence& xBitmap ) @@ -372,9 +372,9 @@ namespace CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawImage received two properties", xBitmap.getLength(), (sal_Int32) 3 ); CPPUNIT_ASSERT_MESSAGE( "drawImage got URL param", - xBitmap[0].Name.compareToAscii( "URL" ) == 0 ); + xBitmap[0].Name.equalsAscii( "URL" ) ); CPPUNIT_ASSERT_MESSAGE( "drawImage got InputStream param", - xBitmap[1].Name.compareToAscii( "InputStream" ) == 0 ); + xBitmap[1].Name.equalsAscii( "InputStream" ) ); m_bImageSeen = true; } @@ -384,9 +384,9 @@ namespace CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawColorMaskedImage received two properties", xBitmap.getLength(), (sal_Int32) 3 ); CPPUNIT_ASSERT_MESSAGE( "drawColorMaskedImage got URL param", - xBitmap[0].Name.compareToAscii( "URL" ) == 0 ); + xBitmap[0].Name.equalsAscii( "URL" ) ); CPPUNIT_ASSERT_MESSAGE( "drawColorMaskedImage got InputStream param", - xBitmap[1].Name.compareToAscii( "InputStream" ) == 0 ); + xBitmap[1].Name.equalsAscii( "InputStream" ) ); } virtual void drawMaskedImage(const uno::Sequence& xBitmap, @@ -396,16 +396,16 @@ namespace CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMaskedImage received two properties #1", xBitmap.getLength(), (sal_Int32) 3 ); CPPUNIT_ASSERT_MESSAGE( "drawMaskedImage got URL param #1", - xBitmap[0].Name.compareToAscii( "URL" ) == 0 ); + xBitmap[0].Name.equalsAscii( "URL" ) ); CPPUNIT_ASSERT_MESSAGE( "drawMaskedImage got InputStream param #1", - xBitmap[1].Name.compareToAscii( "InputStream" ) == 0 ); + xBitmap[1].Name.equalsAscii( "InputStream" ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMaskedImage received two properties #2", xMask.getLength(), (sal_Int32) 3 ); CPPUNIT_ASSERT_MESSAGE( "drawMaskedImage got URL param #2", - xMask[0].Name.compareToAscii( "URL" ) == 0 ); + xMask[0].Name.equalsAscii( "URL" ) ); CPPUNIT_ASSERT_MESSAGE( "drawMaskedImage got InputStream param #2", - xMask[1].Name.compareToAscii( "InputStream" ) == 0 ); + xMask[1].Name.equalsAscii( "InputStream" ) ); } virtual void drawAlphaMaskedImage(const uno::Sequence& xBitmap, @@ -414,16 +414,16 @@ namespace CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawAlphaMaskedImage received two properties #1", xBitmap.getLength(), (sal_Int32) 3 ); CPPUNIT_ASSERT_MESSAGE( "drawAlphaMaskedImage got URL param #1", - xBitmap[0].Name.compareToAscii( "URL" ) == 0 ); + xBitmap[0].Name.equalsAscii( "URL" ) ); CPPUNIT_ASSERT_MESSAGE( "drawAlphaMaskedImage got InputStream param #1", - xBitmap[1].Name.compareToAscii( "InputStream" ) == 0 ); + xBitmap[1].Name.equalsAscii( "InputStream" ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawAlphaMaskedImage received two properties #2", xMask.getLength(), (sal_Int32) 3 ); CPPUNIT_ASSERT_MESSAGE( "drawAlphaMaskedImage got URL param #2", - xMask[0].Name.compareToAscii( "URL" ) == 0 ); + xMask[0].Name.equalsAscii( "URL" ) ); CPPUNIT_ASSERT_MESSAGE( "drawAlphaMaskedImage got InputStream param #2", - xMask[1].Name.compareToAscii( "InputStream" ) == 0 ); + xMask[1].Name.equalsAscii( "InputStream" ) ); } virtual void setTextRenderMode( sal_Int32 ) diff --git a/sdext/source/presenter/PresenterPaneFactory.cxx b/sdext/source/presenter/PresenterPaneFactory.cxx index 958bc363e1ab..99615eb55d4c 100644 --- a/sdext/source/presenter/PresenterPaneFactory.cxx +++ b/sdext/source/presenter/PresenterPaneFactory.cxx @@ -243,7 +243,7 @@ Reference PresenterPaneFactory::CreatePane ( rxPaneId, rsTitle, xParentPane, - rxPaneId->getFullResourceURL().Arguments.compareToAscii("Sprite=1") == 0); + rxPaneId->getFullResourceURL().Arguments.equalsAscii("Sprite=1") ); } catch (Exception&) { diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 2576b14f8cfd..496e6b961d56 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -283,7 +283,7 @@ SfxStatusDispatcher::SfxStatusDispatcher() void SAL_CALL SfxStatusDispatcher::addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & aListener, const ::com::sun::star::util::URL& aURL) throw ( ::com::sun::star::uno::RuntimeException ) { aListeners.addInterface( aURL.Complete, aListener ); - if ( aURL.Complete.compareToAscii(".uno:LifeTime")==0 ) + if ( aURL.Complete.equalsAscii(".uno:LifeTime") ) { ::com::sun::star::frame::FeatureStateEvent aEvent; aEvent.FeatureURL = aURL; diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 654a7e3e8f17..0d8e17e34d53 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -2450,9 +2450,9 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList, if ( rUITitle.isEmpty() ) { // reserved FS names that should not be used - if ( rTitle.compareToAscii( "wizard" ) == 0 ) + if ( rTitle.equalsAscii( "wizard" ) ) return; - else if ( rTitle.compareToAscii( "internal" ) == 0 ) + else if ( rTitle.equalsAscii( "internal" ) ) return; aTitle = getLongName( rTitle ); @@ -2515,7 +2515,7 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList, OUString aType; OUString aHierURL; - if ( aChildTitle.compareToAscii( "sfx.tlx" ) == 0 || aChildTitle == "groupuinames.xml" ) + if ( aChildTitle.equalsAscii( "sfx.tlx" ) || aChildTitle == "groupuinames.xml" ) continue; sal_Bool bDocHasTitle = sal_False; diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 7be793d69802..40663d663fcb 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -334,7 +334,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > const beans::PropertyValue &rProp = rPrinter.getConstArray()[n]; // Name-Property? - if ( rProp.Name.compareToAscii( "Name" ) == 0 ) + if ( rProp.Name.equalsAscii( "Name" ) ) { OUString aPrinterName; if ( ! ( rProp.Value >>= aPrinterName ) ) @@ -359,7 +359,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > const beans::PropertyValue &rProp = rPrinter.getConstArray()[i]; // PaperOrientation-Property? - if ( rProp.Name.compareToAscii( "PaperOrientation" ) == 0 ) + if ( rProp.Name.equalsAscii( "PaperOrientation" ) ) { view::PaperOrientation eOrient; if ( ( rProp.Value >>= eOrient ) == sal_False ) @@ -377,7 +377,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > } // PaperFormat-Property? - else if ( rProp.Name.compareToAscii( "PaperFormat" ) == 0 ) + else if ( rProp.Name.equalsAscii( "PaperFormat" ) ) { if ( ( rProp.Value >>= nPaperFormat ) == sal_False ) { @@ -394,7 +394,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > } // PaperSize-Property? - else if ( rProp.Name.compareToAscii( "PaperSize" ) == 0 ) + else if ( rProp.Name.equalsAscii( "PaperSize" ) ) { awt::Size aTempSize ; if ( ( rProp.Value >>= aTempSize ) == sal_False ) @@ -408,7 +408,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > } // PrinterTray-Property - else if ( rProp.Name.compareToAscii( "PrinterPaperTray" ) == 0 ) + else if ( rProp.Name.equalsAscii( "PrinterPaperTray" ) ) { OUString aTmp; if ( ( rProp.Value >>= aTmp ) == sal_False ) @@ -617,7 +617,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& const beans::PropertyValue &rProp = rOptions.getConstArray()[n]; // FileName-Property? - if ( rProp.Name.compareToAscii( "FileName" ) == 0 ) + if ( rProp.Name.equalsAscii( "FileName" ) ) { // unpack th URL and check for a valid and well known protocol OUString sTemp; @@ -692,7 +692,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& } // CopyCount-Property - else if ( rProp.Name.compareToAscii( "CopyCount" ) == 0 ) + else if ( rProp.Name.equalsAscii( "CopyCount" ) ) { sal_Int32 nCopies = 0; if ( ( rProp.Value >>= nCopies ) == sal_False ) @@ -704,8 +704,8 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& // Collate-Property // Sort-Property (deprecated) - else if ( rProp.Name.compareToAscii( "Collate" ) == 0 || - ( rProp.Name.compareToAscii( "Sort" ) == 0 ) ) + else if ( rProp.Name.equalsAscii( "Collate" ) || + rProp.Name.equalsAscii( "Sort" ) ) { sal_Bool bTemp = sal_Bool(); if ( rProp.Value >>= bTemp ) @@ -718,7 +718,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& } // Pages-Property - else if ( rProp.Name.compareToAscii( "Pages" ) == 0 ) + else if ( rProp.Name.equalsAscii( "Pages" ) ) { OUString sTemp; if( rProp.Value >>= sTemp ) @@ -731,7 +731,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& } // MonitorVisible - else if ( rProp.Name.compareToAscii( "MonitorVisible" ) == 0 ) + else if ( rProp.Name.equalsAscii( "MonitorVisible" ) ) { if( !(rProp.Value >>= bMonitor) ) throw ::com::sun::star::lang::IllegalArgumentException(); @@ -740,7 +740,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& } // Wait - else if ( rProp.Name.compareToAscii( "Wait" ) == 0 ) + else if ( rProp.Name.equalsAscii( "Wait" ) ) { if ( !(rProp.Value >>= bWaitUntilEnd) ) throw ::com::sun::star::lang::IllegalArgumentException(); @@ -748,7 +748,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& aCheckedArgs[nProps++].Value <<= bWaitUntilEnd; } - else if ( rProp.Name.compareToAscii( "DuplexMode" ) == 0 ) + else if ( rProp.Name.equalsAscii( "DuplexMode" ) ) { if ( !(rProp.Value >>= nDuplexMode ) ) throw ::com::sun::star::lang::IllegalArgumentException(); diff --git a/store/workben/t_store.cxx b/store/workben/t_store.cxx index e1c1a1c4a1fd..9009100814e4 100644 --- a/store/workben/t_store.cxx +++ b/store/workben/t_store.cxx @@ -187,7 +187,7 @@ sal_Bool DirectoryTraveller::visit (const iter& it) if (it.m_nAttrib & STORE_ATTRIB_ISDIR) { OUString aName (it.m_pszName, it.m_nLength); - if (aName.compareToAscii ("XTextViewCursorSupplier") == 0) + if (aName.equalsAscii("XTextViewCursorSupplier")) { m_nCount += 1 - 1; } diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx index 8a42548912e7..2cb491be78e4 100644 --- a/svl/source/fsstor/fsfactory.cxx +++ b/svl/source/fsstor/fsfactory.cxx @@ -189,7 +189,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL fsstorage_component_getFactory ( if (pServiceManager) { uno::Reference< lang::XSingleServiceFactory > xFactory; - if (FSStorageFactory::impl_staticGetImplementationName().compareToAscii (pImplementationName) == 0) + if (FSStorageFactory::impl_staticGetImplementationName().equalsAscii(pImplementationName)) { xFactory = cppu::createOneInstanceFactory ( reinterpret_cast< lang::XMultiServiceFactory* >(pServiceManager), diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index 317abfa7fa17..daa5bfbe3c45 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -384,7 +384,7 @@ OUString SAL_CALL SvNumberFormatterServiceObj::getImplementationName() sal_Bool SAL_CALL SvNumberFormatterServiceObj::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException) { - return ( ServiceName.compareToAscii(SERVICENAME_NUMBERFORMATTER) == 0 ); + return ServiceName.equalsAscii(SERVICENAME_NUMBERFORMATTER); } uno::Sequence SAL_CALL SvNumberFormatterServiceObj::getSupportedServiceNames() @@ -676,7 +676,7 @@ OUString SAL_CALL SvNumberFormatsObj::getImplementationName() sal_Bool SAL_CALL SvNumberFormatsObj::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException) { - return ( ServiceName.compareToAscii(SERVICENAME_NUMBERFORMATS) == 0 ); + return ServiceName.equalsAscii(SERVICENAME_NUMBERFORMATS); } uno::Sequence SAL_CALL SvNumberFormatsObj::getSupportedServiceNames() @@ -933,7 +933,7 @@ OUString SAL_CALL SvNumberFormatObj::getImplementationName() sal_Bool SAL_CALL SvNumberFormatObj::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException) { - return ( ServiceName.compareToAscii(SERVICENAME_NUMBERFORMAT) == 0 ); + return ServiceName.equalsAscii(SERVICENAME_NUMBERFORMAT); } uno::Sequence SAL_CALL SvNumberFormatObj::getSupportedServiceNames() @@ -1092,7 +1092,7 @@ OUString SAL_CALL SvNumberFormatSettingsObj::getImplementationName() sal_Bool SAL_CALL SvNumberFormatSettingsObj::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException) { - return ( ServiceName.compareToAscii(SERVICENAME_NUMBERSETTINGS) == 0 ); + return ServiceName.equalsAscii(SERVICENAME_NUMBERSETTINGS); } uno::Sequence SAL_CALL SvNumberFormatSettingsObj::getSupportedServiceNames() diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 293ad9fb347c..8d47e2b27079 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -1368,7 +1368,7 @@ OUString SAL_CALL PasswordContainer::getImplementationName( ) throw(uno::Runtim sal_Bool SAL_CALL PasswordContainer::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException) { - if ( ServiceName.compareToAscii("com.sun.star.task.PasswordContainer") == 0 ) + if ( ServiceName.equalsAscii("com.sun.star.task.PasswordContainer") ) return sal_True; else return sal_False; @@ -1461,7 +1461,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL passwordcontainer_component_getFactory ( if (pServiceManager) { Reference< XSingleServiceFactory > xFactory; - if (PasswordContainer::impl_getStaticImplementationName().compareToAscii (pImplementationName) == 0) + if (PasswordContainer::impl_getStaticImplementationName().equalsAscii(pImplementationName)) { xFactory = PasswordContainer::impl_createFactory ( reinterpret_cast< XMultiServiceFactory* >(pServiceManager)); diff --git a/svl/source/uno/pathservice.cxx b/svl/source/uno/pathservice.cxx index 07b57a1257b5..f20611f6e0b6 100644 --- a/svl/source/uno/pathservice.cxx +++ b/svl/source/uno/pathservice.cxx @@ -46,7 +46,7 @@ public: const OUString & rName) throw(css::uno::RuntimeException) { - return (rName.compareToAscii("com.sun.star.config.SpecialConfigManager") == 0); + return rName.equalsAscii("com.sun.star.config.SpecialConfigManager"); } virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx index b4bb86298104..7071fd408016 100644 --- a/svtools/source/hatchwindow/hatchwindowfactory.cxx +++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx @@ -95,7 +95,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL hatchwindowfactory_component_getFactory ( if (pServiceManager) { uno::Reference< lang::XSingleServiceFactory > xFactory; - if (OHatchWindowFactory::impl_staticGetImplementationName().compareToAscii (pImplementationName ) == 0) + if (OHatchWindowFactory::impl_staticGetImplementationName().equalsAscii(pImplementationName )) { xFactory = cppu::createOneInstanceFactory( reinterpret_cast< lang::XMultiServiceFactory* >(pServiceManager), @@ -103,7 +103,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL hatchwindowfactory_component_getFactory ( OHatchWindowFactory::impl_staticCreateSelfInstance, OHatchWindowFactory::impl_staticGetSupportedServiceNames()); } - else if (ODocumentCloser::impl_staticGetImplementationName().compareToAscii (pImplementationName ) == 0) + else if (ODocumentCloser::impl_staticGetImplementationName().equalsAscii(pImplementationName )) { xFactory = cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index e40280350f3c..2d9086121986 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -236,15 +236,15 @@ uno::Any SAL_CALL SwXStyleFamilies::getByName(const OUString& Name) uno::Any aRet; if(!IsValid()) throw uno::RuntimeException(); - if(Name.compareToAscii("CharacterStyles") == 0 ) + if(Name.equalsAscii("CharacterStyles") ) aRet = getByIndex(0); - else if(Name.compareToAscii("ParagraphStyles") == 0) + else if(Name.equalsAscii("ParagraphStyles") ) aRet = getByIndex(1); - else if(Name.compareToAscii("FrameStyles") == 0 ) + else if(Name.equalsAscii("FrameStyles") ) aRet = getByIndex(3); - else if(Name.compareToAscii("PageStyles") == 0 ) + else if(Name.equalsAscii("PageStyles") ) aRet = getByIndex(2); - else if(Name.compareToAscii("NumberingStyles") == 0 ) + else if(Name.equalsAscii("NumberingStyles") ) aRet = getByIndex(4); else throw container::NoSuchElementException(); @@ -265,11 +265,11 @@ uno::Sequence< OUString > SwXStyleFamilies::getElementNames(void) throw( uno::Ru sal_Bool SwXStyleFamilies::hasByName(const OUString& Name) throw( uno::RuntimeException ) { - if( Name.compareToAscii("CharacterStyles") == 0 || - Name.compareToAscii("ParagraphStyles") == 0 || - Name.compareToAscii("FrameStyles") == 0 || - Name.compareToAscii("PageStyles") == 0 || - Name.compareToAscii("NumberingStyles") == 0 ) + if( Name.equalsAscii("CharacterStyles") || + Name.equalsAscii("ParagraphStyles") || + Name.equalsAscii("FrameStyles") || + Name.equalsAscii("PageStyles") || + Name.equalsAscii("NumberingStyles") ) return sal_True; else return sal_False; @@ -3611,11 +3611,11 @@ uno::Any SwXAutoStyles::getByName(const OUString& Name) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) { uno::Any aRet; - if(Name.compareToAscii("CharacterStyles") == 0 ) + if(Name.equalsAscii("CharacterStyles") ) aRet = getByIndex(0); - else if(Name.compareToAscii("RubyStyles") == 0 ) + else if(Name.equalsAscii("RubyStyles") ) aRet = getByIndex(1); - else if(Name.compareToAscii("ParagraphStyles") == 0 ) + else if(Name.equalsAscii("ParagraphStyles") ) aRet = getByIndex(2); else throw container::NoSuchElementException(); @@ -3636,9 +3636,9 @@ uno::Sequence< OUString > SwXAutoStyles::getElementNames(void) sal_Bool SwXAutoStyles::hasByName(const OUString& Name) throw( uno::RuntimeException ) { - if( Name.compareToAscii("CharacterStyles") == 0 || - Name.compareToAscii("RubyStyles") == 0 || - Name.compareToAscii("ParagraphStyles") == 0 ) + if( Name.equalsAscii("CharacterStyles") || + Name.equalsAscii("RubyStyles") || + Name.equalsAscii("ParagraphStyles") ) return sal_True; else return sal_False; diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index 6c6495834cd9..d90d97cd3599 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -1248,7 +1248,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, if( i < nValCnt ) { const OUString& rVal = pValues[i]; - if( rVal.compareToAscii( "$$$empty$$$" ) == 0 ) + if( rVal.equalsAscii( "$$$empty$$$" ) ) bEmptyVal = sal_True; else sVal = rVal; diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index fcf1246eb57b..ea08ec5cd695 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -1756,7 +1756,7 @@ Sequence< OUString > SwXTextDocument::getAvailableServiceNames(void) OUString* pRet = aRet.getArray(); for ( sal_Int32 i = 0; i < aRet.getLength(); ++i ) { - if ( pRet[i].compareToAscii( "com.sun.star.drawing.OLE2Shape" ) == 0 ) + if ( pRet[i].equalsAscii( "com.sun.star.drawing.OLE2Shape" ) ) { pRet[i] = pRet[aRet.getLength() - 1]; aRet.realloc( aRet.getLength() - 1 ); // no longer valid. diff --git a/testtools/source/performance/ubtest.cxx b/testtools/source/performance/ubtest.cxx index f08a0f92d909..96b895ce82fe 100644 --- a/testtools/source/performance/ubtest.cxx +++ b/testtools/source/performance/ubtest.cxx @@ -978,11 +978,11 @@ sal_Int32 TestImpl::run( const Sequence< OUString > & rArgs ) OUString aLogStr( extractParam( rArgs, OUString("log") ) ); if (aLogStr.getLength()) { - if (aLogStr.compareToAscii( "stderr" ) == 0) + if (aLogStr.equalsAscii( "stderr" ) ) { stream = stderr; } - else if (aLogStr.compareToAscii( "stdout" ) == 0) + else if (aLogStr.equalsAscii( "stdout" ) ) { stream = stdout; } diff --git a/tools/qa/cppunit/test_urlobj.cxx b/tools/qa/cppunit/test_urlobj.cxx index 6b0b3133bd34..823f024772aa 100644 --- a/tools/qa/cppunit/test_urlobj.cxx +++ b/tools/qa/cppunit/test_urlobj.cxx @@ -58,28 +58,24 @@ namespace tools_urlobj INetURLObject aUrl( OUString( "file://10.10.1.1/sampledir/sample.file" ) ); #ifdef LINUX CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). - compareToAscii - ( "smb://10.10.1.1/sampledir/sample.file" ) == - 0 ); + equalsAscii + ( "smb://10.10.1.1/sampledir/sample.file" ) ); CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_SMB ); #endif #ifdef WIN CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). - compareToAscii - ( "file://10.10.1.1/sampledir/sample.file" ) == - 0 ); + equalsAscii + ( "file://10.10.1.1/sampledir/sample.file" ) ); CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE ); #endif CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ). - compareToAscii( "10.10.1.1" ) == 0 ); + equalsAscii( "10.10.1.1" ) ); CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE ). - compareToAscii( "/sampledir/sample.file" ) == 0 ); + equalsAscii( "/sampledir/sample.file" ) ); CPPUNIT_ASSERT( aUrl.getName( ). - compareToAscii( "sample.file" ) == 0 ); - CPPUNIT_ASSERT( aUrl.getBase( ).compareToAscii( "sample" ) == - 0 ); - CPPUNIT_ASSERT( aUrl.getExtension( ).compareToAscii( "file" ) == - 0 ); + equalsAscii( "sample.file" ) ); + CPPUNIT_ASSERT( aUrl.getBase( ).equalsAscii( "sample" ) ); + CPPUNIT_ASSERT( aUrl.getExtension( ).equalsAscii( "file" ) ); } void urlobjTest_002( ) @@ -90,26 +86,22 @@ namespace tools_urlobj INetURLObject::FSYS_DETECT ); #ifdef LINUX CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). - compareToAscii - ( "smb://137.65.170.24/c$/Img0001.jpg" ) == 0 ); + equalsAscii( "smb://137.65.170.24/c$/Img0001.jpg" ) ); CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_SMB ); #endif #ifdef WIN CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). - compareToAscii - ( "file://137.65.170.24/c$/Img0001.jpg" ) == 0 ); + equalsAscii( "file://137.65.170.24/c$/Img0001.jpg" ) ; CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE ); #endif CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ). - compareToAscii( "137.65.170.24" ) == 0 ); + equalsAscii( "137.65.170.24" ) ); CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE ). - compareToAscii( "/c$/Img0001.jpg" ) == 0 ); + equalsAscii( "/c$/Img0001.jpg" ) ); CPPUNIT_ASSERT( aUrl.getName( ). - compareToAscii( "Img0001.jpg" ) == 0 ); - CPPUNIT_ASSERT( aUrl.getBase( ).compareToAscii( "Img0001" ) == - 0 ); - CPPUNIT_ASSERT( aUrl.getExtension( ).compareToAscii( "jpg" ) == - 0 ); + equalsAscii( "Img0001.jpg" ) ); + CPPUNIT_ASSERT( aUrl.getBase( ).equalsAscii( "Img0001" ) ); + CPPUNIT_ASSERT( aUrl.getExtension( ).equalsAscii( "jpg" ) ); } @@ -121,22 +113,18 @@ namespace tools_urlobj INetURLObject::FSYS_DETECT ); #ifdef LINUX CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). - compareToAscii - ( "smb://hive-winxp-x86/pmladek/test2.odt" ) == - 0 ); + equalsAscii( "smb://hive-winxp-x86/pmladek/test2.odt" ) ); CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_SMB ); #endif #ifdef WIN CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). - compareToAscii - ( "file://hive-winxp-x86/pmladek/test2.odt" ) == - 0 ); + equalsAscii( "file://hive-winxp-x86/pmladek/test2.odt" ) ); CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE ); #endif CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ). - compareToAscii( "hive-winxp-x86" ) == 0 ); + equalsAscii( "hive-winxp-x86" ) ); CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE ). - compareToAscii( "/pmladek/test2.odt" ) == 0 ); + equalsAscii( "/pmladek/test2.odt" ) ); } void urlobjTest_004( ) @@ -144,28 +132,22 @@ namespace tools_urlobj INetURLObject aUrl( OUString( "smb://10.10.1.1/sampledir/sample.file" ) ); #ifdef LINUX CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). - compareToAscii - ( "smb://10.10.1.1/sampledir/sample.file" ) == - 0 ); + equalsAscii( "smb://10.10.1.1/sampledir/sample.file" ) ); CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_SMB ); #endif #ifdef WIN CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). - compareToAscii - ( "file://10.10.1.1/sampledir/sample.file" ) == - 0 ); + equalsAscii( "file://10.10.1.1/sampledir/sample.file" ) ); CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE ); #endif CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ). - compareToAscii( "10.10.1.1" ) == 0 ); + equalsAscii( "10.10.1.1" ) ); CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE ). - compareToAscii( "/sampledir/sample.file" ) == 0 ); + equalsAscii( "/sampledir/sample.file" ) ); CPPUNIT_ASSERT( aUrl.getName( ). - compareToAscii( "sample.file" ) == 0 ); - CPPUNIT_ASSERT( aUrl.getBase( ).compareToAscii( "sample" ) == - 0 ); - CPPUNIT_ASSERT( aUrl.getExtension( ).compareToAscii( "file" ) == - 0 ); + equalsAscii( "sample.file" ) ); + CPPUNIT_ASSERT( aUrl.getBase( ).equalsAscii( "sample" ) ); + CPPUNIT_ASSERT( aUrl.getExtension( ).equalsAscii( "file" ) ); } void urlobjTest_005( ) @@ -175,21 +157,21 @@ namespace tools_urlobj INetURLObject::FSYS_DETECT ); #ifdef LINUX CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). - compareToAscii( "smb://137.65.170.24/c$/Img0001.jpg" ) == 0 ); + equalsAscii( "smb://137.65.170.24/c$/Img0001.jpg" ) ); CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_SMB ); #endif #ifdef WIN CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). - compareToAscii( "file://137.65.170.24/c$/Img0001.jpg" ) == 0 ); + equalsAscii( "file://137.65.170.24/c$/Img0001.jpg" ) ); CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE ); #endif CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ). - compareToAscii( "137.65.170.24" ) == 0 ); + equalsAscii( "137.65.170.24" ) ); CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE ). - compareToAscii( "/c$/Img0001.jpg" ) == 0 ); - CPPUNIT_ASSERT( aUrl.getName( ).compareToAscii( "Img0001.jpg" ) == 0 ); - CPPUNIT_ASSERT( aUrl.getBase( ).compareToAscii( "Img0001" ) == 0 ); - CPPUNIT_ASSERT( aUrl.getExtension( ).compareToAscii( "jpg" ) == 0 ); + equalsAscii( "/c$/Img0001.jpg" ) ); + CPPUNIT_ASSERT( aUrl.getName( ).equalsAscii( "Img0001.jpg" ) ); + CPPUNIT_ASSERT( aUrl.getBase( ).equalsAscii( "Img0001" ) ); + CPPUNIT_ASSERT( aUrl.getExtension( ).equalsAscii( "jpg" ) ); } @@ -200,18 +182,18 @@ namespace tools_urlobj INetURLObject::FSYS_DETECT ); #ifdef LINUX CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). - compareToAscii( "smb://hive-winxp-x86/pmladek/test2.odt" ) == 0 ); + equalsAscii( "smb://hive-winxp-x86/pmladek/test2.odt" ) ); CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_SMB ); #endif #ifdef WIN CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). - compareToAscii( "file://hive-winxp-x86/pmladek/test2.odt" ) == 0 ); + equalsAscii( "file://hive-winxp-x86/pmladek/test2.odt" ) ); CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE ); #endif CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ). - compareToAscii( "hive-winxp-x86" ) == 0 ); + equalsAscii( "hive-winxp-x86" ) ); CPPUNIT_ASSERT( aUrl.GetURLPath( INetURLObject::NO_DECODE ). - compareToAscii( "/pmladek/test2.odt" ) == 0 ); + equalsAscii( "/pmladek/test2.odt" ) ); } void urlobjCmisTest( ) diff --git a/ucb/source/cacher/cacheserv.cxx b/ucb/source/cacher/cacheserv.cxx index 3fc37fdb0fa8..e8b129adde1b 100644 --- a/ucb/source/cacher/cacheserv.cxx +++ b/ucb/source/cacher/cacheserv.cxx @@ -45,7 +45,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL cached1_component_getFactory( ////////////////////////////////////////////////////////////////////// if ( CachedContentResultSetFactory::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = CachedContentResultSetFactory::createServiceFactory( xSMgr ); } @@ -55,7 +55,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL cached1_component_getFactory( ////////////////////////////////////////////////////////////////////// else if ( CachedContentResultSetStubFactory::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = CachedContentResultSetStubFactory::createServiceFactory( xSMgr ); } @@ -65,7 +65,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL cached1_component_getFactory( ////////////////////////////////////////////////////////////////////// else if ( CachedDynamicResultSetFactory::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = CachedDynamicResultSetFactory::createServiceFactory( xSMgr ); } @@ -75,7 +75,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL cached1_component_getFactory( ////////////////////////////////////////////////////////////////////// else if ( CachedDynamicResultSetStubFactory::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = CachedDynamicResultSetStubFactory::createServiceFactory( xSMgr ); } diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx index 75f03f78200a..b2612e35a67a 100644 --- a/ucb/source/core/ucbcmds.cxx +++ b/ucb/source/core/ucbcmds.cxx @@ -829,7 +829,7 @@ void transferProperties( uno::Any aValue; - if ( rCurrProp.Name.compareToAscii( "Title" ) == 0 ) + if ( rCurrProp.Name.equalsAscii( "Title" ) ) { // Supply new title, if given. if ( !bHasTitle ) @@ -838,7 +838,7 @@ void transferProperties( aValue <<= rContext.aArg.NewTitle; } } - else if ( rCurrProp.Name.compareToAscii( "TargetURL" ) == 0 ) + else if ( rCurrProp.Name.equalsAscii( "TargetURL" ) ) { // Supply source URL as link target for the new link to create. if ( !bHasTargetURL ) diff --git a/ucb/source/core/ucbserv.cxx b/ucb/source/core/ucbserv.cxx index 1a1745180d67..59233c28d7ef 100644 --- a/ucb/source/core/ucbserv.cxx +++ b/ucb/source/core/ucbserv.cxx @@ -44,7 +44,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucb_component_getFactory( ////////////////////////////////////////////////////////////////////// if ( UniversalContentBroker::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = UniversalContentBroker::createServiceFactory( xSMgr ); } @@ -54,7 +54,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucb_component_getFactory( ////////////////////////////////////////////////////////////////////// else if ( UcbStore::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = UcbStore::createServiceFactory( xSMgr ); } @@ -64,7 +64,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucb_component_getFactory( ////////////////////////////////////////////////////////////////////// else if ( UcbPropertiesManager::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = UcbPropertiesManager::createServiceFactory( xSMgr ); } @@ -74,7 +74,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucb_component_getFactory( ////////////////////////////////////////////////////////////////////// else if ( UcbContentProviderProxyFactory::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = UcbContentProviderProxyFactory::createServiceFactory( xSMgr ); } @@ -84,7 +84,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucb_component_getFactory( ////////////////////////////////////////////////////////////////////// else if ( ucb_cmdenv::UcbCommandEnvironment::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = ucb_cmdenv::UcbCommandEnvironment::createServiceFactory( xSMgr ); } diff --git a/ucb/source/sorter/sortmain.cxx b/ucb/source/sorter/sortmain.cxx index beeb485b4dd7..8def7d7528e0 100644 --- a/ucb/source/sorter/sortmain.cxx +++ b/ucb/source/sorter/sortmain.cxx @@ -40,7 +40,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL srtrs1_component_getFactory( ////////////////////////////////////////////////////////////////////// if ( SortedDynamicResultSetFactory::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = SortedDynamicResultSetFactory::createServiceFactory( xSMgr ); } diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx index cb07ef278738..25a94d83147d 100644 --- a/ucb/source/sorter/sortresult.cxx +++ b/ucb/source/sorter/sortresult.cxx @@ -902,8 +902,8 @@ void SAL_CALL SortedResultSet::setPropertyValue( { osl::Guard< osl::Mutex > aGuard( maMutex ); - if ( ( PropertyName.compareToAscii( "RowCount" ) == 0 ) || - ( PropertyName.compareToAscii( "IsRowCountFinal" ) == 0 ) ) + if ( PropertyName.equalsAscii( "RowCount" ) || + PropertyName.equalsAscii( "IsRowCountFinal" ) ) throw IllegalArgumentException(); else throw UnknownPropertyException(); @@ -919,11 +919,11 @@ Any SAL_CALL SortedResultSet::getPropertyValue( const OUString& PropertyName ) Any aRet; - if ( PropertyName.compareToAscii( "RowCount" ) == 0 ) + if ( PropertyName.equalsAscii( "RowCount" ) ) { aRet <<= maS2O.Count(); } - else if ( PropertyName.compareToAscii( "IsRowCountFinal" ) == 0 ) + else if ( PropertyName.equalsAscii( "IsRowCountFinal" ) ) { sal_Bool bOrgFinal = false; Any aOrgRet; @@ -2043,9 +2043,9 @@ Property SAL_CALL SRSPropertySetInfo::getPropertyByName( const OUString& Name ) throw( UnknownPropertyException, RuntimeException ) { - if ( Name.compareToAscii( "RowCount" ) == 0 ) + if ( Name.equalsAscii( "RowCount" ) ) return maProps[0]; - else if ( Name.compareToAscii( "IsRowCountFinal" ) == 0 ) + else if ( Name.equalsAscii( "IsRowCountFinal" ) ) return maProps[1]; else throw UnknownPropertyException(); @@ -2056,9 +2056,9 @@ sal_Bool SAL_CALL SRSPropertySetInfo::hasPropertyByName( const OUString& Name ) throw( RuntimeException ) { - if ( Name.compareToAscii( "RowCount" ) == 0 ) + if ( Name.equalsAscii( "RowCount" ) ) return sal_True; - else if ( Name.compareToAscii( "IsRowCountFinal" ) == 0 ) + else if ( Name.equalsAscii( "IsRowCountFinal" ) ) return sal_True; else return sal_False; diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx index ee8a19fca8fc..83ad168f67b3 100644 --- a/ucb/source/ucp/file/prov.cxx +++ b/ucb/source/ucp/file/prov.cxx @@ -55,7 +55,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucpfile_component_getFactory( ////////////////////////////////////////////////////////////////////// if ( fileaccess::shell::getImplementationName_static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = FileProvider::createServiceFactory( xSMgr ); } @@ -153,7 +153,7 @@ FileProvider::initialize( OUString config; if( aArguments.getLength() > 0 && (aArguments[0] >>= config) && - config.compareToAscii("NoConfig") == 0 ) + config.equalsAscii("NoConfig") ) m_pMyShell = new shell( m_xContext, this, sal_False ); else m_pMyShell = new shell( m_xContext, this, sal_True ); @@ -536,9 +536,9 @@ FileProvider::setPropertyValue( const OUString& aPropertyName, WrappedTargetException, RuntimeException ) { - if( aPropertyName.compareToAscii( "FileSystemNotation" ) == 0 || - aPropertyName.compareToAscii( "HomeDirectory" ) == 0 || - aPropertyName.compareToAscii( "HostName" ) == 0 ) + if( aPropertyName.equalsAscii( "FileSystemNotation" ) || + aPropertyName.equalsAscii( "HomeDirectory" ) || + aPropertyName.equalsAscii( "HostName" ) ) return; else throw UnknownPropertyException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() ); @@ -554,19 +554,19 @@ FileProvider::getPropertyValue( RuntimeException ) { initProperties(); - if( aPropertyName.compareToAscii( "FileSystemNotation" ) == 0 ) + if( aPropertyName.equalsAscii( "FileSystemNotation" ) ) { Any aAny; aAny <<= m_FileSystemNotation; return aAny; } - else if( aPropertyName.compareToAscii( "HomeDirectory" ) == 0 ) + else if( aPropertyName.equalsAscii( "HomeDirectory" ) ) { Any aAny; aAny <<= m_HomeDirectory; return aAny; } - else if( aPropertyName.compareToAscii( "HostName" ) == 0 ) + else if( aPropertyName.equalsAscii( "HostName" ) ) { Any aAny; aAny <<= m_HostName; diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx index e98e0f831551..4f456d18799d 100644 --- a/ucb/source/ucp/ftp/ftpcontent.cxx +++ b/ucb/source/ucp/ftp/ftpcontent.cxx @@ -331,8 +331,8 @@ Any SAL_CALL FTPContent::execute( aRet = p->getRequest(); } -// if(aCommand.Name.compareToAscii( -// "getPropertyValues") == 0 && +// if(aCommand.Name.equalsAscii( +// "getPropertyValues") && // action != NOACTION) { // // It is not allowed to throw if // // command is getPropertyValues @@ -416,7 +416,7 @@ Any SAL_CALL FTPContent::execute( break; } - if(aCommand.Name.compareToAscii("getPropertyValues") == 0) { + if(aCommand.Name.equalsAscii("getPropertyValues")) { Sequence Properties; if(!(aCommand.Argument >>= Properties)) { @@ -429,7 +429,7 @@ Any SAL_CALL FTPContent::execute( aRet <<= getPropertyValues(Properties,Environment); } - else if(aCommand.Name.compareToAscii("setPropertyValues") == 0) + else if(aCommand.Name.equalsAscii("setPropertyValues") ) { Sequence propertyValues; @@ -443,15 +443,15 @@ Any SAL_CALL FTPContent::execute( aRet <<= setPropertyValues(propertyValues); } - else if(aCommand.Name.compareToAscii("getCommandInfo") == 0) { + else if(aCommand.Name.equalsAscii("getCommandInfo")) { // Note: Implemented by base class. aRet <<= getCommandInfo(Environment); } - else if(aCommand.Name.compareToAscii("getPropertySetInfo") == 0) { + else if(aCommand.Name.equalsAscii("getPropertySetInfo")) { // Note: Implemented by base class. aRet <<= getPropertySetInfo(Environment); } - else if(aCommand.Name.compareToAscii( "insert" ) == 0) + else if(aCommand.Name.equalsAscii( "insert" )) { InsertCommandArgument aInsertArgument; if ( ! ( aCommand.Argument >>= aInsertArgument ) ) { @@ -463,11 +463,11 @@ Any SAL_CALL FTPContent::execute( } insert(aInsertArgument,Environment); } - else if(aCommand.Name.compareToAscii("delete") == 0) { + else if(aCommand.Name.equalsAscii("delete")) { m_aFTPURL.del(); deleted(); } - else if(aCommand.Name.compareToAscii( "open" ) == 0) { + else if(aCommand.Name.equalsAscii( "open" )) { OpenCommandArgument2 aOpenCommand; if ( !( aCommand.Argument >>= aOpenCommand ) ) { aRet <<= IllegalArgumentException( @@ -571,7 +571,7 @@ Any SAL_CALL FTPContent::execute( ucbhelper::cancelCommandExecution(aRet,Environment); } - } else if(aCommand.Name.compareToAscii("createNewContent") == 0) { + } else if(aCommand.Name.equalsAscii("createNewContent")) { ContentInfo aArg; if (!(aCommand.Argument >>= aArg)) { ucbhelper::cancelCommandExecution( @@ -816,35 +816,35 @@ Reference< XRow > FTPContent::getPropertyValues( for(sal_Int32 i = 0; i < seqProp.getLength(); ++i) { const OUString& Name = seqProp[i].Name; - if(Name.compareToAscii("Title") == 0) + if(Name.equalsAscii("Title")) xRow->appendString(seqProp[i],aDirEntry.m_aName); - else if(Name.compareToAscii("CreatableContentsInfo") == 0) + else if(Name.equalsAscii("CreatableContentsInfo")) xRow->appendObject(seqProp[i], makeAny(queryCreatableContentsInfo())); else if(aDirEntry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN) { - if(Name.compareToAscii("ContentType") == 0) + if(Name.equalsAscii("ContentType")) xRow->appendString(seqProp[i], aDirEntry.m_nMode&INETCOREFTP_FILEMODE_ISDIR ? FTP_FOLDER : FTP_FILE ); - else if(Name.compareToAscii("IsReadOnly") == 0) + else if(Name.equalsAscii("IsReadOnly")) xRow->appendBoolean(seqProp[i], aDirEntry.m_nMode & INETCOREFTP_FILEMODE_WRITE ? 0 : 1 ); - else if(Name.compareToAscii("IsDocument") == 0) + else if(Name.equalsAscii("IsDocument")) xRow->appendBoolean(seqProp[i], ! sal_Bool(aDirEntry.m_nMode & INETCOREFTP_FILEMODE_ISDIR)); - else if(Name.compareToAscii("IsFolder") == 0) + else if(Name.equalsAscii("IsFolder")) xRow->appendBoolean(seqProp[i], sal_Bool(aDirEntry.m_nMode & INETCOREFTP_FILEMODE_ISDIR)); - else if(Name.compareToAscii("Size") == 0) + else if(Name.equalsAscii("Size")) xRow->appendLong(seqProp[i], aDirEntry.m_nSize); - else if(Name.compareToAscii("DateCreated") == 0) + else if(Name.equalsAscii("DateCreated")) xRow->appendTimestamp(seqProp[i], aDirEntry.m_aDate); else diff --git a/ucb/source/ucp/ftp/ftpresultsetI.cxx b/ucb/source/ucp/ftp/ftpresultsetI.cxx index 3bac7bb066e4..3412eb0a3f44 100644 --- a/ucb/source/ucp/ftp/ftpresultsetI.cxx +++ b/ucb/source/ucp/ftp/ftpresultsetI.cxx @@ -60,30 +60,30 @@ ResultSetI::ResultSetI(const Reference& rxContext, for( int i = 0; i < seqProp.getLength(); ++i) { const OUString& Name = seqProp[i].Name; - if(Name.compareToAscii("ContentType") == 0 ) + if(Name.equalsAscii("ContentType") ) xRow->appendString(seqProp[i], OUString( "application/ftp" )); - else if(Name.compareToAscii("Title") == 0) + else if(Name.equalsAscii("Title")) xRow->appendString(seqProp[i],dirvec[n].m_aName); - else if(Name.compareToAscii("IsReadOnly") == 0) + else if(Name.equalsAscii("IsReadOnly")) xRow->appendBoolean(seqProp[i], sal_Bool(dirvec[n].m_nMode & INETCOREFTP_FILEMODE_WRITE)); - else if(Name.compareToAscii("IsDocument") == 0) + else if(Name.equalsAscii("IsDocument")) xRow->appendBoolean(seqProp[i], ! sal_Bool(dirvec[n].m_nMode & INETCOREFTP_FILEMODE_ISDIR)); - else if(Name.compareToAscii("IsFolder") == 0) + else if(Name.equalsAscii("IsFolder")) xRow->appendBoolean(seqProp[i], sal_Bool(dirvec[n].m_nMode & INETCOREFTP_FILEMODE_ISDIR)); - else if(Name.compareToAscii("Size") == 0) + else if(Name.equalsAscii("Size")) xRow->appendLong(seqProp[i], dirvec[n].m_nSize); - else if(Name.compareToAscii("DateCreated") == 0) + else if(Name.equalsAscii("DateCreated")) xRow->appendTimestamp(seqProp[i], dirvec[n].m_aDate); - else if(Name.compareToAscii("CreatableContentsInfo") == 0) + else if(Name.equalsAscii("CreatableContentsInfo")) xRow->appendObject( seqProp[i], makeAny(FTPContent::queryCreatableContentsInfo_Static())); diff --git a/ucb/source/ucp/ftp/ftpservices.cxx b/ucb/source/ucp/ftp/ftpservices.cxx index 07b6e445bed0..9f625a624cb9 100644 --- a/ucb/source/ucp/ftp/ftpservices.cxx +++ b/ucb/source/ucp/ftp/ftpservices.cxx @@ -41,7 +41,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucpftp1_component_getFactory( ////////////////////////////////////////////////////////////////////// if ( FTPContentProvider::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = FTPContentProvider::createServiceFactory( xSMgr ); } diff --git a/ucb/source/ucp/hierarchy/hierarchyservices.cxx b/ucb/source/ucp/hierarchy/hierarchyservices.cxx index a121e668b9dd..c6f5194d3ca7 100644 --- a/ucb/source/ucp/hierarchy/hierarchyservices.cxx +++ b/ucb/source/ucp/hierarchy/hierarchyservices.cxx @@ -41,7 +41,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucphier1_component_getFactory( ////////////////////////////////////////////////////////////////////// if ( HierarchyContentProvider::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = HierarchyContentProvider::createServiceFactory( xSMgr ); } @@ -51,7 +51,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucphier1_component_getFactory( ////////////////////////////////////////////////////////////////////// else if ( HierarchyDataSource::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = HierarchyDataSource::createServiceFactory( xSMgr ); } diff --git a/ucb/source/ucp/package/pkgservices.cxx b/ucb/source/ucp/package/pkgservices.cxx index 881a7127009f..e4508a9cb82a 100644 --- a/ucb/source/ucp/package/pkgservices.cxx +++ b/ucb/source/ucp/package/pkgservices.cxx @@ -39,7 +39,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucppkg1_component_getFactory( ////////////////////////////////////////////////////////////////////// if ( ::package_ucp::ContentProvider::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = ::package_ucp::ContentProvider::createServiceFactory( xSMgr ); } diff --git a/ucb/source/ucp/tdoc/tdoc_services.cxx b/ucb/source/ucp/tdoc/tdoc_services.cxx index d4ebd499043e..eade3f75e44a 100644 --- a/ucb/source/ucp/tdoc/tdoc_services.cxx +++ b/ucb/source/ucp/tdoc/tdoc_services.cxx @@ -44,7 +44,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucptdoc1_component_getFactory( ////////////////////////////////////////////////////////////////////// if ( ContentProvider::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = ContentProvider::createServiceFactory( xSMgr ); } @@ -54,7 +54,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucptdoc1_component_getFactory( ////////////////////////////////////////////////////////////////////// else if ( DocumentContentFactory::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = DocumentContentFactory::createServiceFactory( xSMgr ); } diff --git a/ucb/source/ucp/webdav-neon/DateTimeHelper.cxx b/ucb/source/ucp/webdav-neon/DateTimeHelper.cxx index ce99c2db4dea..41adf1a7ceee 100644 --- a/ucb/source/ucp/webdav-neon/DateTimeHelper.cxx +++ b/ucb/source/ucp/webdav-neon/DateTimeHelper.cxx @@ -117,29 +117,29 @@ bool DateTimeHelper::ISO8601_To_DateTime (const OUString& s, sal_Int32 DateTimeHelper::convertMonthToInt (const OUString& month) { - if (month.compareToAscii ("Jan") == 0) + if (month.equalsAscii("Jan")) return 1; - else if (month.compareToAscii ("Feb") == 0) + else if (month.equalsAscii("Feb")) return 2; - else if (month.compareToAscii ("Mar") == 0) + else if (month.equalsAscii("Mar")) return 3; - else if (month.compareToAscii ("Apr") == 0) + else if (month.equalsAscii("Apr")) return 4; - else if (month.compareToAscii ("May") == 0) + else if (month.equalsAscii("May")) return 5; - else if (month.compareToAscii ("Jun") == 0) + else if (month.equalsAscii("Jun")) return 6; - else if (month.compareToAscii ("Jul") == 0) + else if (month.equalsAscii("Jul")) return 7; - else if (month.compareToAscii ("Aug") == 0) + else if (month.equalsAscii("Aug")) return 8; - else if (month.compareToAscii ("Sep") == 0) + else if (month.equalsAscii("Sep")) return 9; - else if (month.compareToAscii ("Oct") == 0) + else if (month.equalsAscii("Oct")) return 10; - else if (month.compareToAscii ("Nov") == 0) + else if (month.equalsAscii("Nov")) return 11; - else if (month.compareToAscii ("Dec") == 0) + else if (month.equalsAscii("Dec")) return 12; else return 0; diff --git a/ucb/source/ucp/webdav-neon/webdavservices.cxx b/ucb/source/ucp/webdav-neon/webdavservices.cxx index c88eb6f241cd..0d9cbdb8f159 100644 --- a/ucb/source/ucp/webdav-neon/webdavservices.cxx +++ b/ucb/source/ucp/webdav-neon/webdavservices.cxx @@ -49,7 +49,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucpdav1_component_getFactory( ////////////////////////////////////////////////////////////////////// if ( ::webdav_ucp::ContentProvider::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = ::webdav_ucp::ContentProvider::createServiceFactory( xSMgr ); } diff --git a/ucb/source/ucp/webdav/DateTimeHelper.cxx b/ucb/source/ucp/webdav/DateTimeHelper.cxx index 7ca9a3d7a61f..860e61063b55 100644 --- a/ucb/source/ucp/webdav/DateTimeHelper.cxx +++ b/ucb/source/ucp/webdav/DateTimeHelper.cxx @@ -108,19 +108,19 @@ bool DateTimeHelper::ISO8601_To_DateTime (const OUString& s, /* sal_Int32 DateTimeHelper::convertDayToInt (const OUString& day) { - if (day.compareToAscii ("Sun") == 0) + if (day.equalsAscii("Sun")) return 0; - else if (day.compareToAscii ("Mon") == 0) + else if (day.equalsAscii("Mon")) return 1; - else if (day.compareToAscii ("Tue") == 0) + else if (day.equalsAscii("Tue")) return 2; - else if (day.compareToAscii ("Wed") == 0) + else if (day.equalsAscii("Wed")) return 3; - else if (day.compareToAscii ("Thu") == 0) + else if (day.equalsAscii("Thu")) return 4; - else if (day.compareToAscii ("Fri") == 0) + else if (day.equalsAscii("Fri")) return 5; - else if (day.compareToAscii ("Sat") == 0) + else if (day.equalsAscii("Sat")) return 6; else return -1; @@ -129,29 +129,29 @@ sal_Int32 DateTimeHelper::convertDayToInt (const OUString& day) sal_Int32 DateTimeHelper::convertMonthToInt (const OUString& month) { - if (month.compareToAscii ("Jan") == 0) + if (month.equalsAscii("Jan")) return 1; - else if (month.compareToAscii ("Feb") == 0) + else if (month.equalsAscii("Feb")) return 2; - else if (month.compareToAscii ("Mar") == 0) + else if (month.equalsAscii("Mar")) return 3; - else if (month.compareToAscii ("Apr") == 0) + else if (month.equalsAscii("Apr")) return 4; - else if (month.compareToAscii ("May") == 0) + else if (month.equalsAscii("May")) return 5; - else if (month.compareToAscii ("Jun") == 0) + else if (month.equalsAscii("Jun")) return 6; - else if (month.compareToAscii ("Jul") == 0) + else if (month.equalsAscii("Jul")) return 7; - else if (month.compareToAscii ("Aug") == 0) + else if (month.equalsAscii("Aug")) return 8; - else if (month.compareToAscii ("Sep") == 0) + else if (month.equalsAscii("Sep")) return 9; - else if (month.compareToAscii ("Oct") == 0) + else if (month.equalsAscii("Oct")) return 10; - else if (month.compareToAscii ("Nov") == 0) + else if (month.equalsAscii("Nov")) return 11; - else if (month.compareToAscii ("Dec") == 0) + else if (month.equalsAscii("Dec")) return 12; else return 0; diff --git a/ucb/source/ucp/webdav/webdavservices.cxx b/ucb/source/ucp/webdav/webdavservices.cxx index 35f7f9c0e9b7..6bf9f78b62fc 100644 --- a/ucb/source/ucp/webdav/webdavservices.cxx +++ b/ucb/source/ucp/webdav/webdavservices.cxx @@ -47,7 +47,7 @@ extern "C" void * SAL_CALL component_getFactory( ////////////////////////////////////////////////////////////////////// if ( ::http_dav_ucp::ContentProvider::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = ::http_dav_ucp::ContentProvider::createServiceFactory( xSMgr ); } diff --git a/ucb/workben/ucb/ucbdemo.cxx b/ucb/workben/ucb/ucbdemo.cxx index bb0631ed9403..ce48a6ba37db 100644 --- a/ucb/workben/ucb/ucbdemo.cxx +++ b/ucb/workben/ucb/ucbdemo.cxx @@ -898,7 +898,7 @@ void UcbContent::open( const OUString & rName, const OUString& rInput, bool bDoSort = false; ucb::OpenCommandArgument2 aOpenArg; - if (rName.compareToAscii("search") == 0) + if (rName.equalsAscii("search")) { ucb::SearchCommandArgument aArgument; if (!parseSearchArgument(rInput, aArgument.Info)) diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx index f0e69664af4e..9bc6e5fde37c 100644 --- a/unotools/source/config/eventcfg.cxx +++ b/unotools/source/config/eventcfg.cxx @@ -245,7 +245,7 @@ void SAL_CALL GlobalEventConfig_Impl::replaceByName( const OUString& aName, cons sal_Int32 nPropCount = props.getLength(); for( sal_Int32 index = 0 ; index < nPropCount ; ++index ) { - if ( props[ index ].Name.compareToAscii( "Script" ) == 0 ) + if ( props[ index ].Name.equalsAscii( "Script" ) ) props[ index ].Value >>= macroURL; } m_eventBindingHash[ aName ] = macroURL; diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx index c31e131afdf4..87031f87dee9 100644 --- a/unotools/source/config/securityoptions.cxx +++ b/unotools/source/config/securityoptions.cxx @@ -498,27 +498,27 @@ sal_Int32 SvtSecurityOptions_Impl::GetHandle( const OUString& rName ) { sal_Int32 nHandle; - if( rName.compareToAscii( CSTR_SECUREURL ) == 0 ) + if( rName.equalsAscii( CSTR_SECUREURL ) ) nHandle = PROPERTYHANDLE_SECUREURL; - else if( rName.compareToAscii( CSTR_DOCWARN_SAVEORSEND ) == 0 ) + else if( rName.equalsAscii( CSTR_DOCWARN_SAVEORSEND ) ) nHandle = PROPERTYHANDLE_DOCWARN_SAVEORSEND; - else if( rName.compareToAscii( CSTR_DOCWARN_SIGNING ) == 0 ) + else if( rName.equalsAscii( CSTR_DOCWARN_SIGNING ) ) nHandle = PROPERTYHANDLE_DOCWARN_SIGNING; - else if( rName.compareToAscii( CSTR_DOCWARN_PRINT ) == 0 ) + else if( rName.equalsAscii( CSTR_DOCWARN_PRINT ) ) nHandle = PROPERTYHANDLE_DOCWARN_PRINT; - else if( rName.compareToAscii( CSTR_DOCWARN_CREATEPDF ) == 0 ) + else if( rName.equalsAscii( CSTR_DOCWARN_CREATEPDF ) ) nHandle = PROPERTYHANDLE_DOCWARN_CREATEPDF; - else if( rName.compareToAscii( CSTR_DOCWARN_REMOVEPERSONALINFO ) == 0 ) + else if( rName.equalsAscii( CSTR_DOCWARN_REMOVEPERSONALINFO ) ) nHandle = PROPERTYHANDLE_DOCWARN_REMOVEPERSONALINFO; - else if( rName.compareToAscii( CSTR_DOCWARN_RECOMMENDPASSWORD ) == 0 ) + else if( rName.equalsAscii( CSTR_DOCWARN_RECOMMENDPASSWORD ) ) nHandle = PROPERTYHANDLE_DOCWARN_RECOMMENDPASSWORD; - else if( rName.compareToAscii( CSTR_CTRLCLICK_HYPERLINK ) == 0 ) + else if( rName.equalsAscii( CSTR_CTRLCLICK_HYPERLINK ) ) nHandle = PROPERTYHANDLE_CTRLCLICK_HYPERLINK; - else if( rName.compareToAscii( CSTR_MACRO_SECLEVEL ) == 0 ) + else if( rName.equalsAscii( CSTR_MACRO_SECLEVEL ) ) nHandle = PROPERTYHANDLE_MACRO_SECLEVEL; - else if( rName.compareToAscii( CSTR_MACRO_TRUSTEDAUTHORS ) == 0 ) + else if( rName.equalsAscii( CSTR_MACRO_TRUSTEDAUTHORS ) ) nHandle = PROPERTYHANDLE_MACRO_TRUSTEDAUTHORS; - else if( rName.compareToAscii( CSTR_MACRO_DISABLE ) == 0 ) + else if( rName.equalsAscii( CSTR_MACRO_DISABLE ) ) nHandle = PROPERTYHANDLE_MACRO_DISABLE; // xmlsec05 deprecated diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index 56405bbb4c99..106772487bd4 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -482,7 +482,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL utl_component_getFactory( reinterpret_cast< css::lang::XMultiServiceFactory * >( pServiceManager ) ); css::uno::Reference< css::lang::XSingleComponentFactory > xFactory; - if (OTempFileService::getImplementationName_Static().compareToAscii( pImplName ) == 0) + if (OTempFileService::getImplementationName_Static().equalsAscii( pImplName ) ) xFactory = OTempFileService::createServiceFactory_Static(); if ( xFactory.is() ) diff --git a/unoxml/source/events/eventdispatcher.cxx b/unoxml/source/events/eventdispatcher.cxx index 665815b686d3..16c98f663817 100644 --- a/unoxml/source/events/eventdispatcher.cxx +++ b/unoxml/source/events/eventdispatcher.cxx @@ -111,13 +111,13 @@ namespace DOM { namespace events { CEvent *pEvent = 0; // pointer to internal event representation OUString const aType = i_xEvent->getType(); - if (aType.compareToAscii("DOMSubtreeModified") == 0|| - aType.compareToAscii("DOMNodeInserted") == 0|| - aType.compareToAscii("DOMNodeRemoved") == 0|| - aType.compareToAscii("DOMNodeRemovedFromDocument") == 0|| - aType.compareToAscii("DOMNodeInsertedIntoDocument") == 0|| - aType.compareToAscii("DOMAttrModified") == 0|| - aType.compareToAscii("DOMCharacterDataModified") == 0) + if (aType.equalsAscii("DOMSubtreeModified") || + aType.equalsAscii("DOMNodeInserted") || + aType.equalsAscii("DOMNodeRemoved") || + aType.equalsAscii("DOMNodeRemovedFromDocument") || + aType.equalsAscii("DOMNodeInsertedIntoDocument") || + aType.equalsAscii("DOMAttrModified") || + aType.equalsAscii("DOMCharacterDataModified") ) { Reference< XMutationEvent > const aMEvent(i_xEvent, UNO_QUERY_THROW); @@ -132,9 +132,9 @@ namespace DOM { namespace events { aMEvent->getAttrChange()); pEvent = pMEvent; } else if ( // UIEvent - aType.compareToAscii("DOMFocusIn") == 0|| - aType.compareToAscii("DOMFocusOut") == 0|| - aType.compareToAscii("DOMActivate") == 0) + aType.equalsAscii("DOMFocusIn") || + aType.equalsAscii("DOMFocusOut") || + aType.equalsAscii("DOMActivate") ) { Reference< XUIEvent > const aUIEvent(i_xEvent, UNO_QUERY_THROW); CUIEvent* pUIEvent = new CUIEvent; @@ -143,12 +143,12 @@ namespace DOM { namespace events { aUIEvent->getView(), aUIEvent->getDetail()); pEvent = pUIEvent; } else if ( // MouseEvent - aType.compareToAscii("click") == 0|| - aType.compareToAscii("mousedown") == 0|| - aType.compareToAscii("mouseup") == 0|| - aType.compareToAscii("mouseover") == 0|| - aType.compareToAscii("mousemove") == 0|| - aType.compareToAscii("mouseout") == 0) + aType.equalsAscii("click") || + aType.equalsAscii("mousedown") || + aType.equalsAscii("mouseup") || + aType.equalsAscii("mouseover") || + aType.equalsAscii("mousemove") || + aType.equalsAscii("mouseout") ) { Reference< XMouseEvent > const aMouseEvent(i_xEvent, UNO_QUERY_THROW); diff --git a/unoxml/source/service/services.cxx b/unoxml/source/service/services.cxx index bc60fa5bc7bc..8978309bc734 100644 --- a/unoxml/source/service/services.cxx +++ b/unoxml/source/service/services.cxx @@ -54,28 +54,28 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL unoxml_component_getFactory(const sal_Char * Reference< XMultiServiceFactory > xServiceManager( reinterpret_cast< XMultiServiceFactory* >(pServiceManager)); - if (CDocumentBuilder::_getImplementationName().compareToAscii( pImplementationName ) == 0 ) + if (CDocumentBuilder::_getImplementationName().equalsAscii( pImplementationName ) ) { xFactory = Reference< XSingleServiceFactory >( cppu::createOneInstanceFactory( xServiceManager, CDocumentBuilder::_getImplementationName(), CDocumentBuilder::_getInstance, CDocumentBuilder::_getSupportedServiceNames())); } - else if (CSAXDocumentBuilder::_getImplementationName().compareToAscii( pImplementationName ) == 0 ) + else if (CSAXDocumentBuilder::_getImplementationName().equalsAscii( pImplementationName ) ) { xFactory = Reference< XSingleServiceFactory >( cppu::createSingleFactory( xServiceManager, CSAXDocumentBuilder::_getImplementationName(), CSAXDocumentBuilder::_getInstance, CSAXDocumentBuilder::_getSupportedServiceNames())); } - else if (CXPathAPI::_getImplementationName().compareToAscii( pImplementationName ) == 0 ) + else if (CXPathAPI::_getImplementationName().equalsAscii( pImplementationName ) ) { xFactory = Reference< XSingleServiceFactory >( cppu::createSingleFactory( xServiceManager, CXPathAPI::_getImplementationName(), CXPathAPI::_getInstance, CXPathAPI::_getSupportedServiceNames())); } - else if (CTestListener::_getImplementationName().compareToAscii( pImplementationName ) == 0 ) + else if (CTestListener::_getImplementationName().equalsAscii( pImplementationName ) ) { xFactory = Reference< XSingleServiceFactory >( cppu::createSingleFactory( diff --git a/uui/source/iahndl-filter.cxx b/uui/source/iahndl-filter.cxx index 031ef91ff0a0..d67717aa7f1a 100644 --- a/uui/source/iahndl-filter.cxx +++ b/uui/source/iahndl-filter.cxx @@ -237,7 +237,7 @@ handleAmbigousFilterRequest_( aPackedSet >>= lProps; for( nStep=0; nStep>= sTemp; @@ -259,7 +259,7 @@ handleAmbigousFilterRequest_( aPackedSet >>= lProps; for( nStep=0; nStep>= sTemp; diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 74568bcac699..6f1373a7a480 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -355,7 +355,7 @@ namespace } const ::com::sun::star::uno::Type aType( pTypeDesc->pWeakRef ); - const bool bExactMatch = ( i_rPropagation.compareToAscii( "named-only" ) == 0 ); + const bool bExactMatch = i_rPropagation.equalsAscii( "named-only" ); if ( bExactMatch ) return i_rRequest.getValueType().equals( aType ); diff --git a/uui/source/services.cxx b/uui/source/services.cxx index 4c9145b44f19..f2d7c76aaa2e 100644 --- a/uui/source/services.cxx +++ b/uui/source/services.cxx @@ -86,7 +86,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL uui_component_getFactory(sal_Cha ////////////////////////////////////////////////////////////////////// else if ( uui::PasswordContainerInteractionHandler::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = uui::PasswordContainerInteractionHandler::createServiceFactory( xSMgr ); diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index 9b9ac19cda6c..bd88a6fbf4b6 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -627,9 +627,9 @@ bool SelectionManager::convertData( aFlavor.MimeType = convertTypeFromNative( nType, nSelection, rFormat ); sal_Int32 nIndex = 0; - if( aFlavor.MimeType.getToken( 0, ';', nIndex ).compareToAscii( "text/plain" ) == 0 ) + if( aFlavor.MimeType.getToken( 0, ';', nIndex ).equalsAscii( "text/plain" ) ) { - if( aFlavor.MimeType.getToken( 0, ';', nIndex ).compareToAscii( "charset=utf-16" ) == 0 ) + if( aFlavor.MimeType.getToken( 0, ';', nIndex ).equalsAscii( "charset=utf-16" ) ) aFlavor.DataType = getCppuType( (OUString *) 0 ); else aFlavor.DataType = getCppuType( (Sequence< sal_Int8 >*)0 ); @@ -1354,18 +1354,18 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor > { OUString aToken(pFlavors->MimeType.getToken( 0, ';', nIndex )); // omit text/plain;charset=unicode since it is not well defined - if( aToken.compareToAscii( "charset=unicode" ) == 0 ) + if( aToken.equalsAscii( "charset=unicode" ) ) { pAtoms++; continue; } bHaveText = true; - if( aToken.compareToAscii( "charset=utf-16" ) == 0 ) + if( aToken.equalsAscii( "charset=utf-16" ) ) { bHaveUTF16 = true; pFlavors->DataType = getCppuType( (OUString*)0 ); } - else if( aToken.compareToAscii( "charset=utf-8" ) == 0 ) + else if( aToken.equalsAscii( "charset=utf-8" ) ) { aUTF8Type = *pAtoms; } diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index 539f64f1de04..be3359836b3c 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -714,7 +714,7 @@ bool PrinterInfoManager::writePrinterConfig() while( nIndex != -1 && ! bAutoQueue ) { OUString aToken( it->second.m_aInfo.m_aFeatures.getToken( 0, ',', nIndex ) ); - if( !aToken.isEmpty() && aToken.compareToAscii( "autoqueue" ) == 0 ) + if( aToken.equalsAscii( "autoqueue" ) ) bAutoQueue = true; } if( bAutoQueue ) diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 1ff125c22af0..8d64dcfd337a 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -420,7 +420,7 @@ const std::vector< OUString >& Databases::getModuleList( const OUString& Languag ( str[idx + 2] == 'f' || str[idx + 2] == 'F' ) && ( str[idx + 3] == 'g' || str[idx + 3] == 'G' ) && ( fileName = fileName.copy(0,idx).toAsciiLowerCase() ).compareToAscii( "picture" ) != 0 ) { - if(! m_bShowBasic && fileName.compareToAscii("sbasic") == 0 ) + if(! m_bShowBasic && fileName.equalsAscii("sbasic") ) continue; m_avModules.push_back( fileName ); } @@ -633,21 +633,21 @@ Databases::getCollator( const OUString& Language, OUString countryStr = country(Language); if( countryStr.isEmpty() ) { - if( langStr.compareToAscii("de") == 0 ) + if( langStr.equalsAscii("de") ) countryStr = "DE"; - else if( langStr.compareToAscii("en") == 0 ) + else if( langStr.equalsAscii("en") ) countryStr = "US"; - else if( langStr.compareToAscii("es") == 0 ) + else if( langStr.equalsAscii("es") ) countryStr = "ES"; - else if( langStr.compareToAscii("it") == 0 ) + else if( langStr.equalsAscii("it") ) countryStr = "IT"; - else if( langStr.compareToAscii("fr") == 0 ) + else if( langStr.equalsAscii("fr") ) countryStr = "FR"; - else if( langStr.compareToAscii("sv") == 0 ) + else if( langStr.equalsAscii("sv") ) countryStr = "SE"; - else if( langStr.compareToAscii("ja") == 0 ) + else if( langStr.equalsAscii("ja") ) countryStr = "JP"; - else if( langStr.compareToAscii("ko") == 0 ) + else if( langStr.equalsAscii("ko") ) countryStr = "KR"; } /* FIXME-BCP47: all this does not look right for language tag context, @@ -1065,7 +1065,7 @@ void Databases::cascadingStylesheet( const OUString& Language, sal_Bool bHighContrastMode = sal_False; OUString aCSS( m_aCSS ); - if ( aCSS.compareToAscii( "default" ) == 0 ) + if ( aCSS.equalsAscii( "default" ) ) { // #i50760: "default" needs to adapt HC mode uno::Reference< awt::XToolkit2 > xToolkit = diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx index d030e7735f2c..e4cc68e2229d 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx @@ -126,7 +126,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte vector< OUString > aCompleteResultVector; OUString scope = m_aURLParameter.get_scope(); - bool bCaptionsOnly = ( scope.compareToAscii( "Heading" ) == 0 ); + bool bCaptionsOnly = scope.equalsAscii( "Heading" ); sal_Int32 hitCount = m_aURLParameter.get_hitCount(); IndexFolderIterator aIndexFolderIt( *pDatabases, m_aURLParameter.get_module(), m_aURLParameter.get_language() ); diff --git a/xmlhelp/source/cxxhelp/provider/services.cxx b/xmlhelp/source/cxxhelp/provider/services.cxx index ee7c1f7f9e84..f1fbd9ff7a52 100644 --- a/xmlhelp/source/cxxhelp/provider/services.cxx +++ b/xmlhelp/source/cxxhelp/provider/services.cxx @@ -39,7 +39,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucpchelp_component_getFactory( // Create factory, if implementation name matches. if ( ::chelp::ContentProvider::getImplementationName_Static(). - compareToAscii( pImplName ) == 0 ) + equalsAscii( pImplName ) ) { xFactory = ::chelp::ContentProvider::createServiceFactory( xSMgr ); } diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index 9ac95e644580..5130efdbf2c2 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -131,7 +131,7 @@ OString URLParameter::getByName( const char* par ) OUString URLParameter::get_id() { - if( m_aId.compareToAscii("start") == 0 ) + if( m_aId.equalsAscii("start") ) { // module is set StaticModuleInformation* inf = m_pDatabases->getStaticInformationForModule( get_module(), @@ -268,7 +268,7 @@ OUString URLParameter::get_the_jar() void URLParameter::readHelpDataFile() { - if( get_id().compareToAscii("") == 0 ) + if( get_id().equalsAscii("") ) return; OUString aModule = get_module(); @@ -519,7 +519,7 @@ bool URLParameter::scheme() sal_Int32 nLen = m_aExpr.getLength(); OUString aLastStr = m_aExpr.copy(sal::static_int_cast(nLen) - 6); - if( aLastStr.compareToAscii( "DbPAR=" ) == 0 ) + if( aLastStr.equalsAscii( "DbPAR=" ) ) { OUString aNewExpr = m_aExpr.copy( 0, 20 ); OUString aSharedStr("shared"); @@ -618,39 +618,39 @@ bool URLParameter::query() query_ = query_.copy( delimIdx+1 ).trim(); } - if( parameter.compareToAscii( "Language" ) == 0 ) + if( parameter.equalsAscii( "Language" ) ) m_aLanguage = value; - else if( parameter.compareToAscii( "Device" ) == 0 ) + else if( parameter.equalsAscii( "Device" ) ) m_aDevice = value; - else if( parameter.compareToAscii( "Program" ) == 0 ) + else if( parameter.equalsAscii( "Program" ) ) m_aProgram = value; - else if( parameter.compareToAscii( "Eid" ) == 0 ) + else if( parameter.equalsAscii( "Eid" ) ) m_aEid = value; - else if( parameter.compareToAscii( "UseDB" ) == 0 ) - m_bUseDB = ! ( value.compareToAscii("no") == 0 ); - else if( parameter.compareToAscii( "DbPAR" ) == 0 ) + else if( parameter.equalsAscii( "UseDB" ) ) + m_bUseDB = ( value.equalsAscii("no") != 0 ); + else if( parameter.equalsAscii( "DbPAR" ) ) m_aDbPar = value; - else if( parameter.compareToAscii( "Query" ) == 0 ) + else if( parameter.equalsAscii( "Query" ) ) { if( m_aQuery.isEmpty() ) m_aQuery = value; else m_aQuery += ( OUString( " " ) + value ); } - else if( parameter.compareToAscii( "Scope" ) == 0 ) + else if( parameter.equalsAscii( "Scope" ) ) m_aScope = value; - else if( parameter.compareToAscii( "System" ) == 0 ) + else if( parameter.equalsAscii( "System" ) ) m_aSystem = value; - else if( parameter.compareToAscii( "HelpPrefix" ) == 0 ) + else if( parameter.equalsAscii( "HelpPrefix" ) ) m_aPrefix = rtl::Uri::decode( value, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ); - else if( parameter.compareToAscii( "HitCount" ) == 0 ) + else if( parameter.equalsAscii( "HitCount" ) ) m_nHitCount = value.toInt32(); - else if( parameter.compareToAscii( "Active" ) == 0 ) + else if( parameter.equalsAscii( "Active" ) ) m_aActive = value; - else if( parameter.compareToAscii( "Version" ) == 0 ) + else if( parameter.equalsAscii( "Version" ) ) ; // ignored (but accepted) in the build-in help, useful only for the online help else ret = false; diff --git a/xmlhelp/source/treeview/tvfactory.cxx b/xmlhelp/source/treeview/tvfactory.cxx index b4cee958fd8e..1bcf74ecaefd 100644 --- a/xmlhelp/source/treeview/tvfactory.cxx +++ b/xmlhelp/source/treeview/tvfactory.cxx @@ -93,8 +93,8 @@ TVFactory::supportsService( throw( RuntimeException ) { return - ServiceName.compareToAscii( "com.sun.star.help.TreeView" ) == 0 || - ServiceName.compareToAscii( "com.sun.star.ucb.HiearchyDataSource" ) == 0; + ServiceName.equalsAscii( "com.sun.star.help.TreeView" ) || + ServiceName.equalsAscii( "com.sun.star.ucb.HiearchyDataSource" ); } Sequence< OUString > SAL_CALL @@ -230,7 +230,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL treeview_component_getFactory( // File Content Provider. - if ( TVFactory::getImplementationName_static().compareToAscii( pImplName ) == 0 ) + if ( TVFactory::getImplementationName_static().equalsAscii( pImplName ) ) { xFactory = TVFactory::createServiceFactory( xSMgr ); } diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 722784c39652..76ef240bcc50 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -305,11 +305,11 @@ TVRead::getByName( const OUString& aName ) { bool found( true ); Any aAny; - if( aName.compareToAscii( "Title" ) == 0 ) + if( aName.equalsAscii( "Title" ) ) aAny <<= Title; - else if( aName.compareToAscii( "TargetURL" ) == 0 ) + else if( aName.equalsAscii( "TargetURL" ) ) aAny <<= TargetURL; - else if( aName.compareToAscii( "Children" ) == 0 ) + else if( aName.equalsAscii( "Children" ) ) { cppu::OWeakObject* p = Children.get(); aAny <<= Reference< XInterface >( p ); @@ -340,9 +340,9 @@ sal_Bool SAL_CALL TVRead::hasByName( const OUString& aName ) throw( RuntimeException ) { - if( aName.compareToAscii( "Title" ) == 0 || - aName.compareToAscii( "TargetURL" ) == 0 || - aName.compareToAscii( "Children" ) == 0 ) + if( aName.equalsAscii( "Title" ) || + aName.equalsAscii( "TargetURL" ) || + aName.equalsAscii( "Children" ) ) return true; return false; @@ -359,7 +359,7 @@ TVRead::getByHierarchicalName( const OUString& aName ) OUString name( aName ); if( ( idx = name.indexOf( sal_Unicode( '/' ) ) ) != -1 && - name.copy( 0,idx ).compareToAscii( "Children" ) == 0 ) + name.copy( 0,idx ).equalsAscii( "Children" ) ) return Children->getByHierarchicalName( name.copy( 1 + idx ) ); return getByName( name ); @@ -373,7 +373,7 @@ TVRead::hasByHierarchicalName( const OUString& aName ) OUString name( aName ); if( ( idx = name.indexOf( sal_Unicode( '/' ) ) ) != -1 && - name.copy( 0,idx ).compareToAscii( "Children" ) == 0 ) + name.copy( 0,idx ).equalsAscii( "Children" ) ) return Children->hasByHierarchicalName( name.copy( 1 + idx ) ); return hasByName( name ); @@ -775,7 +775,7 @@ ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext ) ( str[idx_ + 4] == 'e' || str[idx_ + 4] == 'E' ) ) { OUString baseName = aFileName.copy(0,idx_).toAsciiLowerCase(); - if(! showBasic && baseName.compareToAscii("sbasic") == 0 ) + if(! showBasic && baseName.equalsAscii("sbasic") ) continue; osl::File aFile( aFileUrl ); if( osl::FileBase::E_None == aFile.open( osl_File_OpenFlag_Read ) ) diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index cf3f3771fbe3..c6c5652aeac1 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -2737,7 +2737,7 @@ void SchXMLExportHelper_Impl::exportSeries( if( xLabelSeq.is()) { OUString aRange = xLabelSeq->getSourceRangeRepresentation(); - if ( nSeriesIdx == 0 && aRange.compareToAscii("label 1") == 0) + if ( nSeriesIdx == 0 && aRange.equalsAscii("label 1")) modifyLabelRange = true; if (modifyLabelRange) aRange = "label " + OUString::number(aRange.copy( OUString("label").getLength()).toInt32() - 1); diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx index c676bc99ff31..160322316784 100644 --- a/xmloff/source/core/DocumentSettingsContext.cxx +++ b/xmloff/source/core/DocumentSettingsContext.cxx @@ -381,7 +381,7 @@ void XMLDocumentSettingsContext::EndElement() bool bFound(false); while((i >= 0) && !bFound) { - if (aSeqViewProps[i].Name.compareToAscii("Views") == 0) + if (aSeqViewProps[i].Name.equalsAscii("Views")) { bFound = true; uno::Reference xIndexAccess; @@ -409,13 +409,13 @@ void XMLDocumentSettingsContext::EndElement() { OUString sProp( aSeqConfigProps[i].Name ); - if ( sProp.compareToAscii("PrinterName") == 0 ) + if ( sProp.equalsAscii("PrinterName") ) { OUString sEmpty; aSeqConfigProps[i].Value = uno::makeAny( sEmpty ); nFound++; } - else if ( sProp.compareToAscii("PrinterSetup") == 0 ) + else if ( sProp.equalsAscii("PrinterSetup") ) { uno::Sequence< sal_Int8 > aEmpty; aSeqConfigProps[i].Value = uno::makeAny( aEmpty ); diff --git a/xmloff/source/draw/XMLNumberStyles.cxx b/xmloff/source/draw/XMLNumberStyles.cxx index 97c2af92598f..373f7975c5a3 100644 --- a/xmloff/source/draw/XMLNumberStyles.cxx +++ b/xmloff/source/draw/XMLNumberStyles.cxx @@ -627,7 +627,7 @@ void SdXMLNumberFormatImportContext::add( OUString& rNumberStyle, sal_Bool bLong (pStyleMember->mbTextual == bTextual) && (pStyleMember->mbDecimal02 == bDecimal02) && ( ( (pStyleMember->mpText == NULL) && (rText.isEmpty()) ) || - ( pStyleMember->mpText && (rText.compareToAscii( pStyleMember->mpText ) == 0 )) ) ) ) + ( pStyleMember->mpText && (rText.equalsAscii( pStyleMember->mpText ) ) ) ) ) ) { mnElements[mnIndex++] = nIndex + 1; return; diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx index 2672ad72f5ac..dc67d3f566ba 100644 --- a/xmloff/source/draw/animationexport.cxx +++ b/xmloff/source/draw/animationexport.cxx @@ -1140,7 +1140,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat const struct ImplAttributeNameConversion* p = getAnimationAttributeNamesConversionList(); while( p->mpAPIName ) { - if( sTemp.compareToAscii( p->mpAPIName ) == 0 ) + if( sTemp.equalsAscii( p->mpAPIName ) ) { sTemp = GetXMLToken( p->meXMLToken ); eAttributeName = p->meXMLToken; diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 99a7ecc7df3a..76fae7c8cb2e 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -1883,7 +1883,7 @@ void SvXMLNumFormatContext::AddCurrency( const OUString& rContent, LanguageType bAutomatic = sal_True; } } - else if ( nLang == LANGUAGE_SYSTEM && aSymbol.compareToAscii("CCC") == 0 ) + else if ( nLang == LANGUAGE_SYSTEM && aSymbol.equalsAscii("CCC") ) { // "CCC" is used for automatic long symbol bAutomatic = sal_True; @@ -2055,7 +2055,7 @@ void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex ) //! collect all conditions first and adjust default to >=0, >0 or <0 depending on count //! allow blanks in conditions - if ( aConditions.isEmpty() && aMyConditions.size() == 1 && sRealCond.compareToAscii( ">=0" ) == 0 ) + if ( aConditions.isEmpty() && aMyConditions.size() == 1 && sRealCond.equalsAscii( ">=0" ) ) bDefaultCond = sal_True; if ( nType == XML_TOK_STYLES_TEXT_STYLE && nIndex == 2 ) diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx index 6b538f00fbe6..85a807617f3a 100644 --- a/xmloff/source/text/XMLTextMarkImportContext.cxx +++ b/xmloff/source/text/XMLTextMarkImportContext.cxx @@ -131,13 +131,13 @@ static const char *lcl_getFormFieldmarkName(OUString &name) { static const char sCheckbox[]=ODF_FORMCHECKBOX; static const char sFormDropDown[]=ODF_FORMDROPDOWN; - if (name.compareToAscii("msoffice.field.FORMCHECKBOX")==0 || - name.compareToAscii("ecma.office-open-xml.field.FORMCHECKBOX")==0) + if (name.equalsAscii("msoffice.field.FORMCHECKBOX") || + name.equalsAscii("ecma.office-open-xml.field.FORMCHECKBOX") ) return sCheckbox; - else if (name.compareToAscii(ODF_FORMCHECKBOX)==0) + else if (name.equalsAscii(ODF_FORMCHECKBOX) ) return sCheckbox; - if (name.compareToAscii(ODF_FORMDROPDOWN)==0 || - name.compareToAscii("ecma.office-open-xml.field.FORMDROPDOWN")==0) + if (name.equalsAscii(ODF_FORMDROPDOWN) || + name.equalsAscii("ecma.office-open-xml.field.FORMDROPDOWN") ) return sFormDropDown; else return NULL; @@ -146,10 +146,10 @@ static const char *lcl_getFormFieldmarkName(OUString &name) static OUString lcl_getFieldmarkName(OUString &name) { static const char sFormtext[]=ODF_FORMTEXT; - if (name.compareToAscii("msoffice.field.FORMTEXT")==0 || - name.compareToAscii("ecma.office-open-xml.field.FORMTEXT")==0) + if (name.equalsAscii("msoffice.field.FORMTEXT") || + name.equalsAscii("ecma.office-open-xml.field.FORMTEXT") ) return OUString::createFromAscii(sFormtext); - else if (name.compareToAscii(ODF_FORMTEXT)==0) + else if (name.equalsAscii(ODF_FORMTEXT) ) return OUString::createFromAscii(sFormtext); else return name; diff --git a/xmlsecurity/source/component/certificatecontainer.cxx b/xmlsecurity/source/component/certificatecontainer.cxx index db51de9bef6c..6753282335f7 100644 --- a/xmlsecurity/source/component/certificatecontainer.cxx +++ b/xmlsecurity/source/component/certificatecontainer.cxx @@ -96,7 +96,7 @@ sal_Bool SAL_CALL CertificateContainer::supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException) { - if ( ServiceName.compareToAscii("com.sun.star.security.CertificateContainer") == 0 ) + if ( ServiceName.equalsAscii("com.sun.star.security.CertificateContainer") ) return sal_True; else return sal_False; -- cgit