Author: hdu Date: Wed Feb 12 10:42:37 2014 New Revision: 1567594 URL: http://svn.apache.org/r1567594 Log: #i123862# use O*String's isEmpty() method to check for emptiness in the comphelper module
Patch-by: [email protected] Review-by: [email protected] Modified: openoffice/trunk/main/comphelper/source/container/embeddedobjectcontainer.cxx openoffice/trunk/main/comphelper/source/eventattachermgr/eventattachermgr.cxx openoffice/trunk/main/comphelper/source/misc/docpasswordhelper.cxx openoffice/trunk/main/comphelper/source/misc/documentinfo.cxx openoffice/trunk/main/comphelper/source/misc/locale.cxx openoffice/trunk/main/comphelper/source/misc/logging.cxx openoffice/trunk/main/comphelper/source/misc/mediadescriptor.cxx openoffice/trunk/main/comphelper/source/misc/mimeconfighelper.cxx openoffice/trunk/main/comphelper/source/misc/numbers.cxx openoffice/trunk/main/comphelper/source/misc/regpathhelper.cxx openoffice/trunk/main/comphelper/source/misc/sequenceashashmap.cxx openoffice/trunk/main/comphelper/source/misc/storagehelper.cxx openoffice/trunk/main/comphelper/source/misc/string.cxx openoffice/trunk/main/comphelper/source/officeinstdir/officeinstallationdirectories.cxx openoffice/trunk/main/comphelper/source/property/genericpropertyset.cxx openoffice/trunk/main/comphelper/source/property/propagg.cxx openoffice/trunk/main/comphelper/source/property/propertybag.cxx openoffice/trunk/main/comphelper/source/streaming/otransactedfilestream.cxx openoffice/trunk/main/comphelper/source/xml/ofopxmlhelper.cxx Modified: openoffice/trunk/main/comphelper/source/container/embeddedobjectcontainer.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/container/embeddedobjectcontainer.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/container/embeddedobjectcontainer.cxx (original) +++ openoffice/trunk/main/comphelper/source/container/embeddedobjectcontainer.cxx Wed Feb 12 10:42:37 2014 @@ -321,7 +321,7 @@ uno::Reference < embed::XEmbeddedObject { RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::GetEmbeddedObject" ); - OSL_ENSURE( rName.getLength(), "Empty object name!"); + OSL_ENSURE( !rName.isEmpty(), "Empty object name!"); uno::Reference < embed::XEmbeddedObject > xObj; EmbeddedObjectContainerNameMap::iterator aIt = pImpl->maObjectContainer.find( rName ); @@ -399,7 +399,7 @@ uno::Reference < embed::XEmbeddedObject { RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::CreateEmbeddedObject" ); - if ( !rNewName.getLength() ) + if ( rNewName.isEmpty() ) rNewName = CreateUniqueObjectName(); OSL_ENSURE( !HasEmbeddedObject(rNewName), "Object to create already exists!"); @@ -441,7 +441,7 @@ void EmbeddedObjectContainer::AddEmbedde RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::AddEmbeddedObject" ); #if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( rName.getLength(), "Added object doesn't have a name!"); + OSL_ENSURE( !rName.isEmpty(), "Added object doesn't have a name!"); uno::Reference < container::XNameAccess > xAccess( pImpl->mxStorage, uno::UNO_QUERY ); uno::Reference < embed::XEmbedPersist > xEmb( xObj, uno::UNO_QUERY ); uno::Reference < embed::XLinkageSupport > xLink( xEmb, uno::UNO_QUERY ); @@ -505,7 +505,7 @@ sal_Bool EmbeddedObjectContainer::StoreE RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::StoreEmbeddedObject" ); uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY ); - if ( !rName.getLength() ) + if ( rName.isEmpty() ) rName = CreateUniqueObjectName(); #if OSL_DEBUG_LEVEL > 1 @@ -558,7 +558,7 @@ uno::Reference < embed::XEmbeddedObject { RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::InsertEmbeddedObject( InputStream )" ); - if ( !rNewName.getLength() ) + if ( rNewName.isEmpty() ) rNewName = CreateUniqueObjectName(); // store it into the container storage @@ -620,7 +620,7 @@ uno::Reference < embed::XEmbeddedObject { RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::InsertEmbeddedObject( MediaDescriptor )" ); - if ( !rNewName.getLength() ) + if ( rNewName.isEmpty() ) rNewName = CreateUniqueObjectName(); uno::Reference < embed::XEmbeddedObject > xObj; @@ -655,7 +655,7 @@ uno::Reference < embed::XEmbeddedObject { RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::InsertEmbeddedLink" ); - if ( !rNewName.getLength() ) + if ( rNewName.isEmpty() ) rNewName = CreateUniqueObjectName(); uno::Reference < embed::XEmbeddedObject > xObj; @@ -695,7 +695,7 @@ sal_Bool EmbeddedObjectContainer::TryToC sal_Bool bResult = sal_False; - if ( ( &rSrc != this || !aOrigName.equals( aTargetName ) ) && aOrigName.getLength() && aTargetName.getLength() ) + if ( ( &rSrc != this || !aOrigName.equals( aTargetName ) ) && !aOrigName.isEmpty() && !aTargetName.isEmpty() ) { ::rtl::OUString aMediaType; uno::Reference < io::XInputStream > xGrStream = rSrc.GetGraphicStream( aOrigName, &aMediaType ); @@ -719,7 +719,7 @@ sal_Bool EmbeddedObjectContainer::CopyEm if ( xPersist.is() ) aOrigName = xPersist->getEntryName(); - if ( !rName.getLength() ) + if ( rName.isEmpty() ) rName = CreateUniqueObjectName(); if ( StoreEmbeddedObject( xObj, rName, sal_True ) ) @@ -748,7 +748,7 @@ uno::Reference < embed::XEmbeddedObject catch( uno::Exception& ) {} - if ( !rName.getLength() ) + if ( rName.isEmpty() ) rName = CreateUniqueObjectName(); // objects without persistance are not really stored by the method @@ -766,7 +766,7 @@ uno::Reference < embed::XEmbeddedObject { // this is a OOo link, it has no persistence ::rtl::OUString aURL = xOrigLinkage->getLinkURL(); - if ( !aURL.getLength() ) + if ( aURL.isEmpty() ) throw uno::RuntimeException(); // create new linked object from the URL the link is based on @@ -868,7 +868,7 @@ uno::Reference < embed::XEmbeddedObject if ( xResult.is() ) { // the object is successfully copied, try to copy graphical replacement - if ( aOrigName.getLength() ) + if ( !aOrigName.isEmpty() ) TryToCopyGraphReplacement( rSrc, aOrigName, rName ); // the object might need the size to be set @@ -1086,7 +1086,7 @@ sal_Bool EmbeddedObjectContainer::Remove static const ::rtl::OUString s_sMediaType(RTL_CONSTASCII_USTRINGPARAM("MediaType")); xStorProps->getPropertyValue( s_sMediaType ) >>= aOrigStorMediaType; - OSL_ENSURE( aOrigStorMediaType.getLength(), "No valuable media type in the storage!\n" ); + OSL_ENSURE( !aOrigStorMediaType.isEmpty(), "No valuable media type in the storage!\n" ); uno::Reference< beans::XPropertySet > xTargetStorProps( pImpl->mpTempObjectContainer->pImpl->mxStorage, @@ -1206,8 +1206,8 @@ uno::Reference < io::XInputStream > Embe uno::Reference < io::XInputStream > xStream; - OSL_ENSURE( aName.getLength(), "Retrieving graphic for unknown object!" ); - if ( aName.getLength() ) + OSL_ENSURE( !aName.isEmpty(), "Retrieving graphic for unknown object!" ); + if ( !aName.isEmpty() ) { try { @@ -1344,7 +1344,7 @@ namespace { const uno::Reference< io::XInputStream >& xInStream, const ::rtl::OUString& aStreamName ) { - OSL_ENSURE( aStreamName.getLength() && xInStream.is() && xDocStor.is(), "Misuse of the method!\n" ); + OSL_ENSURE( !aStreamName.isEmpty() && xInStream.is() && xDocStor.is(), "Misuse of the method!\n" ); try { Modified: openoffice/trunk/main/comphelper/source/eventattachermgr/eventattachermgr.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/eventattachermgr/eventattachermgr.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/eventattachermgr/eventattachermgr.cxx (original) +++ openoffice/trunk/main/comphelper/source/eventattachermgr/eventattachermgr.cxx Wed Feb 12 10:42:37 2014 @@ -342,7 +342,7 @@ Any SAL_CALL AttacherAllListener_Impl::a case TypeClass_STRING: // none empty string -> return - if( ((OUString*)aRet.getValue())->getLength() > 0 ) + if( ((OUString*)aRet.getValue())->isEmpty() == false ) return aRet; break; Modified: openoffice/trunk/main/comphelper/source/misc/docpasswordhelper.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/misc/docpasswordhelper.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/misc/docpasswordhelper.cxx (original) +++ openoffice/trunk/main/comphelper/source/misc/docpasswordhelper.cxx Wed Feb 12 10:42:37 2014 @@ -53,7 +53,7 @@ static uno::Sequence< sal_Int8 > Generat { uno::Sequence< sal_Int8 > aResult; - if ( aPassword.getLength() && aSalt.getLength() && nCount && nHashLength ) + if ( !aPassword.isEmpty() && aSalt.getLength() && nCount && nHashLength ) { ::rtl::OString aBytePass = ::rtl::OUStringToOString( aPassword, RTL_TEXTENCODING_UTF8 ); aResult.realloc( 16 ); @@ -104,7 +104,7 @@ uno::Sequence< beans::PropertyValue > Do sal_Bool DocPasswordHelper::IsModifyPasswordCorrect( const ::rtl::OUString& aPassword, const uno::Sequence< beans::PropertyValue >& aInfo ) { sal_Bool bResult = sal_False; - if ( aPassword.getLength() && aInfo.getLength() ) + if ( !aPassword.isEmpty() && aInfo.getLength() ) { ::rtl::OUString sAlgorithm; uno::Sequence< sal_Int8 > aSalt; @@ -238,7 +238,7 @@ sal_uInt16 DocPasswordHelper::GetXLHashA ::rtl::OString aString = ::rtl::OUStringToOString( aUString, nEnc ); - if ( aString.getLength() && aString.getLength() <= SAL_MAX_UINT16 ) + if ( !aString.isEmpty() && aString.getLength() <= SAL_MAX_UINT16 ) { for ( sal_Int32 nInd = aString.getLength() - 1; nInd >= 0; nInd-- ) { @@ -287,7 +287,7 @@ Sequence< sal_Int8 > DocPasswordHelper:: /*static*/ uno::Sequence< sal_Int8 > DocPasswordHelper::GenerateStd97Key( const ::rtl::OUString& aPassword, const uno::Sequence< sal_Int8 >& aDocId ) { uno::Sequence< sal_Int8 > aResultKey; - if ( aPassword.getLength() && aDocId.getLength() == 16 ) + if ( !aPassword.isEmpty() && aDocId.getLength() == 16 ) { sal_uInt16 pPassData[16]; rtl_zeroMemory( pPassData, sizeof(pPassData) ); @@ -377,8 +377,8 @@ Sequence< sal_Int8 > DocPasswordHelper:: { for( ::std::vector< OUString >::const_iterator aIt = pDefaultPasswords->begin(), aEnd = pDefaultPasswords->end(); (eResult == DocPasswordVerifierResult_WRONG_PASSWORD) && (aIt != aEnd); ++aIt ) { - OSL_ENSURE( aIt->getLength() > 0, "DocPasswordHelper::requestAndVerifyDocPassword - unexpected empty default password" ); - if( aIt->getLength() > 0 ) + OSL_ENSURE( !aIt->isEmpty(), "DocPasswordHelper::requestAndVerifyDocPassword - unexpected empty default password" ); + if( !aIt->isEmpty() ) { eResult = rVerifier.verifyPassword( *aIt, aEncData ); if( pbIsDefaultPassword ) @@ -401,7 +401,7 @@ Sequence< sal_Int8 > DocPasswordHelper:: // try media password (skip, if result is OK or ABORT) if( eResult == DocPasswordVerifierResult_WRONG_PASSWORD ) { - if( rMediaPassword.getLength() > 0 ) + if( !rMediaPassword.isEmpty() ) eResult = rVerifier.verifyPassword( rMediaPassword, aEncData ); } @@ -416,7 +416,7 @@ Sequence< sal_Int8 > DocPasswordHelper:: rxInteractHandler->handle( xRequest ); if( pRequest->isPassword() ) { - if( pRequest->getPassword().getLength() > 0 ) + if( !pRequest->getPassword().isEmpty() ) eResult = rVerifier.verifyPassword( pRequest->getPassword(), aEncData ); } else Modified: openoffice/trunk/main/comphelper/source/misc/documentinfo.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/misc/documentinfo.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/misc/documentinfo.cxx (original) +++ openoffice/trunk/main/comphelper/source/misc/documentinfo.cxx Wed Feb 12 10:42:37 2014 @@ -95,12 +95,12 @@ namespace comphelper { { // 1. ask the model and the controller for their XTitle::getTitle sTitle = lcl_getTitle( _rxDocument ); - if ( sTitle.getLength() ) + if ( !sTitle.isEmpty() ) return sTitle; Reference< XController > xController( _rxDocument->getCurrentController() ); sTitle = lcl_getTitle( xController ); - if ( sTitle.getLength() ) + if ( !sTitle.isEmpty() ) return sTitle; // work around a problem with embedded objects, which sometimes return @@ -110,13 +110,13 @@ namespace comphelper { sDocURL = ::rtl::OUString(); // 2. if the document is not saved, yet, check the frame title - if ( sDocURL.getLength() == 0 ) + if ( sDocURL.isEmpty() ) { Reference< XFrame > xFrame; if ( xController.is() ) xFrame.set( xController->getFrame() ); sTitle = lcl_getTitle( xFrame ); - if ( sTitle.getLength() ) + if ( !sTitle.isEmpty() ) return sTitle; } @@ -128,14 +128,14 @@ namespace comphelper { xDPS->getDocumentProperties(), UNO_QUERY_THROW ); OSL_ENSURE(xDocProps.is(), "no DocumentProperties"); sTitle = xDocProps->getTitle(); - if ( sTitle.getLength() ) + if ( !sTitle.isEmpty() ) return sTitle; } // 4. try model arguments NamedValueCollection aModelArgs( _rxDocument->getArgs() ); sTitle = aModelArgs.getOrDefault( "Title", sTitle ); - if ( sTitle.getLength() ) + if ( !sTitle.isEmpty() ) return sTitle; // 5. try the last segment of the document URL @@ -143,7 +143,7 @@ namespace comphelper { // but since we moved this code to comphelper, we do not have access to an INetURLObject anymore // This heuristics here should be sufficient - finally, we will get an UNO title API in a not // too distant future (hopefully), then this complete class is superfluous) - if ( sDocURL.getLength() == 0 ) + if ( sDocURL.isEmpty() ) { Reference< XStorable > xDocStorable( _rxDocument, UNO_QUERY_THROW ); sDocURL = xDocStorable->getLocation(); @@ -156,7 +156,7 @@ namespace comphelper { } sTitle = sDocURL.copy( nLastSepPos + 1 ); - if ( sTitle.getLength() != 0 ) + if ( !sTitle.isEmpty() ) return sTitle; // 5. @@ -165,7 +165,7 @@ namespace comphelper { Reference< XTitle > xTitle( _rxDocument, UNO_QUERY ); if ( xTitle.is() ) { - if ( xTitle->getTitle().getLength() != 0 ) + if ( !xTitle->getTitle().isEmpty() ) return xTitle->getTitle(); } } Modified: openoffice/trunk/main/comphelper/source/misc/locale.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/misc/locale.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/misc/locale.cxx (original) +++ openoffice/trunk/main/comphelper/source/misc/locale.cxx Wed Feb 12 10:42:37 2014 @@ -472,12 +472,12 @@ void Locale::fromISO(const ::rtl::OUStri ::rtl::OUStringBuffer sISO(64); sISO.append(m_sLanguage); - if (m_sCountry.getLength()) + if ( !m_sCountry.isEmpty() ) { sISO.append(SEPERATOR_LC); sISO.append(m_sCountry); - if (m_sVariant.getLength()) + if ( !m_sVariant.isEmpty() ) { sISO.append(SEPERATOR_CV); sISO.append(m_sVariant); @@ -635,7 +635,7 @@ sal_Bool Locale::getFallback(Locale& aLo // d) remove country from incoming locale // e.g. "de-DE" => "de" or "en-US" => "en"! - if (aLocale.getCountry().getLength()) + if ( !aLocale.getCountry().isEmpty()) { aLocale.setCountry(::rtl::OUString()); return sal_True; Modified: openoffice/trunk/main/comphelper/source/misc/logging.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/misc/logging.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/misc/logging.cxx (original) +++ openoffice/trunk/main/comphelper/source/misc/logging.cxx Wed Feb 12 10:42:37 2014 @@ -91,7 +91,7 @@ namespace comphelper try { Reference< XLoggerPool > xPool( LoggerPool::get( m_aContext.getUNOContext() ), UNO_QUERY_THROW ); - if ( m_sLoggerName.getLength() ) + if ( !m_sLoggerName.isEmpty() ) m_xLogger = xPool->getNamedLogger( m_sLoggerName ); else m_xLogger = xPool->getDefaultLogger(); @@ -383,7 +383,7 @@ namespace comphelper ::rtl::OUString sMessage; if ( lcl_loadBundle_nothrow( m_pImpl->getContext(), *m_pData ) ) sMessage = lcl_loadString_nothrow( m_pData->xBundle, _nMessageResID ); - if ( sMessage.getLength() == 0 ) + if ( sMessage.isEmpty() ) { ::rtl::OUStringBuffer aBuffer; aBuffer.appendAscii( "<invalid event resource: '" ); Modified: openoffice/trunk/main/comphelper/source/misc/mediadescriptor.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/misc/mediadescriptor.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/misc/mediadescriptor.cxx (original) +++ openoffice/trunk/main/comphelper/source/misc/mediadescriptor.cxx Wed Feb 12 10:42:37 2014 @@ -596,7 +596,7 @@ sal_Bool MediaDescriptor::impl_addInputS // b) ... or we must get it from the given URL ::rtl::OUString sURL = getUnpackedValueOrDefault(MediaDescriptor::PROP_URL(), ::rtl::OUString()); - if (!sURL.getLength()) + if ( sURL.isEmpty() ) throw css::uno::Exception( ::rtl::OUString::createFromAscii("Found no URL."), css::uno::Reference< css::uno::XInterface >()); @@ -645,7 +645,7 @@ sal_Bool MediaDescriptor::impl_openStrea // media type ::rtl::OUString sMediaType = getUnpackedValueOrDefault(MediaDescriptor::PROP_MEDIATYPE(), ::rtl::OUString()); - if (!sMediaType.getLength()) + if ( sMediaType.isEmpty() ) { sMediaType = ::rtl::OUString::createFromAscii("application/x-www-form-urlencoded"); (*this)[MediaDescriptor::PROP_MEDIATYPE()] <<= sMediaType; Modified: openoffice/trunk/main/comphelper/source/misc/mimeconfighelper.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/misc/mimeconfighelper.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/misc/mimeconfighelper.cxx (original) +++ openoffice/trunk/main/comphelper/source/misc/mimeconfighelper.cxx Wed Feb 12 10:42:37 2014 @@ -204,7 +204,7 @@ sal_Int32 MimeConfigurationHelper::GetFi sal_Int32 nFlags = 0; try { - if ( aFilterName.getLength() ) + if ( !aFilterName.isEmpty() ) { uno::Reference< container::XNameAccess > xFilterFactory( GetFilterFactory(), @@ -277,10 +277,10 @@ sal_Int32 MimeConfigurationHelper::GetFi { ::rtl::OUString aFilterName; if ( aType[nInd].Name.equalsAscii( "PreferredFilter" ) - && ( aType[nInd].Value >>= aFilterName ) && aFilterName.getLength() ) + && ( aType[nInd].Value >>= aFilterName ) && !aFilterName.isEmpty() ) { ::rtl::OUString aDocumentName = GetDocServiceNameFromFilter( aFilterName ); - if ( aDocumentName.getLength() ) + if ( !aDocumentName.isEmpty() ) return aDocumentName; } } @@ -442,7 +442,7 @@ uno::Sequence< beans::NamedValue > MimeC } ::rtl::OUString aStringClassID = GetStringClassIDRepresentation( aClassID ); - if ( aStringClassID.getLength() ) + if ( !aStringClassID.isEmpty() ) { uno::Reference< container::XNameAccess > xObjConfig = GetObjConfiguration(); uno::Reference< container::XNameAccess > xObjectProps; @@ -468,7 +468,7 @@ uno::Sequence< beans::NamedValue > MimeC return aObject; ::rtl::OUString aDocumentName = GetDocServiceNameFromMediaType( aMediaType ); - if ( aDocumentName.getLength() ) + if ( !aDocumentName.isEmpty() ) return GetObjectPropsByDocumentName( aDocumentName ); return uno::Sequence< beans::NamedValue >(); @@ -478,7 +478,7 @@ uno::Sequence< beans::NamedValue > MimeC uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByFilter( const ::rtl::OUString& aFilterName ) { ::rtl::OUString aDocumentName = GetDocServiceNameFromFilter( aFilterName ); - if ( aDocumentName.getLength() ) + if ( !aDocumentName.isEmpty() ) return GetObjectPropsByDocumentName( aDocumentName ); return uno::Sequence< beans::NamedValue >(); @@ -487,7 +487,7 @@ uno::Sequence< beans::NamedValue > MimeC //----------------------------------------------------------------------- uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByDocumentName( const ::rtl::OUString& aDocName ) { - if ( aDocName.getLength() ) + if ( !aDocName.isEmpty() ) { uno::Reference< container::XNameAccess > xObjConfig = GetObjConfiguration(); if ( xObjConfig.is() ) @@ -529,7 +529,7 @@ uno::Sequence< beans::NamedValue > MimeC { ::rtl::OUString aResult; - if ( aStringClassID.getLength() ) + if ( !aStringClassID.isEmpty() ) { uno::Reference< container::XNameAccess > xObjConfig = GetObjConfiguration(); uno::Reference< container::XNameAccess > xObjectProps; @@ -554,7 +554,7 @@ uno::Sequence< beans::NamedValue > MimeC { ::rtl::OUString aResult; - if ( aDocName.getLength() ) + if ( !aDocName.isEmpty() ) { uno::Reference< container::XNameAccess > xObjConfig = GetObjConfiguration(); if ( xObjConfig.is() ) @@ -591,10 +591,10 @@ uno::Sequence< beans::NamedValue > MimeC { ::rtl::OUString aResult = GetFactoryNameByStringClassID( GetExplicitlyRegisteredObjClassID( aMediaType ) ); - if ( !aResult.getLength() ) + if ( aResult.isEmpty() ) { ::rtl::OUString aDocumentName = GetDocServiceNameFromMediaType( aMediaType ); - if ( aDocumentName.getLength() ) + if ( !aDocumentName.isEmpty() ) aResult = GetFactoryNameByDocumentName( aDocumentName ); } @@ -612,7 +612,7 @@ uno::Sequence< beans::NamedValue > MimeC if ( aMediaDescr[nInd].Name.equalsAscii( "FilterName" ) ) aMediaDescr[nInd].Value >>= aFilterName; - if ( !aFilterName.getLength() ) + if ( aFilterName.isEmpty() ) { // filter name is not specified, so type detection should be done @@ -634,7 +634,7 @@ uno::Sequence< beans::NamedValue > MimeC if ( aTempMD[nInd].Name.equalsAscii( "FilterName" ) ) aTempMD[nInd].Value >>= aFilterName; - if ( aFilterName.getLength() ) + if ( !aFilterName.isEmpty() ) { sal_Int32 nOldLen = aMediaDescr.getLength(); aMediaDescr.realloc( nOldLen + 1 ); @@ -642,7 +642,7 @@ uno::Sequence< beans::NamedValue > MimeC aMediaDescr[ nOldLen ].Value <<= aFilterName; } - else if ( aTypeName.getLength() && !bIgnoreType ) + else if ( !aTypeName.isEmpty() && !bIgnoreType ) { uno::Reference< container::XNameAccess > xNameAccess( xTypeDetection, uno::UNO_QUERY ); uno::Sequence< beans::PropertyValue > aTypes; @@ -679,7 +679,7 @@ uno::Sequence< beans::NamedValue > MimeC break; } - OSL_ENSURE( aDocName.getLength(), "The name must exist at this point!\n" ); + OSL_ENSURE( !aDocName.isEmpty(), "The name must exist at this point!\n" ); sal_Bool bNeedsAddition = sal_True; @@ -708,7 +708,7 @@ sal_Bool MimeConfigurationHelper::AddFil sal_Bool bResult = sal_False; ::rtl::OUString aFilterName = UpdateMediaDescriptorWithFilterName( aMediaDescr, sal_False ); - if ( aFilterName.getLength() ) + if ( !aFilterName.isEmpty() ) { sal_Int32 nFlags = GetFilterFlags( aFilterName ); // check the OWN flag @@ -723,7 +723,7 @@ sal_Bool MimeConfigurationHelper::AddFil { rtl::OUString aResult; - if ( aServiceName.getLength() && nVersion ) + if ( !aServiceName.isEmpty() && nVersion ) try { uno::Reference< container::XContainerQuery > xFilterQuery( @@ -757,7 +757,7 @@ sal_Bool MimeConfigurationHelper::AddFil { // if there are more than one filter the preffered one should be used // if there is no preffered filter the first one will be used - if ( !aResult.getLength() || ( nFlags & SFX_FILTER_PREFERED ) ) + if ( aResult.isEmpty() || ( nFlags & SFX_FILTER_PREFERED ) ) aResult = aPropsHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Name" ), ::rtl::OUString() ); if ( nFlags & SFX_FILTER_PREFERED ) @@ -779,7 +779,7 @@ sal_Bool MimeConfigurationHelper::AddFil try { - if ( aImportFilterName.getLength() ) + if ( !aImportFilterName.isEmpty() ) { uno::Reference< container::XNameAccess > xFilterFactory( GetFilterFactory(), @@ -808,8 +808,8 @@ sal_Bool MimeConfigurationHelper::AddFil ::rtl::OUString aDocumentServiceName = aImpFilterHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "DocumentService" ), ::rtl::OUString() ); ::rtl::OUString aTypeName = aImpFilterHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Type" ), ::rtl::OUString() ); - OSL_ENSURE( aDocumentServiceName.getLength() && aTypeName.getLength(), "Incomplete filter data!" ); - if ( aDocumentServiceName.getLength() && aTypeName.getLength() ) + OSL_ENSURE( !aDocumentServiceName.isEmpty() && !aTypeName.isEmpty(), "Incomplete filter data!" ); + if ( !aDocumentServiceName.isEmpty() && !aTypeName.isEmpty() ) { uno::Sequence< beans::NamedValue > aSearchRequest( 2 ); aSearchRequest[0].Name = ::rtl::OUString::createFromAscii( "Type" ); Modified: openoffice/trunk/main/comphelper/source/misc/numbers.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/misc/numbers.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/misc/numbers.cxx (original) +++ openoffice/trunk/main/comphelper/source/misc/numbers.cxx Wed Feb 12 10:42:37 2014 @@ -115,7 +115,7 @@ Any getNumberFormatProperty( const Refer { Any aReturn; - OSL_ENSURE( _rxFormatter.is() && _rPropertyName.getLength(), "getNumberFormatProperty: invalid arguments!" ); + OSL_ENSURE( _rxFormatter.is() && !_rPropertyName.isEmpty(), "getNumberFormatProperty: invalid arguments!" ); try { Reference< XNumberFormatsSupplier > xSupplier; Modified: openoffice/trunk/main/comphelper/source/misc/regpathhelper.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/misc/regpathhelper.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/misc/regpathhelper.cxx (original) +++ openoffice/trunk/main/comphelper/source/misc/regpathhelper.cxx Wed Feb 12 10:42:37 2014 @@ -103,7 +103,7 @@ static OUString getDefaultLocalRegistry( if ( bIsPortalUser ) { - if( portalUserDir.getLength() ) + if( !portalUserDir.isEmpty() ) { FileBase::getFileURLFromSystemPath( portalUserDir , portalUserDir ); userRegistryName = portalUserDir; @@ -157,7 +157,7 @@ OUString getPathToUserRegistry() // search the environment STAR_USER_REGISTRY OString sBuffer( getenv(USER_REGISTRY_NAME_ENV) ); - if ( sBuffer.getLength() > 0 ) + if ( !sBuffer.isEmpty() ) { f = fopen( sBuffer.getStr(), "r" ); @@ -168,7 +168,7 @@ OUString getPathToUserRegistry() } } - if ( !userRegistryName.getLength() ) + if ( userRegistryName.isEmpty() ) { userRegistryName = getDefaultLocalRegistry(); } @@ -206,7 +206,7 @@ OUString getPathToSystemRegistry() { // search the environment STAR_REGISTRY OString tmpStr( getenv(SYSTEM_REGISTRY_NAME_ENV) ); - if ( tmpStr.getLength() > 0 ) + if ( !tmpStr.isEmpty() ) { f = fopen(tmpStr.getStr(), "r"); Modified: openoffice/trunk/main/comphelper/source/misc/sequenceashashmap.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/misc/sequenceashashmap.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/misc/sequenceashashmap.cxx (original) +++ openoffice/trunk/main/comphelper/source/misc/sequenceashashmap.cxx Wed Feb 12 10:42:37 2014 @@ -126,7 +126,7 @@ void SequenceAsHashMap::operator<<(const if (lSource[i] >>= lP) { if ( - (!lP.Name.getLength()) || + (lP.Name.isEmpty()) || (!lP.Value.hasValue()) ) throw css::beans::IllegalTypeException( @@ -140,7 +140,7 @@ void SequenceAsHashMap::operator<<(const if (lSource[i] >>= lN) { if ( - (!lN.Name.getLength()) || + (lN.Name.isEmpty()) || (!lN.Value.hasValue()) ) throw css::beans::IllegalTypeException( Modified: openoffice/trunk/main/comphelper/source/misc/storagehelper.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/misc/storagehelper.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/misc/storagehelper.cxx (original) +++ openoffice/trunk/main/comphelper/source/misc/storagehelper.cxx Wed Feb 12 10:42:37 2014 @@ -426,7 +426,7 @@ uno::Sequence< beans::NamedValue > OStor // TODO/LATER: Should not the method be part of DocPasswordHelper? uno::Sequence< beans::NamedValue > aEncryptionData; sal_Int32 nSha1Ind = 0; - if ( aPassword.getLength() ) + if ( !aPassword.isEmpty() ) { // generate SHA256 start key try Modified: openoffice/trunk/main/comphelper/source/misc/string.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/misc/string.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/misc/string.cxx (original) +++ openoffice/trunk/main/comphelper/source/misc/string.cxx Wed Feb 12 10:42:37 2014 @@ -109,7 +109,7 @@ rtl::OUString searchAndReplaceAsciiL( ::rtl::OUString kw = i_rString.getToken(0, static_cast<sal_Unicode> (','), idx); kw = kw.trim(); - if (kw.getLength() > 0) { + if ( !kw.isEmpty() ) { vec.push_back(kw); } } while (idx >= 0); Modified: openoffice/trunk/main/comphelper/source/officeinstdir/officeinstallationdirectories.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/officeinstdir/officeinstallationdirectories.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/officeinstdir/officeinstallationdirectories.cxx (original) +++ openoffice/trunk/main/comphelper/source/officeinstdir/officeinstallationdirectories.cxx Wed Feb 12 10:42:37 2014 @@ -69,7 +69,7 @@ static bool makeCanonicalFileURL( rtl::O { aNormalizedURL = aFileStatus.getFileURL(); - if ( aNormalizedURL.getLength() > 0 ) + if ( !aNormalizedURL.isEmpty() ) { if ( aNormalizedURL .getStr()[ aNormalizedURL.getLength() - 1 ] @@ -146,7 +146,7 @@ rtl::OUString SAL_CALL OfficeInstallationDirectories::makeRelocatableURL( const rtl::OUString& URL ) throw ( uno::RuntimeException ) { - if ( URL.getLength() > 0 ) + if ( !URL.isEmpty() ) { initDirs(); @@ -193,7 +193,7 @@ rtl::OUString SAL_CALL OfficeInstallationDirectories::makeAbsoluteURL( const rtl::OUString& URL ) throw ( uno::RuntimeException ) { - if ( URL.getLength() > 0 ) + if ( !URL.isEmpty() ) { sal_Int32 nIndex = URL.indexOf( m_aOfficeBrandDirMacro ); if ( nIndex != -1 ) @@ -345,7 +345,7 @@ void OfficeInstallationDirectories::init xExpander->expandMacros( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "$OOO_BASE_DIR" ) ) ); - OSL_ENSURE( m_pOfficeBrandDir->getLength() > 0, + OSL_ENSURE( !m_pOfficeBrandDir->isEmpty(), "Unable to obtain office brand installation directory!" ); makeCanonicalFileURL( *m_pOfficeBrandDir ); @@ -365,7 +365,7 @@ void OfficeInstallationDirectories::init rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE( "bootstrap" ) ":UserInstallation}" ) ) ); - OSL_ENSURE( m_pUserDir->getLength() > 0, + OSL_ENSURE( !m_pUserDir->isEmpty(), "Unable to obtain office user data directory!" ); makeCanonicalFileURL( *m_pUserDir ); Modified: openoffice/trunk/main/comphelper/source/property/genericpropertyset.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/property/genericpropertyset.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/property/genericpropertyset.cxx (original) +++ openoffice/trunk/main/comphelper/source/property/genericpropertyset.cxx Wed Feb 12 10:42:37 2014 @@ -114,7 +114,7 @@ void SAL_CALL GenericPropertySet::addPro Reference < XPropertySetInfo > xInfo = getPropertySetInfo( ); if ( xInfo.is() ) { - if ( !aPropertyName.getLength() ) + if ( aPropertyName.isEmpty() ) { Sequence< Property> aSeq = xInfo->getProperties(); const Property* pIter = aSeq.getConstArray(); @@ -138,7 +138,7 @@ void SAL_CALL GenericPropertySet::remove aGuard.clear(); if ( xInfo.is() ) { - if ( !aPropertyName.getLength() ) + if ( aPropertyName.isEmpty() ) { Sequence< Property> aSeq = xInfo->getProperties(); const Property* pIter = aSeq.getConstArray(); Modified: openoffice/trunk/main/comphelper/source/property/propagg.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/property/propagg.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/property/propagg.cxx (original) +++ openoffice/trunk/main/comphelper/source/property/propagg.cxx Wed Feb 12 10:42:37 2014 @@ -509,7 +509,7 @@ void SAL_CALL OPropertySetAggregationHel if (1 == nLen) { const ::com::sun::star::beans::PropertyChangeEvent& evt = _rEvents.getConstArray()[0]; - OSL_ENSURE(evt.PropertyName.getLength() > 0, "OPropertySetAggregationHelper::propertiesChange : invalid event !"); + OSL_ENSURE( !evt.PropertyName.isEmpty(), "OPropertySetAggregationHelper::propertiesChange : invalid event !"); // we had a bug where this assertion would have us saved a whole day :) (72514) sal_Int32 nHandle = rPH.getHandleByName( evt.PropertyName ); Modified: openoffice/trunk/main/comphelper/source/property/propertybag.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/property/propertybag.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/property/propertybag.cxx (original) +++ openoffice/trunk/main/comphelper/source/property/propertybag.cxx Wed Feb 12 10:42:37 2014 @@ -88,7 +88,7 @@ namespace comphelper { void lcl_checkForEmptyName( const bool _allowEmpty, const ::rtl::OUString& _name ) { - if ( !_allowEmpty && !_name.getLength() ) + if ( !_allowEmpty && _name.isEmpty() ) throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The property name must not be empty." ) ), // TODO: resource Modified: openoffice/trunk/main/comphelper/source/streaming/otransactedfilestream.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/streaming/otransactedfilestream.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/streaming/otransactedfilestream.cxx (original) +++ openoffice/trunk/main/comphelper/source/streaming/otransactedfilestream.cxx Wed Feb 12 10:42:37 2014 @@ -219,7 +219,7 @@ void OTruncatedTransactedFileStream::Clo delete m_pStreamData; m_pStreamData = NULL; - if ( bDelete && xFileAccess.is() && aURL.getLength() ) + if ( bDelete && xFileAccess.is() && !aURL.isEmpty() ) { // delete the file try Modified: openoffice/trunk/main/comphelper/source/xml/ofopxmlhelper.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/source/xml/ofopxmlhelper.cxx?rev=1567594&r1=1567593&r2=1567594&view=diff ============================================================================== --- openoffice/trunk/main/comphelper/source/xml/ofopxmlhelper.cxx (original) +++ openoffice/trunk/main/comphelper/source/xml/ofopxmlhelper.cxx Wed Feb 12 10:42:37 2014 @@ -303,7 +303,7 @@ void SAL_CALL OFOPXMLHelper::startElemen m_aResultSeq[nNewEntryNum-1].realloc( 4 ); // the maximal expected number of arguments is 4 ::rtl::OUString aIDValue = xAttribs->getValueByName( m_aIDAttr ); - if ( !aIDValue.getLength() ) + if ( aIDValue.isEmpty() ) throw xml::sax::SAXException(); // TODO: the ID value must present ::rtl::OUString aTypeValue = xAttribs->getValueByName( m_aTypeAttr ); @@ -313,19 +313,19 @@ void SAL_CALL OFOPXMLHelper::startElemen m_aResultSeq[nNewEntryNum-1][++nAttrNum - 1].First = m_aIDAttr; m_aResultSeq[nNewEntryNum-1][nAttrNum - 1].Second = aIDValue; - if ( aTypeValue.getLength() ) + if ( !aTypeValue.isEmpty() ) { m_aResultSeq[nNewEntryNum-1][++nAttrNum - 1].First = m_aTypeAttr; m_aResultSeq[nNewEntryNum-1][nAttrNum - 1].Second = aTypeValue; } - if ( aTargetValue.getLength() ) + if ( !aTargetValue.isEmpty() ) { m_aResultSeq[nNewEntryNum-1][++nAttrNum - 1].First = m_aTargetAttr; m_aResultSeq[nNewEntryNum-1][nAttrNum - 1].Second = aTargetValue; } - if ( aTargetModeValue.getLength() ) + if ( !aTargetModeValue.isEmpty() ) { m_aResultSeq[nNewEntryNum-1][++nAttrNum - 1].First = m_aTargetModeAttr; m_aResultSeq[nNewEntryNum-1][nAttrNum - 1].Second = aTargetModeValue; @@ -369,11 +369,11 @@ void SAL_CALL OFOPXMLHelper::startElemen throw uno::RuntimeException(); ::rtl::OUString aExtensionValue = xAttribs->getValueByName( m_aExtensionAttr ); - if ( !aExtensionValue.getLength() ) + if ( aExtensionValue.isEmpty() ) throw xml::sax::SAXException(); // TODO: the Extension value must present ::rtl::OUString aContentTypeValue = xAttribs->getValueByName( m_aContentTypeAttr ); - if ( !aContentTypeValue.getLength() ) + if ( aContentTypeValue.isEmpty() ) throw xml::sax::SAXException(); // TODO: the ContentType value must present sal_Int32 nNewResultLen = m_aResultSeq[0].getLength() + 1; @@ -398,11 +398,11 @@ void SAL_CALL OFOPXMLHelper::startElemen throw uno::RuntimeException(); ::rtl::OUString aPartNameValue = xAttribs->getValueByName( m_aPartNameAttr ); - if ( !aPartNameValue.getLength() ) + if ( aPartNameValue.isEmpty() ) throw xml::sax::SAXException(); // TODO: the PartName value must present ::rtl::OUString aContentTypeValue = xAttribs->getValueByName( m_aContentTypeAttr ); - if ( !aContentTypeValue.getLength() ) + if ( aContentTypeValue.isEmpty() ) throw xml::sax::SAXException(); // TODO: the ContentType value must present sal_Int32 nNewResultLen = m_aResultSeq[1].getLength() + 1;
