diff options
author | Noel Grandin <noel@peralex.com> | 2013-11-05 14:39:55 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-11-11 12:58:13 +0200 |
commit | fcd1637d5101b9142e6808edfb77b01122857901 (patch) | |
tree | 5fd09f97de80cf2a9481bd55a798015db35f1d0c /ucb/source/ucp/ftp | |
parent | ef90021abe3735fba57145598fd7c3d359d2718e (diff) |
convert OUString compareToAscii == 0 to equalsAscii
Convert code like
aStr.compareToAscii("XXX") == 0
to
aStr.equalsAscii("XXX")
which is both easier to read and faster.
Change-Id: I448abf58f2fa0e7715dba53f8e8825ca0587c83f
Diffstat (limited to 'ucb/source/ucp/ftp')
-rw-r--r-- | ucb/source/ucp/ftp/ftpcontent.cxx | 36 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/ftpresultsetI.cxx | 16 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/ftpservices.cxx | 2 |
3 files changed, 27 insertions, 27 deletions
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<Property> 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<PropertyValue> 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<XComponentContext>& 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 ); } |