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 --- 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 +- 16 files changed, 93 insertions(+), 93 deletions(-) (limited to 'ucb/source') 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 ); } -- cgit