From 55b6485978bbfe17c1355909a5e27d8c846a4ee8 Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Thu, 19 Jan 2012 11:51:58 -0200 Subject: Fix for fdo43460 Part XLI getLength() to isEmpty() Part XLI Modules ucbhelper, unodevtools --- ucbhelper/source/client/content.cxx | 12 ++++++------ ucbhelper/source/client/proxydecider.cxx | 20 ++++++++++---------- ucbhelper/source/provider/contenthelper.cxx | 6 +++--- ucbhelper/source/provider/propertyvalueset.cxx | 2 +- ucbhelper/source/provider/providerhelper.cxx | 6 +++--- ucbhelper/source/provider/resultset.cxx | 8 ++++---- ucbhelper/source/provider/resultsetmetadata.cxx | 2 +- .../source/provider/simpleauthenticationrequest.cxx | 4 ++-- 8 files changed, 30 insertions(+), 30 deletions(-) (limited to 'ucbhelper/source') diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx index 676acd50ded1..59cc3997057e 100644 --- a/ucbhelper/source/client/content.cxx +++ b/ucbhelper/source/client/content.cxx @@ -1094,7 +1094,7 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, Content& rNewContent ) throw( CommandAbortedException, RuntimeException, Exception ) { - if ( rContentType.getLength() == 0 ) + if ( rContentType.isEmpty() ) return sal_False; // First, try it using "createNewContent" command -> the "new" way. @@ -1157,7 +1157,7 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, Content& rNewContent ) throw( CommandAbortedException, RuntimeException, Exception ) { - if ( rContentType.getLength() == 0 ) + if ( rContentType.isEmpty() ) return sal_False; // First, try it using "createNewContent" command -> the "new" way. @@ -1438,11 +1438,11 @@ void Content_Impl::disposing( const EventObject& Source ) //========================================================================= const rtl::OUString& Content_Impl::getURL() const { - if ( !m_aURL.getLength() && m_xContent.is() ) + if ( m_aURL.isEmpty() && m_xContent.is() ) { osl::MutexGuard aGuard( m_aMutex ); - if ( !m_aURL.getLength() && m_xContent.is() ) + if ( m_aURL.isEmpty() && m_xContent.is() ) { Reference< XContentIdentifier > xId = m_xContent->getIdentifier(); if ( xId.is() ) @@ -1456,11 +1456,11 @@ const rtl::OUString& Content_Impl::getURL() const //========================================================================= Reference< XContent > Content_Impl::getContent() { - if ( !m_xContent.is() && m_aURL.getLength() ) + if ( !m_xContent.is() && !m_aURL.isEmpty() ) { osl::MutexGuard aGuard( m_aMutex ); - if ( !m_xContent.is() && m_aURL.getLength() ) + if ( !m_xContent.is() && !m_aURL.isEmpty() ) { ContentBroker* pBroker = ContentBroker::get(); diff --git a/ucbhelper/source/client/proxydecider.cxx b/ucbhelper/source/client/proxydecider.cxx index ffc785e524c8..61fdc12743d1 100644 --- a/ucbhelper/source/client/proxydecider.cxx +++ b/ucbhelper/source/client/proxydecider.cxx @@ -495,7 +495,7 @@ const InternetProxyServer & InternetProxyDecider_Impl::getProxy( return m_aEmptyProxy; } - if ( rHost.getLength() && m_aNoProxyList.size() ) + if ( !rHost.isEmpty() && m_aNoProxyList.size() ) { ////////////////////////////////////////////////////////////////// // First, try direct hostname match - #110515# @@ -532,7 +532,7 @@ const InternetProxyServer & InternetProxyDecider_Impl::getProxy( } // Error resolving name? -> fallback. - if ( !aFullyQualifiedHost.getLength() ) + if ( aFullyQualifiedHost.isEmpty() ) aFullyQualifiedHost = aHost; if ( aFullyQualifiedHost != aHost ) @@ -558,16 +558,16 @@ const InternetProxyServer & InternetProxyDecider_Impl::getProxy( if ( rProtocol.toAsciiLowerCase() .equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ftp" ) ) ) { - if ( m_aFtpProxy.aName.getLength() > 0 && m_aFtpProxy.nPort >= 0 ) + if ( !m_aFtpProxy.aName.isEmpty() && m_aFtpProxy.nPort >= 0 ) return m_aFtpProxy; } else if ( rProtocol.toAsciiLowerCase() .equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "https" ) ) ) { - if ( m_aHttpsProxy.aName.getLength() ) + if ( !m_aHttpsProxy.aName.isEmpty() ) return m_aHttpsProxy; } - else if ( m_aHttpProxy.aName.getLength() ) + else if ( !m_aHttpProxy.aName.isEmpty() ) { // All other protocols use the HTTP proxy. return m_aHttpProxy; @@ -592,7 +592,7 @@ void SAL_CALL InternetProxyDecider_Impl::changesOccurred( { const util::ElementChange& rElem = pElementChanges[ n ]; rtl::OUString aKey; - if ( ( rElem.Accessor >>= aKey ) && aKey.getLength() ) + if ( ( rElem.Accessor >>= aKey ) && !aKey.isEmpty() ) { if ( aKey.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( PROXY_TYPE_KEY ) ) ) @@ -702,7 +702,7 @@ void InternetProxyDecider_Impl::setNoProxyList( m_aNoProxyList.clear(); - if ( rNoProxyList.getLength() ) + if ( !rNoProxyList.isEmpty() ) { // List of connection endpoints hostname[:port], // separated by semicolon. Wilcards allowed. @@ -718,7 +718,7 @@ void InternetProxyDecider_Impl::setNoProxyList( rtl::OUString aToken = rNoProxyList.copy( nPos, nEnd - nPos ); - if ( aToken.getLength() ) + if ( !aToken.isEmpty() ) { rtl::OUString aServer; rtl::OUString aPort; @@ -757,7 +757,7 @@ void InternetProxyDecider_Impl::setNoProxyList( } rtl::OUStringBuffer aFullyQualifiedHost; - if ( aServer.getLength() ) + if ( !aServer.isEmpty() ) { // Remember fully qualified server name if current list // entry specifies exactly one non-fully qualified server @@ -840,7 +840,7 @@ bool InternetProxyDecider::shouldUseProxy( const rtl::OUString & rProtocol, const InternetProxyServer & rData = m_pImpl->getProxy( rProtocol, rHost, nPort ); - return ( rData.aName.getLength() > 0 ); + return !rData.aName.isEmpty(); } //========================================================================= diff --git a/ucbhelper/source/provider/contenthelper.cxx b/ucbhelper/source/provider/contenthelper.cxx index b42291738357..f66acf03ffe9 100644 --- a/ucbhelper/source/provider/contenthelper.cxx +++ b/ucbhelper/source/provider/contenthelper.cxx @@ -458,7 +458,7 @@ void SAL_CALL ContentImplHelper::addPropertiesChangeListener( for ( sal_Int32 n = 0; n < nCount; ++n ) { const rtl::OUString& rName = pSeq[ n ]; - if ( rName.getLength() ) + if ( !rName.isEmpty() ) m_pImpl->m_pPropertyChangeListeners->addInterface( rName, Listener ); } @@ -491,7 +491,7 @@ void SAL_CALL ContentImplHelper::removePropertiesChangeListener( for ( sal_Int32 n = 0; n < nCount; ++n ) { const rtl::OUString& rName = pSeq[ n ]; - if ( rName.getLength() ) + if ( !rName.isEmpty() ) m_pImpl->m_pPropertyChangeListeners->removeInterface( rName, Listener ); } @@ -780,7 +780,7 @@ uno::Reference< uno::XInterface > SAL_CALL ContentImplHelper::getParent() uno::Reference< uno::XInterface > xParent; rtl::OUString aURL = getParentURL(); - if ( aURL.getLength() ) + if ( !aURL.isEmpty() ) { uno::Reference< com::sun::star::ucb::XContentIdentifier > xId( new ContentIdentifier( m_xSMgr, aURL ) ); diff --git a/ucbhelper/source/provider/propertyvalueset.cxx b/ucbhelper/source/provider/propertyvalueset.cxx index 7e89d458a5e7..0ade2fe10a90 100644 --- a/ucbhelper/source/provider/propertyvalueset.cxx +++ b/ucbhelper/source/provider/propertyvalueset.cxx @@ -612,7 +612,7 @@ sal_Int32 SAL_CALL PropertyValueSet::findColumn( const OUString& columnName ) { osl::MutexGuard aGuard( m_aMutex ); - if ( columnName.getLength() ) + if ( !columnName.isEmpty() ) { sal_Int32 nCount = m_pValues->size(); for ( sal_Int32 n = 0; n < nCount; ++n ) diff --git a/ucbhelper/source/provider/providerhelper.cxx b/ucbhelper/source/provider/providerhelper.cxx index d161d93269d3..fd6cd8f0daa1 100644 --- a/ucbhelper/source/provider/providerhelper.cxx +++ b/ucbhelper/source/provider/providerhelper.cxx @@ -403,7 +403,7 @@ sal_Bool ContentProviderImplHelper::renameAdditionalPropertySet( aOldKeyWithSlash += rtl::OUString( sal_Unicode('/') ); aOldKeyWithoutSlash = rOldKey; } - else if ( rOldKey.getLength() ) + else if ( !rOldKey.isEmpty() ) aOldKeyWithoutSlash = rOldKey.copy( 0, rOldKey.getLength() - 1 ); @@ -490,7 +490,7 @@ sal_Bool ContentProviderImplHelper::copyAdditionalPropertySet( aSrcKeyWithSlash += rtl::OUString( sal_Unicode('/') ); aSrcKeyWithoutSlash = rSourceKey; } - else if ( rSourceKey.getLength() ) + else if ( !rSourceKey.isEmpty() ) aSrcKeyWithoutSlash = rSourceKey.copy( 0, rSourceKey.getLength() - 1 ); @@ -629,7 +629,7 @@ sal_Bool ContentProviderImplHelper::removeAdditionalPropertySet( aKeyWithSlash += rtl::OUString( (sal_Unicode)'/' ); aKeyWithoutSlash = rKey; } - else if ( rKey.getLength() ) + else if ( !rKey.isEmpty() ) aKeyWithoutSlash = rKey.copy( 0, rKey.getLength() - 1 ); diff --git a/ucbhelper/source/provider/resultset.cxx b/ucbhelper/source/provider/resultset.cxx index e355ee8e7ca4..6a6cb5ec09ab 100644 --- a/ucbhelper/source/provider/resultset.cxx +++ b/ucbhelper/source/provider/resultset.cxx @@ -1352,7 +1352,7 @@ void SAL_CALL ResultSet::setPropertyValue( const rtl::OUString& aPropertyName, lang::WrappedTargetException, uno::RuntimeException ) { - if ( !aPropertyName.getLength() ) + if ( aPropertyName.isEmpty() ) throw beans::UnknownPropertyException(); if ( aPropertyName.equals( @@ -1381,7 +1381,7 @@ uno::Any SAL_CALL ResultSet::getPropertyValue( lang::WrappedTargetException, uno::RuntimeException ) { - if ( !PropertyName.getLength() ) + if ( PropertyName.isEmpty() ) throw beans::UnknownPropertyException(); uno::Any aValue; @@ -1417,7 +1417,7 @@ void SAL_CALL ResultSet::addPropertyChangeListener( osl::MutexGuard aGuard( m_pImpl->m_aMutex ); - if ( aPropertyName.getLength() && + if ( !aPropertyName.isEmpty() && !aPropertyName.equals( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RowCount")) ) && !aPropertyName.equals( @@ -1443,7 +1443,7 @@ void SAL_CALL ResultSet::removePropertyChangeListener( { osl::MutexGuard aGuard( m_pImpl->m_aMutex ); - if ( aPropertyName.getLength() && + if ( !aPropertyName.isEmpty() && !aPropertyName.equals( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RowCount")) ) && !aPropertyName.equals( diff --git a/ucbhelper/source/provider/resultsetmetadata.cxx b/ucbhelper/source/provider/resultsetmetadata.cxx index 0166edfecb2a..2417e3745837 100644 --- a/ucbhelper/source/provider/resultsetmetadata.cxx +++ b/ucbhelper/source/provider/resultsetmetadata.cxx @@ -273,7 +273,7 @@ OUString SAL_CALL ResultSetMetaData::getColumnLabel( sal_Int32 column ) return OUString(); OUString aLabel = m_pImpl->m_aColumnData[ column - 1 ].columnLabel; - if ( aLabel.getLength() ) + if ( !aLabel.isEmpty() ) return aLabel; return m_aProps.getConstArray()[ column - 1 ].Name; diff --git a/ucbhelper/source/provider/simpleauthenticationrequest.cxx b/ucbhelper/source/provider/simpleauthenticationrequest.cxx index f9353653b87b..c3974468ce5e 100644 --- a/ucbhelper/source/provider/simpleauthenticationrequest.cxx +++ b/ucbhelper/source/provider/simpleauthenticationrequest.cxx @@ -52,14 +52,14 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest( aRequest.Classification = task::InteractionClassification_ERROR; aRequest.ServerName = rServerName; // aRequest.Diagnostic = // OUString - aRequest.HasRealm = ( rRealm.getLength() > 0 ); + aRequest.HasRealm = !rRealm.isEmpty(); if ( aRequest.HasRealm ) aRequest.Realm = rRealm; aRequest.HasUserName = sal_True; aRequest.UserName = rUserName; aRequest.HasPassword = sal_True; aRequest.Password = rPassword; - aRequest.HasAccount = ( rAccount.getLength() > 0 ); + aRequest.HasAccount = !rAccount.isEmpty(); if ( aRequest.HasAccount ) aRequest.Account = rAccount; aRequest.URL = rURL; -- cgit