diff options
author | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-01-19 11:51:58 -0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-01-19 22:07:58 -0200 |
commit | 55b6485978bbfe17c1355909a5e27d8c846a4ee8 (patch) | |
tree | 2581d37bd207a65aa062bcff7576a93f99cbafe0 | |
parent | 688551303ee5b918841b64ac85f06ab12989b7fc (diff) |
Fix for fdo43460 Part XLI getLength() to isEmpty()
Part XLI
Modules
ucbhelper, unodevtools
-rw-r--r-- | ucbhelper/source/client/content.cxx | 12 | ||||
-rw-r--r-- | ucbhelper/source/client/proxydecider.cxx | 20 | ||||
-rw-r--r-- | ucbhelper/source/provider/contenthelper.cxx | 6 | ||||
-rw-r--r-- | ucbhelper/source/provider/propertyvalueset.cxx | 2 | ||||
-rw-r--r-- | ucbhelper/source/provider/providerhelper.cxx | 6 | ||||
-rw-r--r-- | ucbhelper/source/provider/resultset.cxx | 8 | ||||
-rw-r--r-- | ucbhelper/source/provider/resultsetmetadata.cxx | 2 | ||||
-rw-r--r-- | ucbhelper/source/provider/simpleauthenticationrequest.cxx | 4 | ||||
-rw-r--r-- | unodevtools/source/skeletonmaker/cppcompskeleton.cxx | 10 | ||||
-rw-r--r-- | unodevtools/source/skeletonmaker/cpptypemaker.cxx | 18 | ||||
-rw-r--r-- | unodevtools/source/skeletonmaker/javacompskeleton.cxx | 4 | ||||
-rw-r--r-- | unodevtools/source/skeletonmaker/javatypemaker.cxx | 6 | ||||
-rw-r--r-- | unodevtools/source/skeletonmaker/skeletoncommon.cxx | 2 | ||||
-rw-r--r-- | unodevtools/source/unodevtools/typeblob.cxx | 2 |
14 files changed, 51 insertions, 51 deletions
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; diff --git a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx index 97ba560658cd..57b46137a70c 100644 --- a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx +++ b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx @@ -572,7 +572,7 @@ void generateAddinConstructorAndHelper(std::ostream& o, "throw (css::uno::RuntimeException)\n{\n" " ::rtl::OUString ret;\n try {\n " "::rtl::OUStringBuffer buf(funcName);\n" - " if (paramName.getLength() > 0) {\n" + " if (!paramName.isEmpty()) {\n" " buf.appendAscii(\"/Parameters/\");\n" " buf.append(paramName);\n }\n\n" " css::uno::Reference< css::beans::XPropertySet > xPropSet(\n" @@ -924,14 +924,14 @@ void generateQueryInterface(std::ostream& o, OString const & classname, OString const & propertyhelper) { - if (propertyhelper.getLength() == 0) + if (propertyhelper.isEmpty()) return; o << "css::uno::Any " << classname << "::queryInterface(css::uno::Type const & type) throw (" "css::uno::RuntimeException)\n{\n "; - if (propertyhelper.getLength() >= 1) + if (!propertyhelper.isEmpty()) o << "return "; else o << "css::uno::Any a("; @@ -949,7 +949,7 @@ void generateQueryInterface(std::ostream& o, o << ">"; } - if (propertyhelper.getLength() >= 1) { + if (!propertyhelper.isEmpty()) { o << "::queryInterface(type);\n"; } else { o << "::queryInterface(type));\n"; @@ -1160,7 +1160,7 @@ void generateCalcAddin(ProgramOptions const & options, OString propertyhelper = checkPropertyHelper( options, manager, services, interfaces, attributes, propinterfaces); - if (propertyhelper.getLength() > 0) + if (!propertyhelper.isEmpty()) std::cerr << "WARNING: interfaces specifying calc add-in functions " "shouldn't support attributes!\n"; diff --git a/unodevtools/source/skeletonmaker/cpptypemaker.cxx b/unodevtools/source/skeletonmaker/cpptypemaker.cxx index a9d21d7c7dac..d68196dee62e 100644 --- a/unodevtools/source/skeletonmaker/cpptypemaker.cxx +++ b/unodevtools/source/skeletonmaker/cpptypemaker.cxx @@ -394,7 +394,7 @@ void printMethods(std::ostream & o, } static OString sd(RTL_CONSTASCII_STRINGPARAM("_")); - bool body = ((delegate.getLength() > 0) ? true : false); + bool body = !delegate.isEmpty(); bool defaultbody = ((delegate.equals(sd)) ? true : false); if (body && propertyhelper.getLength() > 1) { @@ -496,7 +496,7 @@ void printMethods(std::ostream & o, printType(o, options, manager, codemaker::convertString(reader.getFieldTypeName(i)), 1); o << " SAL_CALL "; - if (classname.getLength() > 0) + if (!classname.isEmpty()) o << classname; o << "get" @@ -513,7 +513,7 @@ void printMethods(std::ostream & o, } if (body) { if (defaultbody) { - if (propertyhelper.getLength() > 0) { + if (!propertyhelper.isEmpty()) { o << "\n{\n osl::MutexGuard g(m_aMutex);\n return m_" << codemaker::convertString(reader.getFieldName(i)).getStr() << ";\n}\n\n"; @@ -547,7 +547,7 @@ void printMethods(std::ostream & o, o << "virtual "; o << "void SAL_CALL "; - if (classname.getLength() > 0) + if (!classname.isEmpty()) o << classname; o << "set" @@ -567,7 +567,7 @@ void printMethods(std::ostream & o, } if (body) { if (defaultbody) { - if (propertyhelper.getLength() > 0) { + if (!propertyhelper.isEmpty()) { printSetPropertyMixinBody(o, reader, i, method); } else { if (options.componenttype == 1) { @@ -599,7 +599,7 @@ void printMethods(std::ostream & o, codemaker::convertString( reader.getMethodReturnTypeName(method)), 1); o << " SAL_CALL "; - if (classname.getLength() > 0) + if (!classname.isEmpty()) o << classname; const OString methodName(codemaker::convertString(reader.getMethodName(method))); @@ -662,7 +662,7 @@ void printConstructionMethods(std::ostream & o, options, manager, codemaker::convertString(reader.getSuperTypeName(0)), 1); o << ' '; - if (reader.getMethodName(i).getLength() == 0) { + if (reader.getMethodName(i).isEmpty()) { o << "create"; } else { o << (codemaker::cpp::translateUnoToCppIdentifier( @@ -701,7 +701,7 @@ void printServiceMembers(std::ostream & o, } } - if (delegate.getLength() == 0) { + if (delegate.isEmpty()) { o << "\n// properties of service \""<< type.getStr() << "\"\n"; for (sal_uInt16 i = 0; i < reader.getFieldCount(); ++i) { OString fieldName( @@ -755,7 +755,7 @@ void generateDocumentation(std::ostream & o, &arguments); bool comment=true; - if (delegate.getLength() > 0) { + if (!delegate.isEmpty()) { if (typeClass != RT_TYPE_INTERFACE && typeClass != RT_TYPE_SERVICE ) { diff --git a/unodevtools/source/skeletonmaker/javacompskeleton.cxx b/unodevtools/source/skeletonmaker/javacompskeleton.cxx index 1b71276af7d4..5b5a86c021d4 100644 --- a/unodevtools/source/skeletonmaker/javacompskeleton.cxx +++ b/unodevtools/source/skeletonmaker/javacompskeleton.cxx @@ -66,7 +66,7 @@ void generateImports(std::ostream & o, ProgramOptions const & options, else o << "import com.sun.star.lib.uno.helper.WeakBase;\n"; } - if (propertyhelper.getLength() > 0) { + if (!propertyhelper.isEmpty()) { if (propertyhelper.equals("_")) { o << "import com.sun.star.lib.uno.helper.PropertySet;\n"; o << "import com.sun.star.beans.PropertyAttribute;\n"; @@ -938,7 +938,7 @@ void generateSkeleton(ProgramOptions const & options, checkDefaultInterfaces(interfaces, services, propertyhelper); if (options.componenttype == 2) { - if (propertyhelper.getLength() > 0) + if (!propertyhelper.isEmpty()) std::cerr << "WARNING: interfaces specifying calc add-in functions " "shouldn't support attributes!\n"; } diff --git a/unodevtools/source/skeletonmaker/javatypemaker.cxx b/unodevtools/source/skeletonmaker/javatypemaker.cxx index ae224078c184..6a192aecfda5 100644 --- a/unodevtools/source/skeletonmaker/javatypemaker.cxx +++ b/unodevtools/source/skeletonmaker/javatypemaker.cxx @@ -387,7 +387,7 @@ void printMethods(std::ostream & o, } static OString sd(RTL_CONSTASCII_STRINGPARAM("_")); - bool body = ((delegate.getLength() > 0) ? true : false); + bool body = !delegate.isEmpty(); bool defaultbody = ((delegate.equals(sd)) ? true : false); generated.add(type); @@ -577,7 +577,7 @@ void printConstructionMethods(std::ostream & o, options, manager, codemaker::convertString(reader.getSuperTypeName(0)), false); o << ' '; - if ( reader.getMethodName(i).getLength() == 0 ) { + if ( reader.getMethodName(i).isEmpty() ) { o << "create"; } else { o << (codemaker::java::translateUnoToJavaIdentifier( @@ -668,7 +668,7 @@ void generateDocumentation(std::ostream & o, &arguments); bool comment=true; - if ( delegate.getLength() > 0 ) { + if ( !delegate.isEmpty() ) { if ( typeClass != RT_TYPE_INTERFACE && typeClass != RT_TYPE_SERVICE ) return; diff --git a/unodevtools/source/skeletonmaker/skeletoncommon.cxx b/unodevtools/source/skeletonmaker/skeletoncommon.cxx index aecb39ab233c..a4c76519d735 100644 --- a/unodevtools/source/skeletonmaker/skeletoncommon.cxx +++ b/unodevtools/source/skeletonmaker/skeletoncommon.cxx @@ -248,7 +248,7 @@ void checkType(TypeManager const & manager, // constructor because in this case XInitialization is not called. if ( reader.getMethodCount() > 1 || ( reader.getMethodCount() == 1 && - reader.getMethodName(0).getLength() > 0 ) ) + !reader.getMethodName(0).isEmpty() ) ) { OString s("com.sun.star.lang.XInitialization"); if ( interfaceTypes.find(s) == interfaceTypes.end() ) diff --git a/unodevtools/source/unodevtools/typeblob.cxx b/unodevtools/source/unodevtools/typeblob.cxx index 9123bf13fff0..b5135586891b 100644 --- a/unodevtools/source/unodevtools/typeblob.cxx +++ b/unodevtools/source/unodevtools/typeblob.cxx @@ -283,7 +283,7 @@ RTFieldAccess checkPropertyFlags(short flags) { void* getTypeBlob(Reference< XHierarchicalNameAccess > xTDmgr, const OString& typeName, sal_uInt32* blobsize) { - if ( typeName.getLength() == 0 ) + if ( typeName.isEmpty() ) return NULL; OUString uTypeName(OStringToOUString(typeName, RTL_TEXTENCODING_UTF8) |