diff options
Diffstat (limited to 'ucb/source')
21 files changed, 201 insertions, 475 deletions
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index cbe7b2ba7669..9e339ee09b92 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -632,9 +632,7 @@ Any SAL_CALL UniversalContentBroker::execute( // ctor in ucbcmds.cxx when adding new commands! ////////////////////////////////////////////////////////////////////// - if ( ( aCommand.Handle == GETCOMMANDINFO_HANDLE ) || - aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( GETCOMMANDINFO_NAME ) ) ) + if ( ( aCommand.Handle == GETCOMMANDINFO_HANDLE ) || aCommand.Name == GETCOMMANDINFO_NAME ) { ////////////////////////////////////////////////////////////////// // getCommandInfo @@ -642,9 +640,7 @@ Any SAL_CALL UniversalContentBroker::execute( aRet <<= getCommandInfo(); } - else if ( ( aCommand.Handle == GLOBALTRANSFER_HANDLE ) || - aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM(GLOBALTRANSFER_NAME ) ) ) + else if ( ( aCommand.Handle == GLOBALTRANSFER_HANDLE ) || aCommand.Name == GLOBALTRANSFER_NAME ) { ////////////////////////////////////////////////////////////////// // globalTransfer diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx index 86236f04d2a5..561e7f8dbf22 100644 --- a/ucb/source/ucp/file/shell.cxx +++ b/ucb/source/ucp/file/shell.cxx @@ -1974,9 +1974,7 @@ void SAL_CALL shell::insertDefaultProperties( const rtl::OUString& aUnqPath ) sal_Bool SAL_CALL shell::getUnqFromUrl( const rtl::OUString& Url,rtl::OUString& Unq ) { - if (Url.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("file:///")) || - Url.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("file://localhost/")) || - Url.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("file://127.0.0.1/"))) + if ( Url == "file:///" || Url == "file://localhost/" || Url == "file://127.0.0.1/" ) { Unq = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///")); return false; diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx index 1de00cd726ee..deba05ec9c1b 100644 --- a/ucb/source/ucp/ftp/ftpcontent.cxx +++ b/ucb/source/ucp/ftp/ftpcontent.cxx @@ -679,10 +679,7 @@ Reference<XContent > SAL_CALL FTPContent::createNewContent( const ContentInfo& Info ) throw (RuntimeException) { - if(Info.Type.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/" - "vnd.sun.staroffice.ftp-file")) || - Info.Type.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/" - "vnd.sun.staroffice.ftp-folder"))) + if( Info.Type =="application/vnd.sun.staroffice.ftp-file" || Info.Type == "application/vnd.sun.staroffice.ftp-folder" ) return new FTPContent(m_xSMgr, m_pFCP, m_xIdentifier,Info); diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx index 60f42e80d90b..17f50e52a845 100644 --- a/ucb/source/ucp/ftp/ftpurl.cxx +++ b/ucb/source/ucp/ftp/ftpurl.cxx @@ -215,9 +215,7 @@ void FTPURL::parse(const rtl::OUString& url) *p1 = 0; if(buffer[0]) { - if(strcmp(buffer,"..") == 0 && - m_aPathSegmentVec.size() && - ! m_aPathSegmentVec.back().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".."))) + if( strcmp(buffer,"..") == 0 && m_aPathSegmentVec.size() && m_aPathSegmentVec.back() != ".." ) m_aPathSegmentVec.pop_back(); else if(strcmp(buffer,".") == 0) ; // Ignore @@ -257,7 +255,7 @@ rtl::OUString FTPURL::ident(bool withslash,bool internal) const rtl::OUStringBuffer bff; bff.appendAscii("ftp://"); - if(!m_aUsername.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("anonymous"))) { + if( m_aUsername != "anonymous" ) { bff.append(m_aUsername); rtl::OUString aPassword,aAccount; @@ -276,7 +274,7 @@ rtl::OUString FTPURL::ident(bool withslash,bool internal) const } bff.append(m_aHost); - if(!m_aPort.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("21"))) + if( m_aPort != "21" ) bff.append(sal_Unicode(':')) .append(m_aPort) .append(sal_Unicode('/')); @@ -303,7 +301,7 @@ rtl::OUString FTPURL::parent(bool internal) const bff.appendAscii("ftp://"); - if(!m_aUsername.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("anonymous"))) { + if( m_aUsername != "anonymous" ) { bff.append(m_aUsername); rtl::OUString aPassword,aAccount; @@ -322,7 +320,7 @@ rtl::OUString FTPURL::parent(bool internal) const bff.append(m_aHost); - if(!m_aPort.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("21"))) + if( m_aPort != "21" ) bff.append(sal_Unicode(':')) .append(m_aPort) .append(sal_Unicode('/')); @@ -504,9 +502,7 @@ std::vector<FTPDirentry> FTPURL::list( osKind = FTP_VMS; } aDirEntry.m_aName = aDirEntry.m_aName.trim(); - if(osKind != int(FTP_UNKNOWN) && - !aDirEntry.m_aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("..")) && - !aDirEntry.m_aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("."))) { + if( osKind != int(FTP_UNKNOWN) && aDirEntry.m_aName != ".." && aDirEntry.m_aName != "." ) { aDirEntry.m_aURL = viewurl + encodePathSegment(aDirEntry.m_aName); sal_Bool isDir = @@ -575,7 +571,7 @@ rtl::OUString FTPURL::net_title() const index1 = 1+aNetTitle.indexOf(sal_Unicode('"'),index1); sal_Int32 index2 = aNetTitle.indexOf(sal_Unicode('"'),index1); aNetTitle = aNetTitle.copy(index1,index2-index1); - if(!aNetTitle.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("/"))) { + if( aNetTitle != "/" ) { index1 = aNetTitle.lastIndexOf(sal_Unicode('/')); aNetTitle = aNetTitle.copy(1+index1); } @@ -621,15 +617,14 @@ FTPDirentry FTPURL::direntry() const FTPDirentry aDirentry; aDirentry.m_aName = nettitle; // init aDirentry - if(nettitle.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("/")) || - nettitle.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".."))) + if( nettitle == "/" || nettitle == ".." ) aDirentry.m_nMode = INETCOREFTP_FILEMODE_ISDIR; else aDirentry.m_nMode = INETCOREFTP_FILEMODE_UNKNOWN; aDirentry.m_nSize = 0; - if(!nettitle.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("/"))) { + if( nettitle != "/" ) { // try to open the parent directory FTPURL aURL(parent(),m_pFCP); @@ -781,8 +776,7 @@ rtl::OUString FTPURL::ren(const rtl::OUString& NewTitle) curl_slist_free_all(slist); if(err != CURLE_OK) throw curl_exception(err); - else if(m_aPathSegmentVec.size() && - !m_aPathSegmentVec.back().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".."))) + else if( m_aPathSegmentVec.size() && m_aPathSegmentVec.back() != ".." ) m_aPathSegmentVec.back() = encodePathSegment(NewTitle); return OldTitle; } diff --git a/ucb/source/ucp/ftp/test_ftpurl.cxx b/ucb/source/ucp/ftp/test_ftpurl.cxx index 72e228124dec..f514c4b6a51a 100644 --- a/ucb/source/ucp/ftp/test_ftpurl.cxx +++ b/ucb/source/ucp/ftp/test_ftpurl.cxx @@ -172,9 +172,7 @@ int test_ftplist(void) { if(vec.size() != 3) ++number_of_errors; - if(!(vec[0].m_aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dir1")) && - vec[1].m_aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dir2")) && - vec[2].m_aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("file1")))) + if(!(vec[0].m_aName == "dir1" && vec[1].m_aName == "dir2" && vec[2].m_aName == "file1" )) ++number_of_errors; TESTEVAL; @@ -234,8 +232,7 @@ int test_ftpproperties(void) { ftp::FTPDirentry ade(url.direntry()); - if(!(ade.m_aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("file")) && - ade.isFile())) + if(!(ade.m_aName == "file" && ade.isFile())) ++number_of_errors; TESTEVAL; diff --git a/ucb/source/ucp/gvfs/gvfs_content.cxx b/ucb/source/ucp/gvfs/gvfs_content.cxx index 51db0a3bd70e..cb1bb50dea5e 100644 --- a/ucb/source/ucp/gvfs/gvfs_content.cxx +++ b/ucb/source/ucp/gvfs/gvfs_content.cxx @@ -308,7 +308,7 @@ uno::Any SAL_CALL Content::execute( } #endif -#define COMMAND_IS(cmd,name) ( (cmd).Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( name ) ) ) +#define COMMAND_IS(cmd,name) ( (cmd).Name == name ) if ( COMMAND_IS( aCommand, "getPropertyValues" ) ) { uno::Sequence< beans::Property > Properties; @@ -834,8 +834,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( ( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property value has wrong type!")), static_cast< cppu::OWeakObject * >( this ) ); - } else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DateCreated" ) ) || - rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DateModified" ) ) ) { + } else if ( rValue.Name == "DateCreated" || rValue.Name == "DateModified" ) { // FIXME: should be able to set the timestamps aRet[ n ] <<= getReadOnlyException( this ); } else { diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx index 81ac70b94f3c..8cc6cb26ef16 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx @@ -114,10 +114,7 @@ HierarchyContent* HierarchyContent::create( if ( Info.Type.isEmpty() ) return 0; - if ( !Info.Type.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( HIERARCHY_FOLDER_CONTENT_TYPE ) ) && - !Info.Type.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( HIERARCHY_LINK_CONTENT_TYPE ) ) ) + if ( Info.Type != HIERARCHY_FOLDER_CONTENT_TYPE && Info.Type != HIERARCHY_LINK_CONTENT_TYPE ) return 0; return new HierarchyContent( rxSMgr, pProvider, Identifier, Info ); @@ -146,10 +143,7 @@ HierarchyContent::HierarchyContent( const uno::Reference< ucb::XContentIdentifier >& Identifier, const ucb::ContentInfo& Info ) : ContentImplHelper( rxSMgr, pProvider, Identifier ), - m_aProps( Info.Type.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( HIERARCHY_FOLDER_CONTENT_TYPE ) ) - ? HierarchyEntryData::FOLDER - : HierarchyEntryData::LINK ), + m_aProps( Info.Type == HIERARCHY_FOLDER_CONTENT_TYPE ? HierarchyEntryData::FOLDER : HierarchyEntryData::LINK ), m_eState( TRANSIENT ), m_pProvider( pProvider ), m_bCheckedReadOnly( false ), @@ -373,8 +367,7 @@ uno::Any SAL_CALL HierarchyContent::execute( { uno::Any aRet; - if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getPropertyValues" ) ) ) + if ( aCommand.Name == "getPropertyValues" ) { ////////////////////////////////////////////////////////////////// // getPropertyValues @@ -395,8 +388,7 @@ uno::Any SAL_CALL HierarchyContent::execute( aRet <<= getPropertyValues( Properties ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "setPropertyValues" ) ) ) + else if ( aCommand.Name == "setPropertyValues" ) { ////////////////////////////////////////////////////////////////// // setPropertyValues @@ -429,8 +421,7 @@ uno::Any SAL_CALL HierarchyContent::execute( aRet <<= setPropertyValues( aProperties, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getPropertySetInfo" ) ) ) + else if ( aCommand.Name == "getPropertySetInfo" ) { ////////////////////////////////////////////////////////////////// // getPropertySetInfo @@ -438,8 +429,7 @@ uno::Any SAL_CALL HierarchyContent::execute( aRet <<= getPropertySetInfo( Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getCommandInfo" ) ) ) + else if ( aCommand.Name == "getCommandInfo" ) { ////////////////////////////////////////////////////////////////// // getCommandInfo @@ -447,8 +437,7 @@ uno::Any SAL_CALL HierarchyContent::execute( aRet <<= getCommandInfo( Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "open" ) ) && isFolder() ) + else if ( aCommand.Name == "open" && isFolder() ) { ////////////////////////////////////////////////////////////////// // open command for a folder content @@ -471,9 +460,7 @@ uno::Any SAL_CALL HierarchyContent::execute( = new DynamicResultSet( m_xSMgr, this, aOpenCommand ); aRet <<= xSet; } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "insert" ) ) && - ( m_eKind != ROOT ) && !isReadOnly() ) + else if ( aCommand.Name == "insert" && ( m_eKind != ROOT ) && !isReadOnly() ) { ////////////////////////////////////////////////////////////////// // insert @@ -498,9 +485,7 @@ uno::Any SAL_CALL HierarchyContent::execute( : ucb::NameClash::ERROR; insert( nNameClash, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "delete" ) ) && - ( m_eKind != ROOT ) && !isReadOnly() ) + else if ( aCommand.Name == "delete" && ( m_eKind != ROOT ) && !isReadOnly() ) { ////////////////////////////////////////////////////////////////// // delete @@ -536,9 +521,7 @@ uno::Any SAL_CALL HierarchyContent::execute( // Remove own and all children's Additional Core Properties. removeAdditionalPropertySet( sal_True ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "transfer" ) ) && - isFolder() && !isReadOnly() ) + else if ( aCommand.Name == "transfer" && isFolder() && !isReadOnly() ) { ////////////////////////////////////////////////////////////////// // transfer @@ -561,9 +544,7 @@ uno::Any SAL_CALL HierarchyContent::execute( transfer( aInfo, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "createNewContent" ) ) && - isFolder() && !isReadOnly() ) + else if ( aCommand.Name == "createNewContent" && isFolder() && !isReadOnly() ) { ////////////////////////////////////////////////////////////////// // createNewContent @@ -638,13 +619,9 @@ HierarchyContent::createNewContent( const ucb::ContentInfo& Info ) if ( Info.Type.isEmpty() ) return uno::Reference< ucb::XContent >(); - sal_Bool bCreateFolder = - Info.Type.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( HIERARCHY_FOLDER_CONTENT_TYPE ) ); + sal_Bool bCreateFolder = Info.Type == HIERARCHY_FOLDER_CONTENT_TYPE; - if ( !bCreateFolder && - !Info.Type.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( HIERARCHY_LINK_CONTENT_TYPE ) ) ) + if ( !bCreateFolder && Info.Type != HIERARCHY_LINK_CONTENT_TYPE ) return uno::Reference< ucb::XContent >(); rtl::OUString aURL = m_xIdentifier->getContentIdentifier(); @@ -794,10 +771,7 @@ bool HierarchyContent::isReadOnly() sal_Int32 nCount = aNames.getLength(); for ( sal_Int32 n = 0; n < nCount; ++n ) { - if ( aNames[ n ].equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( - "com.sun.star.ucb.HierarchyDataReadWriteAccess" - ) ) ) + if ( aNames[ n ] == "com.sun.star.ucb.HierarchyDataReadWriteAccess" ) { m_bIsReadOnly = false; break; @@ -985,34 +959,28 @@ uno::Reference< sdbc::XRow > HierarchyContent::getPropertyValues( // Process Core properties. - if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) ) + if ( rProp.Name == "ContentType" ) { xRow->appendString ( rProp, rData.getContentType() ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) + else if ( rProp.Name == "Title" ) { xRow->appendString ( rProp, rData.getTitle() ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) ) + else if ( rProp.Name == "IsDocument" ) { xRow->appendBoolean( rProp, rData.getIsDocument() ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ) + else if ( rProp.Name == "IsFolder" ) { xRow->appendBoolean( rProp, rData.getIsFolder() ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + else if ( rProp.Name == "CreatableContentsInfo" ) { xRow->appendObject( rProp, uno::makeAny( rData.getCreatableContentsInfo() ) ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "TargetURL" ) ) ) + else if ( rProp.Name == "TargetURL" ) { // TargetURL is only supported by links. @@ -1162,8 +1130,7 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( { const beans::PropertyValue& rValue = pValues[ n ]; - if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) ) + if ( rValue.Name == "ContentType" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1171,8 +1138,7 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) ) + else if ( rValue.Name == "IsDocument" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1180,8 +1146,7 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ) + else if ( rValue.Name == "IsFolder" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1189,8 +1154,7 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + else if ( rValue.Name == "CreatableContentsInfo" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1198,8 +1162,7 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) + else if ( rValue.Name == "Title" ) { if ( isReadOnly() ) { @@ -1255,8 +1218,7 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( } } } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "TargetURL" ) ) ) + else if ( rValue.Name == "TargetURL" ) { if ( isReadOnly() ) { @@ -1830,8 +1792,7 @@ void HierarchyContent::transfer( rValue.Name = rProp.Name; rValue.Handle = rProp.Handle; - if ( !bHadTitle && rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) + if ( !bHadTitle && rProp.Name == "Title" ) { // Set new title instead of original. bHadTitle = sal_True; diff --git a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx index b1a0354c6ea4..334e551ab205 100644 --- a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx @@ -392,11 +392,8 @@ HierarchyDataSource::createInstanceWithArguments( osl::Guard< osl::Mutex > aGuard( m_aMutex ); // Check service specifier. - bool bReadOnly = !!ServiceSpecifier.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( READ_SERVICE_NAME ) ); - bool bReadWrite = !bReadOnly && - ServiceSpecifier.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( READWRITE_SERVICE_NAME ) ); + bool bReadOnly = ServiceSpecifier == READ_SERVICE_NAME; + bool bReadWrite = !bReadOnly && ServiceSpecifier == READWRITE_SERVICE_NAME; if ( !bReadOnly && !bReadWrite ) { @@ -419,8 +416,7 @@ HierarchyDataSource::createInstanceWithArguments( beans::PropertyValue aProp; if ( Arguments[ n ] >>= aProp ) { - if ( aProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( CFGPROPERTY_NODEPATH ) ) ) + if ( aProp.Name == CFGPROPERTY_NODEPATH ) { rtl::OUString aPath; if ( aProp.Value >>= aPath ) @@ -452,9 +448,7 @@ HierarchyDataSource::createInstanceWithArguments( return uno::Reference< uno::XInterface >(); } } - else if ( aProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( - CFGPROPERTY_LAZYWRITE ) ) ) + else if ( aProp.Name == CFGPROPERTY_LAZYWRITE ) { if ( aProp.Value.getValueType() == getCppuBooleanType() ) { diff --git a/ucb/source/ucp/hierarchy/hierarchyuri.cxx b/ucb/source/ucp/hierarchy/hierarchyuri.cxx index 83b74babf48b..c6b1785a9057 100644 --- a/ucb/source/ucp/hierarchy/hierarchyuri.cxx +++ b/ucb/source/ucp/hierarchy/hierarchyuri.cxx @@ -72,8 +72,7 @@ void HierarchyUri::init() const // Scheme is case insensitive. rtl::OUString aScheme = m_aUri.copy( 0, HIERARCHY_URL_SCHEME_LENGTH ).toAsciiLowerCase(); - if ( aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( HIERARCHY_URL_SCHEME ) ) ) + if ( aScheme == HIERARCHY_URL_SCHEME ) { m_aUri = m_aUri.replaceAt( 0, aScheme.getLength(), aScheme ); diff --git a/ucb/source/ucp/odma/odma_content.cxx b/ucb/source/ucp/odma/odma_content.cxx index 8ac01f85e818..6f1042d47278 100644 --- a/ucb/source/ucp/odma/odma_content.cxx +++ b/ucb/source/ucp/odma/odma_content.cxx @@ -221,8 +221,7 @@ uno::Any SAL_CALL Content::execute( { uno::Any aRet; - if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getPropertyValues" ) ) ) + if ( aCommand.Name == "getPropertyValues" ) { ////////////////////////////////////////////////////////////////// // getPropertyValues @@ -243,8 +242,7 @@ uno::Any SAL_CALL Content::execute( aRet <<= getPropertyValues( Properties, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "setPropertyValues" ) ) ) + else if ( aCommand.Name == "setPropertyValues" ) { ////////////////////////////////////////////////////////////////// // setPropertyValues @@ -277,8 +275,7 @@ uno::Any SAL_CALL Content::execute( aRet <<= setPropertyValues( aProperties, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getPropertySetInfo" ) ) ) + else if ( aCommand.Name == "getPropertySetInfo" ) { ////////////////////////////////////////////////////////////////// // getPropertySetInfo @@ -287,8 +284,7 @@ uno::Any SAL_CALL Content::execute( // Note: Implemented by base class. aRet <<= getPropertySetInfo( Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getCommandInfo" ) ) ) + else if ( aCommand.Name == "getCommandInfo" ) { ////////////////////////////////////////////////////////////////// // getCommandInfo @@ -297,8 +293,7 @@ uno::Any SAL_CALL Content::execute( // Note: Implemented by base class. aRet <<= getCommandInfo( Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "open" ) ) ) + else if ( aCommand.Name == "open" ) { ucb::OpenCommandArgument2 aOpenCommand; if ( !( aCommand.Argument >>= aOpenCommand ) ) @@ -440,8 +435,7 @@ uno::Any SAL_CALL Content::execute( -1 ) ), Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "insert" ) ) ) + else if ( aCommand.Name == "insert" ) { ////////////////////////////////////////////////////////////////// // insert @@ -522,8 +516,7 @@ uno::Any SAL_CALL Content::execute( // imported. getContentProvider()->saveDocument(aProp->m_sDocumentId); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getCasePreservingURL" ) ) ) + else if ( aCommand.Name == "getCasePreservingURL" ) { rtl::OUString CasePreservingURL = openDoc(); aRet <<= CasePreservingURL; @@ -605,53 +598,43 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Process Core properties. - if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) ) + if ( rProp.Name == "ContentType" ) { xRow->appendString ( rProp, rData->m_sContentType ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) + else if ( rProp.Name == "Title" ) { xRow->appendString ( rProp, rData->m_sTitle ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) ) + else if ( rProp.Name == "IsDocument" ) { xRow->appendBoolean( rProp, rData->m_bIsDocument ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ) + else if ( rProp.Name == "IsFolder" ) { xRow->appendBoolean( rProp, rData->m_bIsFolder ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "DateCreated" ) ) ) + else if ( rProp.Name == "DateCreated" ) { xRow->appendTimestamp( rProp, rData->m_aDateCreated ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "DateModified" ) ) ) + else if ( rProp.Name == "DateModified" ) { xRow->appendTimestamp( rProp, rData->m_aDateModified ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsReadOnly" ) ) ) + else if ( rProp.Name == "IsReadOnly" ) { xRow->appendBoolean( rProp, rData->m_bIsReadOnly ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Author" ) ) ) + else if ( rProp.Name == "Author" ) { xRow->appendString ( rProp, rData->m_sAuthor ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Subject" ) ) ) + else if ( rProp.Name == "Subject" ) { xRow->appendString ( rProp, rData->m_sSubject ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Keywords" ) ) ) + else if ( rProp.Name == "Keywords" ) { xRow->appendString ( rProp, rData->m_sKeywords ); } diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index 1d323c062e0d..6bd5b0f0b064 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -99,17 +99,10 @@ ContentProperties::ContentProperties( const rtl::OUString& rContentType ) bEncrypted( sal_False ), bHasEncryptedEntries( sal_False ) { - bIsFolder = rContentType.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( PACKAGE_FOLDER_CONTENT_TYPE ) ) - || rContentType.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( PACKAGE_ZIP_FOLDER_CONTENT_TYPE ) ); + bIsFolder = rContentType == PACKAGE_FOLDER_CONTENT_TYPE || rContentType == PACKAGE_ZIP_FOLDER_CONTENT_TYPE; bIsDocument = !bIsFolder; - OSL_ENSURE( bIsFolder || - rContentType.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( PACKAGE_STREAM_CONTENT_TYPE ) ) - || rContentType.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( PACKAGE_ZIP_STREAM_CONTENT_TYPE ) ), + OSL_ENSURE( bIsFolder || rContentType == PACKAGE_STREAM_CONTENT_TYPE || rContentType == PACKAGE_ZIP_STREAM_CONTENT_TYPE, "ContentProperties::ContentProperties - Unknown type!" ); } @@ -474,8 +467,7 @@ uno::Any SAL_CALL Content::execute( { uno::Any aRet; - if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getPropertyValues" ) ) ) + if ( aCommand.Name == "getPropertyValues" ) { ////////////////////////////////////////////////////////////////// // getPropertyValues @@ -496,8 +488,7 @@ uno::Any SAL_CALL Content::execute( aRet <<= getPropertyValues( Properties ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "setPropertyValues" ) ) ) + else if ( aCommand.Name == "setPropertyValues" ) { ////////////////////////////////////////////////////////////////// // setPropertyValues @@ -530,8 +521,7 @@ uno::Any SAL_CALL Content::execute( aRet <<= setPropertyValues( aProperties, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getPropertySetInfo" ) ) ) + else if ( aCommand.Name == "getPropertySetInfo" ) { ////////////////////////////////////////////////////////////////// // getPropertySetInfo @@ -540,8 +530,7 @@ uno::Any SAL_CALL Content::execute( // Note: Implemented by base class. aRet <<= getPropertySetInfo( Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getCommandInfo" ) ) ) + else if ( aCommand.Name == "getCommandInfo" ) { ////////////////////////////////////////////////////////////////// // getCommandInfo @@ -550,8 +539,7 @@ uno::Any SAL_CALL Content::execute( // Note: Implemented by base class. aRet <<= getCommandInfo( Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "open" ) ) ) + else if ( aCommand.Name == "open" ) { ////////////////////////////////////////////////////////////////// // open @@ -572,9 +560,7 @@ uno::Any SAL_CALL Content::execute( aRet = open( aOpenCommand, Environment ); } - else if ( !m_aUri.isRootFolder() - && aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "insert" ) ) ) + else if ( !m_aUri.isRootFolder() && aCommand.Name == "insert" ) { ////////////////////////////////////////////////////////////////// // insert @@ -598,9 +584,7 @@ uno::Any SAL_CALL Content::execute( : ucb::NameClash::ERROR; insert( aArg.Data, nNameClash, Environment ); } - else if ( !m_aUri.isRootFolder() - && aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "delete" ) ) ) + else if ( !m_aUri.isRootFolder() && aCommand.Name == "delete" ) { ////////////////////////////////////////////////////////////////// // delete @@ -635,8 +619,7 @@ uno::Any SAL_CALL Content::execute( // Remove own and all children's Additional Core Properties. removeAdditionalPropertySet( sal_True ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "transfer" ) ) ) + else if ( aCommand.Name == "transfer" ) { ////////////////////////////////////////////////////////////////// // transfer @@ -658,9 +641,7 @@ uno::Any SAL_CALL Content::execute( transfer( aInfo, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "createNewContent" ) ) && - isFolder() ) + else if ( aCommand.Name == "createNewContent" && isFolder() ) { ////////////////////////////////////////////////////////////////// // createNewContent @@ -683,8 +664,7 @@ uno::Any SAL_CALL Content::execute( aRet <<= createNewContent( aInfo ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "flush" ) ) ) + else if ( aCommand.Name == "flush" ) { ////////////////////////////////////////////////////////////////// // flush @@ -869,41 +849,34 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Process Core properties. - if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) ) + if ( rProp.Name == "ContentType" ) { xRow->appendString ( rProp, rData.aContentType ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) + else if ( rProp.Name == "Title" ) { xRow->appendString ( rProp, rData.aTitle ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) ) + else if ( rProp.Name == "IsDocument" ) { xRow->appendBoolean( rProp, rData.bIsDocument ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ) + else if ( rProp.Name == "IsFolder" ) { xRow->appendBoolean( rProp, rData.bIsFolder ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + else if ( rProp.Name == "CreatableContentsInfo" ) { xRow->appendObject( rProp, uno::makeAny( rData.getCreatableContentsInfo( PackageUri( rContentId ) ) ) ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) + else if ( rProp.Name == "MediaType" ) { xRow->appendString ( rProp, rData.aMediaType ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) + else if ( rProp.Name == "Size" ) { // Property only available for streams. if ( rData.bIsDocument ) @@ -911,8 +884,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( else xRow->appendVoid( rProp ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Compressed" ) ) ) + else if ( rProp.Name == "Compressed" ) { // Property only available for streams. if ( rData.bIsDocument ) @@ -920,8 +892,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( else xRow->appendVoid( rProp ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Encrypted" ) ) ) + else if ( rProp.Name == "Encrypted" ) { // Property only available for streams. if ( rData.bIsDocument ) @@ -929,8 +900,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( else xRow->appendVoid( rProp ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "HasEncryptedEntries" ) ) ) + else if ( rProp.Name == "HasEncryptedEntries" ) { // Property only available for root folder. PackageUri aURI( rContentId ); @@ -1125,8 +1095,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( { const beans::PropertyValue& rValue = pValues[ n ]; - if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) ) + if ( rValue.Name == "ContentType" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1134,8 +1103,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) ) + else if ( rValue.Name == "IsDocument" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1143,8 +1111,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ) + else if ( rValue.Name == "IsFolder" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1152,8 +1119,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + else if ( rValue.Name == "CreatableContentsInfo" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1161,8 +1127,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) + else if ( rValue.Name == "Title" ) { if ( m_aUri.isRootFolder() ) { @@ -1214,8 +1179,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( } } } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) + else if ( rValue.Name == "MediaType" ) { rtl::OUString aNewValue; if ( rValue.Value >>= aNewValue ) @@ -1240,8 +1204,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( static_cast< cppu::OWeakObject * >( this ) ); } } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) + else if ( rValue.Name == "Size" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1249,8 +1212,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Compressed" ) ) ) + else if ( rValue.Name == "Compressed" ) { // Property only available for streams. if ( m_aProps.bIsDocument ) @@ -1286,8 +1248,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( static_cast< cppu::OWeakObject * >( this ) ); } } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Encrypted" ) ) ) + else if ( rValue.Name == "Encrypted" ) { // Property only available for streams. if ( m_aProps.bIsDocument ) @@ -1323,8 +1284,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( static_cast< cppu::OWeakObject * >( this ) ); } } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "HasEncryptedEntries" ) ) ) + else if ( rValue.Name == "HasEncryptedEntries" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1332,8 +1292,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "EncryptionKey" ) ) ) + else if ( rValue.Name == "EncryptionKey" ) { // @@@ This is a temporary solution. In the future submitting // the key should be done using an interaction handler! @@ -2034,8 +1993,7 @@ void Content::transfer( rValue.Name = rProp.Name; rValue.Handle = rProp.Handle; - if ( !bHadTitle && rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) + if ( !bHadTitle && rProp.Name == "Title" ) { // Set new title instead of original. bHadTitle = sal_True; diff --git a/ucb/source/ucp/package/pkguri.cxx b/ucb/source/ucp/package/pkguri.cxx index 3f69681ee5ff..582bde364b08 100644 --- a/ucb/source/ucp/package/pkguri.cxx +++ b/ucb/source/ucp/package/pkguri.cxx @@ -119,13 +119,9 @@ void PackageUri::init() const m_aScheme = aPureUri.copy( 0, PACKAGE_URL_SCHEME_LENGTH ).toAsciiLowerCase(); - if ( m_aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( PACKAGE_URL_SCHEME ) ) - || m_aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( PACKAGE_ZIP_URL_SCHEME ) ) ) + if ( m_aScheme == PACKAGE_URL_SCHEME || m_aScheme == PACKAGE_ZIP_URL_SCHEME ) { - if ( m_aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( PACKAGE_ZIP_URL_SCHEME ) ) ) + if ( m_aScheme == PACKAGE_ZIP_URL_SCHEME ) { m_aParam += ( !m_aParam.isEmpty() diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index a8634a6d1f87..6f9d6c422380 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -81,17 +81,13 @@ using namespace tdoc_ucp; //========================================================================= static ContentType lcl_getContentType( const rtl::OUString & rType ) { - if ( rType.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( TDOC_ROOT_CONTENT_TYPE ) ) ) + if ( rType == TDOC_ROOT_CONTENT_TYPE ) return ROOT; - else if ( rType.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( TDOC_DOCUMENT_CONTENT_TYPE ) ) ) + else if ( rType == TDOC_DOCUMENT_CONTENT_TYPE ) return DOCUMENT; - else if ( rType.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( TDOC_FOLDER_CONTENT_TYPE ) ) ) + else if ( rType == TDOC_FOLDER_CONTENT_TYPE ) return FOLDER; - else if ( rType.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( TDOC_STREAM_CONTENT_TYPE ) ) ) + else if ( rType == TDOC_STREAM_CONTENT_TYPE ) return STREAM; else { @@ -135,10 +131,7 @@ Content* Content::create( if ( Info.Type.isEmpty() ) return 0; - if ( !Info.Type.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( TDOC_FOLDER_CONTENT_TYPE ) ) && - !Info.Type.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( TDOC_STREAM_CONTENT_TYPE ) ) ) + if ( Info.Type != TDOC_FOLDER_CONTENT_TYPE && Info.Type != TDOC_STREAM_CONTENT_TYPE ) { OSL_FAIL( "Content::create - unsupported content type!" ); return 0; @@ -395,8 +388,7 @@ uno::Any SAL_CALL Content::execute( { uno::Any aRet; - if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getPropertyValues" ) ) ) + if ( aCommand.Name == "getPropertyValues" ) { ////////////////////////////////////////////////////////////////// // getPropertyValues @@ -417,8 +409,7 @@ uno::Any SAL_CALL Content::execute( aRet <<= getPropertyValues( Properties ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "setPropertyValues" ) ) ) + else if ( aCommand.Name == "setPropertyValues" ) { ////////////////////////////////////////////////////////////////// // setPropertyValues @@ -451,8 +442,7 @@ uno::Any SAL_CALL Content::execute( aRet <<= setPropertyValues( aProperties, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getPropertySetInfo" ) ) ) + else if ( aCommand.Name == "getPropertySetInfo" ) { ////////////////////////////////////////////////////////////////// // getPropertySetInfo @@ -460,8 +450,7 @@ uno::Any SAL_CALL Content::execute( aRet <<= getPropertySetInfo( Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getCommandInfo" ) ) ) + else if ( aCommand.Name == "getCommandInfo" ) { ////////////////////////////////////////////////////////////////// // getCommandInfo @@ -469,8 +458,7 @@ uno::Any SAL_CALL Content::execute( aRet <<= getCommandInfo( Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "open" ) ) ) + else if ( aCommand.Name == "open" ) { ////////////////////////////////////////////////////////////////// // open @@ -491,8 +479,7 @@ uno::Any SAL_CALL Content::execute( aRet = open( aOpenCommand, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "insert" ) ) ) + else if ( aCommand.Name == "insert" ) { ////////////////////////////////////////////////////////////////// // insert ( Supported by folders and streams only ) @@ -551,8 +538,7 @@ uno::Any SAL_CALL Content::execute( : ucb::NameClash::ERROR; insert( aArg.Data, nNameClash, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "delete" ) ) ) + else if ( aCommand.Name == "delete" ) { ////////////////////////////////////////////////////////////////// // delete ( Supported by folders and streams only ) @@ -606,8 +592,7 @@ uno::Any SAL_CALL Content::execute( // Remove own and all children's Additional Core Properties. removeAdditionalPropertySet( sal_True ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "transfer" ) ) ) + else if ( aCommand.Name == "transfer" ) { ////////////////////////////////////////////////////////////////// // transfer ( Supported by document and folders only ) @@ -648,8 +633,7 @@ uno::Any SAL_CALL Content::execute( transfer( aInfo, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "createNewContent" ) ) ) + else if ( aCommand.Name == "createNewContent" ) { ////////////////////////////////////////////////////////////////// // createNewContent ( Supported by document and folders only ) @@ -742,9 +726,7 @@ Content::createNewContent( const ucb::ContentInfo& Info ) if ( Info.Type.isEmpty() ) return uno::Reference< ucb::XContent >(); - sal_Bool bCreateFolder = - Info.Type.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( TDOC_FOLDER_CONTENT_TYPE ) ); + sal_Bool bCreateFolder = Info.Type == TDOC_FOLDER_CONTENT_TYPE; #ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT // streams cannot be created as direct children of document root @@ -755,9 +737,7 @@ Content::createNewContent( const ucb::ContentInfo& Info ) return uno::Reference< ucb::XContent >(); } #endif - if ( !bCreateFolder && - !Info.Type.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( TDOC_STREAM_CONTENT_TYPE ) ) ) + if ( !bCreateFolder && Info.Type != TDOC_STREAM_CONTENT_TYPE ) { OSL_FAIL( "Content::createNewContent - unsupported type!" ); return uno::Reference< ucb::XContent >(); @@ -1008,34 +988,28 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Process Core properties. - if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) ) + if ( rProp.Name == "ContentType" ) { xRow->appendString ( rProp, rData.getContentType() ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) + else if ( rProp.Name == "Title" ) { xRow->appendString ( rProp, rData.getTitle() ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) ) + else if ( rProp.Name == "IsDocument" ) { xRow->appendBoolean( rProp, rData.getIsDocument() ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ) + else if ( rProp.Name == "IsFolder" ) { xRow->appendBoolean( rProp, rData.getIsFolder() ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + else if ( rProp.Name == "CreatableContentsInfo" ) { xRow->appendObject( rProp, uno::makeAny( rData.getCreatableContentsInfo() ) ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Storage" ) ) ) + else if ( rProp.Name == "Storage" ) { // Storage is only supported by folders. ContentType eType = rData.getType(); @@ -1047,8 +1021,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( else xRow->appendVoid( rProp ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "DocumentModel" ) ) ) + else if ( rProp.Name == "DocumentModel" ) { // DocumentModel is only supported by documents. ContentType eType = rData.getType(); @@ -1221,8 +1194,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( { const beans::PropertyValue& rValue = pValues[ n ]; - if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) ) + if ( rValue.Name == "ContentType" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1230,8 +1202,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) ) + else if ( rValue.Name == "IsDocument" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1239,8 +1210,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ) + else if ( rValue.Name == "IsFolder" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1248,8 +1218,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + else if ( rValue.Name == "CreatableContentsInfo" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1257,8 +1226,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) + else if ( rValue.Name == "Title" ) { // Title is read-only for root and documents. ContentType eType = m_aProps.getType(); @@ -1311,8 +1279,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( } } } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Storage" ) ) ) + else if ( rValue.Name == "Storage" ) { ContentType eType = m_aProps.getType(); if ( eType == FOLDER ) @@ -1331,8 +1298,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( static_cast< cppu::OWeakObject * >( this ) ); } } - else if ( rValue.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "DocumentModel" ) ) ) + else if ( rValue.Name == "DocumentModel" ) { ContentType eType = m_aProps.getType(); if ( eType == DOCUMENT ) @@ -2037,8 +2003,7 @@ void Content::transfer( rtl::OUString aScheme = rInfo.SourceURL.copy( 0, TDOC_URL_SCHEME_LENGTH + 2 ) .toAsciiLowerCase(); - if ( !aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( TDOC_URL_SCHEME ":/" ) ) ) + if ( aScheme != TDOC_URL_SCHEME ":/" ) { // Invalid scheme. ucbhelper::cancelCommandExecution( diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx index e9f064e26519..6bd7063b178c 100644 --- a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx +++ b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx @@ -200,10 +200,8 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( Events documentation: OOo Developer's Guide / Writing UNO Components / Jobs */ - if ( Event.EventName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "OnLoadFinished" ) ) // document loaded - || Event.EventName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "OnCreate" ) ) ) // document created + if ( Event.EventName == "OnLoadFinished" // document loaded + || Event.EventName == "OnCreate" ) // document created { if ( isOfficeDocument( Event.Source ) ) { @@ -259,8 +257,7 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( } } } - else if ( Event.EventName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "OfficeDocumentsListener::notifyClosing" ) ) ) + else if ( Event.EventName == "OfficeDocumentsListener::notifyClosing" ) { if ( isOfficeDocument( Event.Source ) ) { @@ -314,8 +311,7 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( } } } - else if ( Event.EventName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "OnSaveDone" ) ) ) + else if ( Event.EventName == "OnSaveDone" ) { if ( isOfficeDocument( Event.Source ) ) { @@ -350,8 +346,7 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( "OnSaveDone event notified for unknown document!" ); } } - else if ( Event.EventName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "OnSaveAsDone" ) ) ) + else if ( Event.EventName == "OnSaveAsDone" ) { if ( isOfficeDocument( Event.Source ) ) { @@ -389,8 +384,7 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( "OnSaveAsDone event notified for unknown document!" ); } } - else if ( Event.EventName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "OnTitleChanged" ) ) ) + else if ( Event.EventName == "OnTitleChanged" ) { if ( isOfficeDocument( Event.Source ) ) { @@ -744,8 +738,7 @@ bool OfficeDocumentsManager::isBasicIDE( if ( !aModule.isEmpty() ) { // Filter unwanted items, that are no real documents. - if ( aModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( - "com.sun.star.script.BasicIDE" ) ) ) + if ( aModule == "com.sun.star.script.BasicIDE" ) { return true; } diff --git a/ucb/source/ucp/tdoc/tdoc_uri.cxx b/ucb/source/ucp/tdoc/tdoc_uri.cxx index 5da084d9de41..ce670c29cd7d 100644 --- a/ucb/source/ucp/tdoc/tdoc_uri.cxx +++ b/ucb/source/ucp/tdoc/tdoc_uri.cxx @@ -65,8 +65,7 @@ void Uri::init() const // Check for proper scheme. (Scheme is case insensitive.) rtl::OUString aScheme = m_aUri.copy( 0, TDOC_URL_SCHEME_LENGTH ).toAsciiLowerCase(); - if ( !aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( TDOC_URL_SCHEME ) ) ) + if ( aScheme != TDOC_URL_SCHEME ) { // Invaild scheme. return; diff --git a/ucb/source/ucp/webdav/ContentProperties.cxx b/ucb/source/ucp/webdav/ContentProperties.cxx index 0147bb745e65..39d0a1980fb7 100644 --- a/ucb/source/ucp/webdav/ContentProperties.cxx +++ b/ucb/source/ucp/webdav/ContentProperties.cxx @@ -247,16 +247,12 @@ void ContentProperties::UCBNamesToDAVNames( { const beans::Property & rProp = rProps[ n ]; - if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) + if ( rProp.Name == "Title" ) { // Title is always obtained from resource's URI. continue; } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "DateCreated" ) ) - || - ( rProp.Name == DAVProperties::CREATIONDATE ) ) + else if ( rProp.Name == "DateCreated" || rProp.Name == DAVProperties::CREATIONDATE ) { if ( !bCreationDate ) { @@ -264,10 +260,7 @@ void ContentProperties::UCBNamesToDAVNames( bCreationDate = sal_True; } } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "DateModified" ) ) - || - ( rProp.Name == DAVProperties::GETLASTMODIFIED ) ) + else if ( rProp.Name == "DateModified" || rProp.Name == DAVProperties::GETLASTMODIFIED ) { if ( !bLastModified ) { @@ -276,10 +269,7 @@ void ContentProperties::UCBNamesToDAVNames( bLastModified = sal_True; } } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) - || - ( rProp.Name == DAVProperties::GETCONTENTTYPE ) ) + else if ( rProp.Name == "MediaType" || rProp.Name == DAVProperties::GETCONTENTTYPE ) { if ( !bContentType ) { @@ -288,10 +278,7 @@ void ContentProperties::UCBNamesToDAVNames( bContentType = sal_True; } } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Size" ) ) - || - ( rProp.Name == DAVProperties::GETCONTENTLENGTH ) ) + else if ( rProp.Name == "Size" || rProp.Name == DAVProperties::GETCONTENTLENGTH ) { if ( !bContentLength ) { @@ -300,16 +287,7 @@ void ContentProperties::UCBNamesToDAVNames( bContentLength = sal_True; } } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) - || - rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) - || - rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) - || - ( rProp.Name == DAVProperties::RESOURCETYPE ) ) + else if ( rProp.Name == "ContentType" || rProp.Name == "IsDocument" || rProp.Name == "IsFolder" || rProp.Name == DAVProperties::RESOURCETYPE ) { if ( !bResourceType ) { @@ -347,20 +325,17 @@ void ContentProperties::UCBNamesToHTTPNames( { const beans::Property & rProp = rProps[ n ]; - if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "DateModified" ) ) ) + if ( rProp.Name == "DateModified" ) { propertyNames.push_back( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Last-Modified")) ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) + else if ( rProp.Name == "MediaType" ) { propertyNames.push_back( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Content-Type")) ); } - else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) + else if ( rProp.Name == "Size" ) { propertyNames.push_back( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Content-Length")) ); @@ -460,8 +435,7 @@ void ContentProperties::addProperty( const rtl::OUString & rName, (*m_xProps)[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Size")) ] = PropertyValue( uno::makeAny( aValue.toInt64() ), true ); } - else if ( rName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Content-Length" ) ) ) + else if ( rName == "Content-Length" ) { // Do NOT map Content-Lenght entity header to DAV:getcontentlength! // Only DAV resources have this property. @@ -502,8 +476,7 @@ void ContentProperties::addProperty( const rtl::OUString & rName, (*m_xProps)[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DateModified")) ] = PropertyValue( uno::makeAny( aDate ), true ); } - else if ( rName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Last-Modified" ) ) ) + else if ( rName == "Last-Modified" ) { // Do not map Last-Modified entity header to DAV:getlastmodified! // Only DAV resources have this property. diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx index b80d665aeaca..e69aaf94cf07 100644 --- a/ucb/source/ucp/webdav/NeonSession.cxx +++ b/ucb/source/ucp/webdav/NeonSession.cxx @@ -1677,8 +1677,7 @@ void NeonSession::abort() // ------------------------------------------------------------------- const ucbhelper::InternetProxyServer & NeonSession::getProxySettings() const { - if ( m_aScheme.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "http" ) ) || - m_aScheme.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "https" ) ) ) + if ( m_aScheme == "http" || m_aScheme == "https" ) { return m_rProxyDecider.getProxy( m_aScheme, m_aHostName, diff --git a/ucb/source/ucp/webdav/NeonUri.cxx b/ucb/source/ucp/webdav/NeonUri.cxx index 6acfb4e51bf1..897e8a6e9c3a 100644 --- a/ucb/source/ucp/webdav/NeonUri.cxx +++ b/ucb/source/ucp/webdav/NeonUri.cxx @@ -221,18 +221,15 @@ void NeonUri::calculateURI () switch ( mPort ) { case DEFAULT_HTTP_PORT: - bAppendPort - = !mScheme.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "http" ) ); + bAppendPort = mScheme != "http"; break; case DEFAULT_HTTPS_PORT: - bAppendPort - = !mScheme.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "https" ) ); + bAppendPort = mScheme != "https"; break; case DEFAULT_FTP_PORT: - bAppendPort - = !mScheme.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ftp" ) ); + bAppendPort = mScheme != "ftp"; break; } if ( bAppendPort ) diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index f5636225fa73..50c182018d10 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -409,8 +409,7 @@ uno::Any SAL_CALL Content::execute( uno::Any aRet; - if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getPropertyValues" ) ) ) + if ( aCommand.Name == "getPropertyValues" ) { ////////////////////////////////////////////////////////////////// // getPropertyValues @@ -431,8 +430,7 @@ uno::Any SAL_CALL Content::execute( aRet <<= getPropertyValues( Properties, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "setPropertyValues" ) ) ) + else if ( aCommand.Name == "setPropertyValues" ) { ////////////////////////////////////////////////////////////////// // setPropertyValues @@ -465,8 +463,7 @@ uno::Any SAL_CALL Content::execute( aRet <<= setPropertyValues( aProperties, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getPropertySetInfo" ) ) ) + else if ( aCommand.Name == "getPropertySetInfo" ) { ////////////////////////////////////////////////////////////////// // getPropertySetInfo @@ -476,8 +473,7 @@ uno::Any SAL_CALL Content::execute( aRet <<= getPropertySetInfo( Environment, sal_False /* don't cache data */ ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "getCommandInfo" ) ) ) + else if ( aCommand.Name == "getCommandInfo" ) { ////////////////////////////////////////////////////////////////// // getCommandInfo @@ -486,8 +482,7 @@ uno::Any SAL_CALL Content::execute( // Note: Implemented by base class. aRet <<= getCommandInfo( Environment, sal_False ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "open" ) ) ) + else if ( aCommand.Name == "open" ) { ////////////////////////////////////////////////////////////////// // open @@ -518,8 +513,7 @@ uno::Any SAL_CALL Content::execute( aRet = open( aOpenCommand, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "insert" ) ) ) + else if ( aCommand.Name == "insert" ) { ////////////////////////////////////////////////////////////////// // insert @@ -540,8 +534,7 @@ uno::Any SAL_CALL Content::execute( insert( arg.Data, arg.ReplaceExisting, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "delete" ) ) ) + else if ( aCommand.Name == "delete" ) { ////////////////////////////////////////////////////////////////// // delete @@ -583,9 +576,7 @@ uno::Any SAL_CALL Content::execute( // Remove own and all children's Additional Core Properties. removeAdditionalPropertySet( sal_True ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "transfer" ) ) - && isFolder( Environment ) ) + else if ( aCommand.Name == "transfer" && isFolder( Environment ) ) { ////////////////////////////////////////////////////////////////// // transfer @@ -607,8 +598,7 @@ uno::Any SAL_CALL Content::execute( transfer( transferArgs, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "post" ) ) ) + else if ( aCommand.Name == "post" ) { ////////////////////////////////////////////////////////////////// // post @@ -629,9 +619,7 @@ uno::Any SAL_CALL Content::execute( post( aArg, Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "lock" ) ) && - supportsExclusiveWriteLock( Environment ) ) + else if ( aCommand.Name == "lock" && supportsExclusiveWriteLock( Environment ) ) { ////////////////////////////////////////////////////////////////// // lock @@ -639,9 +627,7 @@ uno::Any SAL_CALL Content::execute( lock( Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "unlock" ) ) && - supportsExclusiveWriteLock( Environment ) ) + else if ( aCommand.Name == "unlock" && supportsExclusiveWriteLock( Environment ) ) { ////////////////////////////////////////////////////////////////// // unlock @@ -649,9 +635,7 @@ uno::Any SAL_CALL Content::execute( unlock( Environment ); } - else if ( aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "createNewContent" ) ) && - isFolder( Environment ) ) + else if ( aCommand.Name == "createNewContent" && isFolder( Environment ) ) { ////////////////////////////////////////////////////////////////// // createNewContent @@ -997,11 +981,7 @@ Content::createNewContent( const ucb::ContentInfo& Info ) if ( Info.Type.isEmpty() ) return uno::Reference< ucb::XContent >(); - if ( ( !Info.Type.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( WEBDAV_COLLECTION_TYPE ) ) ) - && - ( !Info.Type.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( WEBDAV_CONTENT_TYPE ) ) ) ) + if ( ( Info.Type != WEBDAV_COLLECTION_TYPE ) && ( Info.Type != WEBDAV_CONTENT_TYPE ) ) return uno::Reference< ucb::XContent >(); rtl::OUString aURL = m_xIdentifier->getContentIdentifier(); @@ -1013,8 +993,7 @@ Content::createNewContent( const ucb::ContentInfo& Info ) aURL += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); sal_Bool isCollection; - if ( Info.Type.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( WEBDAV_COLLECTION_TYPE ) ) ) + if ( Info.Type == WEBDAV_COLLECTION_TYPE ) { aURL += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("New_Collection")); isCollection = sal_True; @@ -1430,8 +1409,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( for ( sal_Int32 n = 0; n < nCount; ++n ) { const rtl::OUString rName = rProperties[ n ].Name; - if ( rName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "BaseURI" ) ) ) + if ( rName == "BaseURI" ) { // Add BaseURI property, if requested. xProps->addProperty( @@ -1439,8 +1417,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( uno::makeAny( getBaseURI( xResAccess ) ), true ); } - else if ( rName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + else if ( rName == "CreatableContentsInfo" ) { // Add CreatableContentsInfo property, if requested. sal_Bool bFolder = sal_False; @@ -1560,8 +1537,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) ) + else if ( rName == "IsDocument" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1569,8 +1545,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ) + else if ( rName == "IsFolder" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1661,8 +1636,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "DateCreated" ) ) ) + else if ( rName == "DateCreated" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1670,8 +1644,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "DateModified" ) ) ) + else if ( rName == "DateModified" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -1679,8 +1652,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - else if ( rName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) + else if ( rName == "MediaType" ) { // Read-only property! // (but could be writable, if 'getcontenttype' would be) @@ -1689,8 +1661,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" )), static_cast< cppu::OWeakObject * >( this ) ); } - if ( rName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + if ( rName == "CreatableContentsInfo" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -2513,30 +2484,24 @@ void Content::transfer( // Check source's and target's URL scheme // const rtl::OUString aScheme = sourceURI.GetScheme().toAsciiLowerCase(); - if ( aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( WEBDAV_URL_SCHEME ) ) ) + if ( aScheme == WEBDAV_URL_SCHEME ) { sourceURI.SetScheme( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( HTTP_URL_SCHEME )) ); } - else if ( aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( DAV_URL_SCHEME ) ) ) + else if ( aScheme == DAV_URL_SCHEME ) { sourceURI.SetScheme( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( HTTP_URL_SCHEME )) ); } - else if ( aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( DAVS_URL_SCHEME ) ) ) + else if ( aScheme == DAVS_URL_SCHEME ) { sourceURI.SetScheme( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( HTTPS_URL_SCHEME )) ); } else { - if ( !aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( HTTP_URL_SCHEME ) ) && - !aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( HTTPS_URL_SCHEME ) ) ) + if ( aScheme != HTTP_URL_SCHEME && aScheme != HTTPS_URL_SCHEME ) { ucbhelper::cancelCommandExecution( uno::makeAny( @@ -2549,12 +2514,10 @@ void Content::transfer( } } - if ( targetURI.GetScheme().toAsciiLowerCase().equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( WEBDAV_URL_SCHEME ) ) ) + if ( targetURI.GetScheme().toAsciiLowerCase() == WEBDAV_URL_SCHEME ) targetURI.SetScheme( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( HTTP_URL_SCHEME )) ); - else if ( targetURI.GetScheme().toAsciiLowerCase().equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( DAV_URL_SCHEME ) ) ) + else if ( targetURI.GetScheme().toAsciiLowerCase() == DAV_URL_SCHEME ) targetURI.SetScheme( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( HTTP_URL_SCHEME )) ); @@ -3205,8 +3168,7 @@ const Content::ResourceType & Content::getResourceType( const rtl::OUString aScheme( rURL.copy( 0, rURL.indexOf( ':' ) ).toAsciiLowerCase() ); - if ( aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( FTP_URL_SCHEME ) ) ) + if ( aScheme == FTP_URL_SCHEME ) { eResourceType = FTP; } diff --git a/ucb/source/ucp/webdav/webdavcontentcaps.cxx b/ucb/source/ucp/webdav/webdavcontentcaps.cxx index db1047168be7..478dc66a4bb4 100644 --- a/ucb/source/ucp/webdav/webdavcontentcaps.cxx +++ b/ucb/source/ucp/webdav/webdavcontentcaps.cxx @@ -384,64 +384,43 @@ uno::Sequence< beans::Property > Content::getProperties( { bHasGetContentLength = sal_True; } - else if ( !bHasContentType && - (*it).equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) ) + else if ( !bHasContentType && (*it) == "ContentType" ) { bHasContentType = sal_True; } - else if ( !bHasIsDocument && - (*it).equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) ) + else if ( !bHasIsDocument && (*it) == "IsDocument" ) { bHasIsDocument = sal_True; } - else if ( !bHasIsFolder && - (*it).equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ) + else if ( !bHasIsFolder && (*it) == "IsFolder" ) { bHasIsFolder = sal_True; } - else if ( !bHasTitle && - (*it).equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) + else if ( !bHasTitle && (*it) == "Title" ) { bHasTitle = sal_True; } - else if ( !bHasBaseURI && - (*it).equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "BaseURI" ) ) ) + else if ( !bHasBaseURI && (*it) == "BaseURI" ) { bHasBaseURI = sal_True; } - else if ( !bHasDateCreated && - (*it).equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "DateCreated" ) ) ) + else if ( !bHasDateCreated && (*it) == "DateCreated" ) { bHasDateCreated = sal_True; } - else if ( !bHasDateModified && - (*it).equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "DateModified" ) ) ) + else if ( !bHasDateModified && (*it) == "DateModified" ) { bHasDateModified = sal_True; } - else if ( !bHasMediaType && - (*it).equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) + else if ( !bHasMediaType && (*it) == "MediaType" ) { bHasMediaType = sal_True; } - else if ( !bHasSize && - (*it).equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) + else if ( !bHasSize && (*it) == "Size" ) { bHasSize = sal_True; } - else if ( !bHasCreatableInfos && - (*it).equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( - "CreatableContentsInfo" ) ) ) + else if ( !bHasCreatableInfos && (*it) == "CreatableContentsInfo" ) { bHasCreatableInfos = sal_True; } diff --git a/ucb/source/ucp/webdav/webdavprovider.cxx b/ucb/source/ucp/webdav/webdavprovider.cxx index ba24d632c276..c789e120e595 100644 --- a/ucb/source/ucp/webdav/webdavprovider.cxx +++ b/ucb/source/ucp/webdav/webdavprovider.cxx @@ -124,18 +124,8 @@ ContentProvider::queryContent( const rtl::OUString aScheme = Identifier->getContentProviderScheme().toAsciiLowerCase(); - if ( !aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( HTTP_URL_SCHEME ) ) && - !aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( HTTPS_URL_SCHEME ) ) && - !aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( WEBDAV_URL_SCHEME ) ) && - !aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( DAV_URL_SCHEME ) ) && - !aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( DAVS_URL_SCHEME ) ) && - !aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( FTP_URL_SCHEME ) ) ) + if ( aScheme != HTTP_URL_SCHEME && aScheme != HTTPS_URL_SCHEME && aScheme != WEBDAV_URL_SCHEME + && aScheme != DAV_URL_SCHEME && aScheme != DAVS_URL_SCHEME && aScheme != FTP_URL_SCHEME ) throw ucb::IllegalIdentifierException(); // Normalize URL and create new Id, if nessacary. @@ -153,8 +143,7 @@ ContentProvider::queryContent( uno::Reference< ucb::XContentIdentifier > xCanonicId; bool bNewId = false; - if ( aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( WEBDAV_URL_SCHEME ) ) ) + if ( aScheme == WEBDAV_URL_SCHEME ) { aURL = aURL.replaceAt( 0, WEBDAV_URL_SCHEME_LENGTH, @@ -162,8 +151,7 @@ ContentProvider::queryContent( HTTP_URL_SCHEME )) ); bNewId = true; } - else if ( aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( DAV_URL_SCHEME ) ) ) + else if ( aScheme == DAV_URL_SCHEME ) { aURL = aURL.replaceAt( 0, DAV_URL_SCHEME_LENGTH, @@ -171,8 +159,7 @@ ContentProvider::queryContent( HTTP_URL_SCHEME )) ); bNewId = true; } - else if ( aScheme.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( DAVS_URL_SCHEME ) ) ) + else if ( aScheme == DAVS_URL_SCHEME ) { aURL = aURL.replaceAt( 0, DAVS_URL_SCHEME_LENGTH, |