From e7bddf732798508e347221590110486e97bb45e6 Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Fri, 23 Dec 2011 18:23:14 -0200 Subject: Fix for fdo43460 Part XVII getLength() to isEmpty() Part XVII Module fileaccess and filter --- fileaccess/source/FileAccess.cxx | 2 +- filter/source/config/cache/basecontainer.cxx | 6 ++-- filter/source/config/cache/cacheitem.cxx | 4 +-- filter/source/config/cache/cacheupdatelistener.cxx | 2 +- filter/source/config/cache/filtercache.cxx | 28 +++++++-------- filter/source/config/cache/filterfactory.cxx | 6 ++-- filter/source/config/cache/querytokenizer.cxx | 2 +- filter/source/config/cache/typedetection.cxx | 42 +++++++++++----------- filter/source/filtertracer/filtertracer.cxx | 2 +- filter/source/msfilter/escherex.cxx | 18 +++++----- filter/source/msfilter/eschesdo.cxx | 2 +- filter/source/msfilter/msdffimp.cxx | 8 ++--- filter/source/msfilter/msfiltertracer.cxx | 14 ++++---- filter/source/msfilter/mstoolbar.cxx | 6 ++-- filter/source/msfilter/msvbahelper.cxx | 16 ++++----- filter/source/pdf/impdialog.cxx | 10 +++--- filter/source/pdf/pdfexport.cxx | 16 ++++----- filter/source/placeware/exporter.cxx | 8 ++--- filter/source/placeware/tempfile.cxx | 2 +- filter/source/placeware/zip.cxx | 4 +-- filter/source/svg/svgexport.cxx | 8 ++--- filter/source/svg/svgfontexport.cxx | 4 +-- filter/source/svg/svgreader.cxx | 4 +-- filter/source/svg/svgwriter.cxx | 6 ++-- .../source/xmlfilteradaptor/XmlFilterAdaptor.cxx | 2 +- filter/source/xmlfilterdetect/filterdetect.cxx | 8 ++--- filter/source/xsltdialog/typedetectionexport.cxx | 6 ++-- filter/source/xsltdialog/typedetectionimport.cxx | 8 ++--- filter/source/xsltdialog/xmlfileview.cxx | 4 +-- filter/source/xsltdialog/xmlfilterjar.cxx | 12 +++---- .../source/xsltdialog/xmlfiltersettingsdialog.cxx | 14 ++++---- filter/source/xsltdialog/xmlfiltertabdialog.cxx | 10 +++--- filter/source/xsltdialog/xmlfiltertabpagebasic.cxx | 4 +-- filter/source/xsltdialog/xmlfiltertabpagexslt.cxx | 2 +- filter/source/xsltdialog/xmlfiltertestdialog.cxx | 16 ++++----- filter/source/xsltfilter/XSLTFilter.cxx | 4 +-- 36 files changed, 155 insertions(+), 155 deletions(-) diff --git a/fileaccess/source/FileAccess.cxx b/fileaccess/source/FileAccess.cxx index 15867f8e24fa..58521835dbcf 100644 --- a/fileaccess/source/FileAccess.cxx +++ b/fileaccess/source/FileAccess.cxx @@ -425,7 +425,7 @@ void OFileAccess::createFolder( const rtl::OUString& NewFolderURL ) throw(CommandAbortedException, Exception, RuntimeException) { // Does the folder already exist? - if( !NewFolderURL.getLength() || isFolder( NewFolderURL ) ) + if( NewFolderURL.isEmpty() || isFolder( NewFolderURL ) ) return; // SfxContentHelper::MakeFolder diff --git a/filter/source/config/cache/basecontainer.cxx b/filter/source/config/cache/basecontainer.cxx index ea47575cc80c..7fa2faac3dcf 100644 --- a/filter/source/config/cache/basecontainer.cxx +++ b/filter/source/config/cache/basecontainer.cxx @@ -219,7 +219,7 @@ void SAL_CALL BaseContainer::insertByName(const ::rtl::OUString& sItem , css::lang::WrappedTargetException , css::uno::RuntimeException ) { - if (!sItem.getLength()) + if (sItem.isEmpty()) throw css::lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "empty value not allowed as item name." )), static_cast< css::container::XNameContainer* >(this), @@ -283,7 +283,7 @@ void SAL_CALL BaseContainer::replaceByName(const ::rtl::OUString& sItem , css::lang::WrappedTargetException , css::uno::RuntimeException ) { - if (!sItem.getLength()) + if (sItem.isEmpty()) throw css::lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "empty value not allowed as item name." )), static_cast< css::container::XNameContainer* >(this), @@ -323,7 +323,7 @@ css::uno::Any SAL_CALL BaseContainer::getByName(const ::rtl::OUString& sItem) css::lang::WrappedTargetException , css::uno::RuntimeException ) { - if (!sItem.getLength()) + if (sItem.isEmpty()) throw css::container::NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "An empty item cant be part of this cache!" )), css::uno::Reference< css::uno::XInterface >(static_cast< css::container::XNameAccess* >(this), css::uno::UNO_QUERY)); diff --git a/filter/source/config/cache/cacheitem.cxx b/filter/source/config/cache/cacheitem.cxx index 36211bee0a94..88153a092ada 100644 --- a/filter/source/config/cache/cacheitem.cxx +++ b/filter/source/config/cache/cacheitem.cxx @@ -75,7 +75,7 @@ void CacheItem::update(const CacheItem& rUpdateItem) void CacheItem::validateUINames(const ::rtl::OUString& sActLocale) { - if (!sActLocale.getLength()) + if (sActLocale.isEmpty()) return; // 1) check UINames first @@ -90,7 +90,7 @@ void CacheItem::validateUINames(const ::rtl::OUString& sActLocale) if (pUIName != end()) pUIName->second >>= sUIName; - if (sUIName.getLength()) + if (!sUIName.isEmpty()) { // 1a) set UIName inside list of UINames for current locale lUINames[sActLocale] <<= sUIName; diff --git a/filter/source/config/cache/cacheupdatelistener.cxx b/filter/source/config/cache/cacheupdatelistener.cxx index bf5f964e2f6a..09997222e1fe 100644 --- a/filter/source/config/cache/cacheupdatelistener.cxx +++ b/filter/source/config/cache/cacheupdatelistener.cxx @@ -179,7 +179,7 @@ void SAL_CALL CacheUpdateListener::changesOccurred(const css::util::ChangesEven } } - if ( ! sNode.getLength() ) + if ( sNode.isEmpty() ) continue; OUStringList::const_iterator pIt = ::std::find(lChangedItems.begin(), lChangedItems.end(), sNode); diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx index 31a61b120b1f..b623e136f7d2 100644 --- a/filter/source/config/cache/filtercache.cxx +++ b/filter/source/config/cache/filtercache.cxx @@ -232,24 +232,24 @@ void FilterCache::load(EFillState eRequired, if (m_eFillState == E_CONTAINS_NOTHING) { impl_getDirectCFGValue(CFGDIRECTKEY_OFFICELOCALE) >>= m_sActLocale; - if (!m_sActLocale.getLength()) + if (m_sActLocale.isEmpty()) { _FILTER_CONFIG_LOG_1_("FilterCache::ctor() ... could not specify office locale => use default \"%s\"\n", _FILTER_CONFIG_TO_ASCII_(DEFAULT_OFFICELOCALE)); m_sActLocale = DEFAULT_OFFICELOCALE; } impl_getDirectCFGValue(CFGDIRECTKEY_FORMATNAME) >>= m_sFormatName; - if (!m_sFormatName.getLength()) + if (m_sFormatName.isEmpty()) impl_getDirectCFGValue(CFGDIRECTKEY_PRODUCTNAME) >>= m_sFormatName; - if (!m_sFormatName.getLength()) + if (m_sFormatName.isEmpty()) { _FILTER_CONFIG_LOG_1_("FilterCache::ctor() ... could not specify format name => use default \"%s\"\n", _FILTER_CONFIG_TO_ASCII_(DEFAULT_FORMATNAME)); m_sFormatName = DEFAULT_FORMATNAME; } impl_getDirectCFGValue(CFGDIRECTKEY_FORMATVERSION) >>= m_sFormatVersion; - if (!m_sFormatVersion.getLength()) + if (m_sFormatVersion.isEmpty()) { _FILTER_CONFIG_LOG_1_("FilterCache::ctor() ... could not specify format version => use default \"%s\"\n", _FILTER_CONFIG_TO_ASCII_(DEFAULT_FORMATVERSION)); m_sFormatVersion = DEFAULT_FORMATVERSION; @@ -557,7 +557,7 @@ void FilterCache::addStatePropsToItem( EItemType eType, ::rtl::OUString sDefaultFrameLoader; if ( (aDirectValue >>= sDefaultFrameLoader) && - (sDefaultFrameLoader.getLength() ) && + (!sDefaultFrameLoader.isEmpty() ) && (sItem.equals(sDefaultFrameLoader) ) ) { @@ -911,8 +911,8 @@ css::uno::Any FilterCache::impl_getDirectCFGValue(const ::rtl::OUString& sDirect if ( (!::utl::splitLastFromConfigurationPath(sDirectKey, sRoot, sKey)) || - (!sRoot.getLength() ) || - (!sKey.getLength() ) + (sRoot.isEmpty() ) || + (sKey.isEmpty() ) ) return css::uno::Any(); @@ -1066,7 +1066,7 @@ void FilterCache::impl_validateAndOptimize() // Because these informations are available as type properties! ::rtl::OUString sDetectService; aType[PROPNAME_DETECTSERVICE ] >>= sDetectService; - if (sDetectService.getLength()) + if (!sDetectService.isEmpty()) impl_resolveItem4TypeRegistration(&m_lDetectServices, sDetectService, sType); // get its registration for file Extensions AND(!) URLPattern ... @@ -1157,7 +1157,7 @@ void FilterCache::impl_validateAndOptimize() ::rtl::OUString sPrefFilter; aType[PROPNAME_PREFERREDFILTER] >>= sPrefFilter; - if (!sPrefFilter.getLength()) + if (sPrefFilter.isEmpty()) { // OK - there is no filter for this type. But thats not an error. // May be it can be handled by a ContentHandler ... @@ -1166,10 +1166,10 @@ void FilterCache::impl_validateAndOptimize() sal_Bool bReferencedByLoader = sal_True; sal_Bool bReferencedByHandler = sal_True; if (bAllLoadersShouldExist) - bReferencedByLoader = (impl_searchFrameLoaderForType(sType).getLength()!=0); + bReferencedByLoader = !impl_searchFrameLoaderForType(sType).isEmpty(); if (bAllHandlersShouldExist) - bReferencedByHandler = (impl_searchContentHandlerForType(sType).getLength()!=0); + bReferencedByHandler = !impl_searchContentHandlerForType(sType).isEmpty(); if ( (!bReferencedByLoader ) && @@ -1184,7 +1184,7 @@ void FilterCache::impl_validateAndOptimize() } } - if (sPrefFilter.getLength()) + if (!sPrefFilter.isEmpty()) { CacheItemList::const_iterator pIt2 = m_lFilters.find(sPrefFilter); if (pIt2 == m_lFilters.end()) @@ -1260,7 +1260,7 @@ void FilterCache::impl_validateAndOptimize() if ( (!(aDirectValue >>= sDefaultFrameLoader)) || - (!sDefaultFrameLoader.getLength() ) + (sDefaultFrameLoader.isEmpty() ) ) { sLog.appendAscii("error\t:\t" ); @@ -2371,7 +2371,7 @@ CacheItem FilterCache::impl_readOldItem(const css::uno::Reference< css::containe xItem->getByName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Data" ))) >>= sData; lData = impl_tokenizeString(sData, (sal_Unicode)','); if ( - (!sData.getLength()) || + (sData.isEmpty()) || (lData.size()<1 ) ) { diff --git a/filter/source/config/cache/filterfactory.cxx b/filter/source/config/cache/filterfactory.cxx index f2b138e929ee..4620b3e4b4f3 100644 --- a/filter/source/config/cache/filterfactory.cxx +++ b/filter/source/config/cache/filterfactory.cxx @@ -173,7 +173,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL FilterFactory::createInstan // create service instance css::uno::Reference< css::uno::XInterface > xFilter; - if (sFilterService.getLength()) + if (!sFilterService.isEmpty()) xFilter = m_xSMGR->createInstance(sFilterService); // initialize filter @@ -377,7 +377,7 @@ OUStringList FilterFactory::impl_queryMatchByDocumentService(const QueryTokenize // "matchByDocumentService=com.sun.star..." => only filter matching this document service will be adressed ::rtl::OUString sCheckValue = aFilter.getUnpackedValueOrDefault(PROPNAME_DOCUMENTSERVICE, ::rtl::OUString()); if ( - ( sDocumentService.getLength() ) && + (!sDocumentService.isEmpty() ) && (!sDocumentService.equals(QUERY_CONSTVALUE_ALL)) && (!sCheckValue.equals(sDocumentService) ) ) @@ -491,7 +491,7 @@ OUStringList FilterFactory::impl_getSortedFilterList(const QueryTokenizer& lToke // simple search for filters of one specific module. OUStringList lFilterList; - if (sModule.getLength()) + if (!sModule.isEmpty()) lFilterList = impl_getSortedFilterListForModule(sModule, nIFlags, nEFlags); else { diff --git a/filter/source/config/cache/querytokenizer.cxx b/filter/source/config/cache/querytokenizer.cxx index 9e2157e5771f..273b4d425652 100644 --- a/filter/source/config/cache/querytokenizer.cxx +++ b/filter/source/config/cache/querytokenizer.cxx @@ -50,7 +50,7 @@ QueryTokenizer::QueryTokenizer(const ::rtl::OUString& sQuery) while(token != -1) { ::rtl::OUString sToken = sQuery.getToken(0, ':', token); - if (sToken.getLength()) + if (!sToken.isEmpty()) { sal_Int32 equal = sToken.indexOf('='); diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx index cc91746c2b37..f1a835dbd266 100644 --- a/filter/source/config/cache/typedetection.cxx +++ b/filter/source/config/cache/typedetection.cxx @@ -180,7 +180,7 @@ TypeDetection::~TypeDetection() // the might needed input stream, start detection // which uses all registered deep detection services. if ( - (!sType.getLength()) && + (sType.isEmpty()) && (bAllowDeep ) ) { @@ -192,13 +192,13 @@ TypeDetection::~TypeDetection() // pure deep detection failed // => ask might existing InteractionHandler // means: ask user for it's decision - if (!sType.getLength()) + if (sType.isEmpty()) sType = impl_askUserForTypeAndFilterIfAllowed(stlDescriptor); //******************************************* // no real detected type - but a might valid one. // update descriptor and set last chance for return. - if (!sType.getLength() && sLastChance.getLength()) + if (sType.isEmpty() && !sLastChance.isEmpty()) { OSL_FAIL("set first flat detected type without a registered deep detection service as \"last chance\" ... nevertheless some other deep detections said \"NO\". I TRY IT!"); sType = sLastChance; @@ -229,7 +229,7 @@ void TypeDetection::impl_checkResultsAndAddBestFilter(::comphelper::MediaDescrip ::rtl::OUString sFilter = rDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_FILTERNAME(), ::rtl::OUString()); - if (sFilter.getLength()) + if (!sFilter.isEmpty()) return; // b) @@ -238,7 +238,7 @@ void TypeDetection::impl_checkResultsAndAddBestFilter(::comphelper::MediaDescrip ::rtl::OUString sDocumentService = rDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_DOCUMENTSERVICE(), ::rtl::OUString()); - if (sDocumentService.getLength()) + if (!sDocumentService.isEmpty()) { try { @@ -308,7 +308,7 @@ void TypeDetection::impl_checkResultsAndAddBestFilter(::comphelper::MediaDescrip // <- SAFE } - if (sFilter.getLength() > 0) + if (!sFilter.isEmpty()) { rDescriptor[::comphelper::MediaDescriptor::PROP_TYPENAME() ] <<= sRealType; rDescriptor[::comphelper::MediaDescriptor::PROP_FILTERNAME()] <<= sFilter; @@ -394,7 +394,7 @@ void TypeDetection::impl_checkResultsAndAddBestFilter(::comphelper::MediaDescrip sFilter = ::rtl::OUString(); } - if (sFilter.getLength()) + if (!sFilter.isEmpty()) { rDescriptor[::comphelper::MediaDescriptor::PROP_TYPENAME() ] <<= sType ; rDescriptor[::comphelper::MediaDescriptor::PROP_FILTERNAME()] <<= sFilter; @@ -505,7 +505,7 @@ sal_Bool TypeDetection::impl_getPreselectionForType(const ::rtl::OUString& sPreS } // if its a valid type - set it on all return values! - if (sType.getLength()) + if (!sType.isEmpty()) { FlatDetectionInfo aInfo; aInfo.sType = sType; @@ -578,7 +578,7 @@ sal_Bool TypeDetection::impl_getPreselectionForFilter(const ::rtl::OUString& sPr rInfo.bPreselectedByFilter = sal_True; } - if (sFilter.getLength()) + if (!sFilter.isEmpty()) return sal_True; else return sal_False; @@ -687,15 +687,15 @@ void TypeDetection::impl_getPreselection(const css::util::URL& aP */ ::rtl::OUString sSelectedType = rDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_TYPENAME(), ::rtl::OUString()); - if (sSelectedType.getLength()) + if (!sSelectedType.isEmpty()) impl_getPreselectionForType(sSelectedType, aParsedURL, rFlatTypes); ::rtl::OUString sSelectedFilter = rDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_FILTERNAME(), ::rtl::OUString()); - if (sSelectedFilter.getLength()) + if (!sSelectedFilter.isEmpty()) impl_getPreselectionForFilter(sSelectedFilter, aParsedURL, rFlatTypes); ::rtl::OUString sSelectedDoc = rDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_DOCUMENTSERVICE(), ::rtl::OUString()); - if (sSelectedDoc.getLength()) + if (!sSelectedDoc.isEmpty()) impl_getPreselectionForDocumentService(sSelectedDoc, aParsedURL, rFlatTypes); } @@ -757,7 +757,7 @@ void TypeDetection::impl_getPreselection(const css::util::URL& aP aType[PROPNAME_DETECTSERVICE] >>= sDetectService; // c) - if (!sDetectService.getLength()) + if (sDetectService.isEmpty()) { // accept or not accept flat types without deep detection: that's the question :-) // May be there exists some states, where we have to use our LastChance feature instead @@ -778,7 +778,7 @@ void TypeDetection::impl_getPreselection(const css::util::URL& aP // preselected by the user can be used as LAST CHANCE in case no other type could // be detected. Of course only the first type without deep detector can be used. // Further ones has to be ignored. - if (rLastChance.getLength() < 1) + if (rLastChance.isEmpty()) rLastChance = sFlatType; continue; @@ -791,7 +791,7 @@ void TypeDetection::impl_getPreselection(const css::util::URL& aP ::rtl::OUString sDeepType = impl_askDetectService(sDetectService, rDescriptor); // d) - if (sDeepType.getLength()) + if (!sDeepType.isEmpty()) return sDeepType; } catch(const css::container::NoSuchElementException&) @@ -843,7 +843,7 @@ namespace { const ::rtl::OUString& sDetectService = *pIt; ::rtl::OUString sDeepType = impl_askDetectService(sDetectService, rDescriptor); - if (sDeepType.getLength()) + if (!sDeepType.isEmpty()) return sDeepType; lInsideUsedDetectors.push_back(sDetectService); } @@ -863,7 +863,7 @@ namespace ::rtl::OUString sPreselDocumentService = rDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_DOCUMENTSERVICE(), ::rtl::OUString()); - if (sPreselDocumentService.getLength()) + if (!sPreselDocumentService.isEmpty()) { for ( pIt = lDetectors.begin(); pIt != lDetectors.end() ; @@ -921,7 +921,7 @@ namespace if (bMatchDetectorToDocumentService) { ::rtl::OUString sDeepType = impl_askDetectService(sDetectService, rDescriptor); - if (sDeepType.getLength()) + if (!sDeepType.isEmpty()) return sDeepType; lInsideUsedDetectors.push_back(sDetectService); } @@ -942,7 +942,7 @@ namespace continue; ::rtl::OUString sDeepType = impl_askDetectService(sDetectService, rDescriptor); - if (sDeepType.getLength()) + if (!sDeepType.isEmpty()) return sDeepType; } @@ -1090,7 +1090,7 @@ void TypeDetection::impl_seekStreamToZero(comphelper::MediaDescriptor& rDescript // and not for "missing files". Especialy if detection is done by a stream only // we cant check if the stream points to an "existing content"! if ( - (!sURL.getLength() ) || // "non existing file" ? + (sURL.isEmpty() ) || // "non existing file" ? (!xStream.is() ) || // non existing file ! (sURL.equalsIgnoreAsciiCaseAsciiL("private:stream", 14)) // not a good idea .-) ) @@ -1134,7 +1134,7 @@ void TypeDetection::impl_openStream(::comphelper::MediaDescriptor& rDescriptor) sal_Bool bSuccess = sal_False; ::rtl::OUString sURL = rDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_URL(), ::rtl::OUString() ); sal_Bool bRequestedReadOnly = rDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_READONLY(), sal_False ); - if ( sURL.getLength() && ::utl::LocalFileHelper::IsLocalFile( INetURLObject( sURL ).GetMainURL( INetURLObject::NO_DECODE ) ) ) + if ( !sURL.isEmpty() && ::utl::LocalFileHelper::IsLocalFile( INetURLObject( sURL ).GetMainURL( INetURLObject::NO_DECODE ) ) ) { // OOo uses own file locking mechanics in case of local file bSuccess = rDescriptor.addInputStreamOwnLock(); diff --git a/filter/source/filtertracer/filtertracer.cxx b/filter/source/filtertracer/filtertracer.cxx index 00ca6fc8b3c7..5cfa62950805 100644 --- a/filter/source/filtertracer/filtertracer.cxx +++ b/filter/source/filtertracer/filtertracer.cxx @@ -133,7 +133,7 @@ void SAL_CALL FilterTracer::initialize( const SEQ( NMSP_UNO::Any )& aArguments ) } // check if we have to create the XOutputStream - if ( !mxOutputStream.is() && msURL.getLength() ) + if ( !(mxOutputStream.is() || msURL.isEmpty()) ) { mpStream = ::utl::UcbStreamHelper::CreateStream( msURL, STREAM_WRITE | STREAM_TRUNC | STREAM_SHARE_DENYNONE ); if ( mpStream ) diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 10f17706357d..b8d64f794097 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -746,7 +746,7 @@ sal_Bool EscherPropertyContainer::GetLineArrow( const sal_Bool bLineStart, sal_Int16 nWhich = bLineStart ? XATTR_LINESTART : XATTR_LINEEND; SvxUnogetApiNameForItem( nWhich, aArrowStartName, aApiName ); - if ( aApiName.getLength() ) + if ( !aApiName.isEmpty() ) { /* todo: @@ -1131,7 +1131,7 @@ sal_Bool EscherPropertyContainer::CreateOLEGraphicProperties( { GraphicObject aGraphicObject( *pGraphic ); rtl::OString aUniqueId( aGraphicObject.GetUniqueID() ); - if ( aUniqueId.getLength() ) + if ( !aUniqueId.isEmpty() ) { AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture ); uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY ); @@ -1165,7 +1165,7 @@ sal_Bool EscherPropertyContainer::CreateOLEGraphicProperties( sal_Bool EscherPropertyContainer::ImplCreateEmbeddedBmp( const rtl::OString& rUniqueId ) { - if( rUniqueId.getLength() > 0 ) + if( !rUniqueId.isEmpty() ) { EscherGraphicProvider aProvider; SvMemoryStream aMemStrm; @@ -1409,7 +1409,7 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties( delete pIn; } } - if ( !aUniqueId.getLength() ) + if ( aUniqueId.isEmpty() ) { if ( pGraphicProvider ) { @@ -1419,7 +1419,7 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties( { rtl::OUString aRelUrl( INetURLObject::GetRelURL( rBaseURI, aGraphicUrl, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_TO_IURI, RTL_TEXTENCODING_UTF8, INetURLObject::FSYS_DETECT ) ); - if ( aRelUrl.getLength() ) + if ( !aRelUrl.isEmpty() ) aGraphicUrl = aRelUrl; } } @@ -1427,7 +1427,7 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties( } } - if ( aGraphicUrl.Len() || aUniqueId.getLength() ) + if ( aGraphicUrl.Len() || !aUniqueId.isEmpty() ) { if ( bMirrored || nAngle ) { @@ -1454,7 +1454,7 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties( else AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture ); - if ( aUniqueId.getLength() ) + if ( !aUniqueId.isEmpty() ) { // write out embedded graphic if ( pGraphicProvider && pPicOutStrm && pShapeBoundRect ) @@ -2960,7 +2960,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT uno::Reference< text::XSimpleText > xText( rXShape, uno::UNO_QUERY ); if ( xText.is() ) aText = xText->getString(); - if ( !aText.getLength() ) + if ( aText.isEmpty() ) aText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "your text" )); // todo: moving into a resource AddOpt( DFF_Prop_gtextUNICODE, aText ); @@ -2969,7 +2969,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT const rtl::OUString sCharFontName ( RTL_CONSTASCII_USTRINGPARAM( "CharFontName" ) ); uno::Any aAny = aXPropSet->getPropertyValue( sCharFontName ); aAny >>= aFontName; - if ( !aFontName.getLength() ) + if ( aFontName.isEmpty() ) aFontName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Arial Black" )); AddOpt( DFF_Prop_gtextFont, aFontName ); diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index 96e81d9dd037..256b06a1249d 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -1119,7 +1119,7 @@ sal_uInt32 ImplEESdrObject::ImplGetText() sal_Bool ImplEESdrObject::ImplHasText() const { Reference< XText > xXText( mXShape, UNO_QUERY ); - return xXText.is() && xXText->getString().getLength(); + return xXText.is() && !xXText->getString().isEmpty(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 4b3decedb737..038dcbe0b12f 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -5125,7 +5125,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r if( pRet ) { ::rtl::OUString aObjName = GetPropertyString( DFF_Prop_wzName, rSt ); - if( aObjName.getLength() > 0 ) + if( !aObjName.isEmpty() ) pRet->SetName( aObjName ); } @@ -7337,14 +7337,14 @@ com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > SvxMS else aFilterName = GetFilterNameFromClassID_Impl( aStgNm ); - uno::Sequence < beans::PropertyValue > aMedium( aFilterName.getLength() ? 3 : 2); + uno::Sequence < beans::PropertyValue > aMedium( aFilterName.isEmpty() ? 2 : 3); aMedium[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InputStream" ) ); uno::Reference < io::XInputStream > xStream = new ::utl::OSeekableInputStreamWrapper( *pStream ); aMedium[0].Value <<= xStream; aMedium[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ); aMedium[1].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:stream" ) ); - if ( aFilterName.getLength() ) + if ( !aFilterName.isEmpty() ) { aMedium[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) ); aMedium[2].Value <<= aFilterName; @@ -7356,7 +7356,7 @@ com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > SvxMS if ( !xObj.is() ) { - if( aFilterName.getLength() ) + if( !aFilterName.isEmpty() ) { // throw the filter parameter away as workaround aMedium.realloc( 2 ); diff --git a/filter/source/msfilter/msfiltertracer.cxx b/filter/source/msfilter/msfiltertracer.cxx index f4840bc074de..0bc2ccbbf2c5 100644 --- a/filter/source/msfilter/msfiltertracer.cxx +++ b/filter/source/msfilter/msfiltertracer.cxx @@ -71,20 +71,20 @@ MSFilterTracer::MSFilterTracer( const ::rtl::OUString& rConfigPath, uno::Sequenc rtl::OUString aName( mpCfgItem->ReadString( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" )), aEmptyString ) ); rtl::OUString aDocumentURL( mpCfgItem->ReadString( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DocumentURL" )), aEmptyString ) ); INetURLObject aLogFile( aDocumentURL ); - if ( aLogFile.GetMainURL( INetURLObject::NO_DECODE ).getLength() ) + if ( !aLogFile.GetMainURL( INetURLObject::NO_DECODE ).isEmpty() ) { - if ( aPath.getLength() ) + if ( !aPath.isEmpty() ) { String aOldName( aLogFile.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::NO_DECODE ) ); aLogFile = INetURLObject( aPath ); aLogFile.insertName( aOldName ); } - if ( aName.getLength() ) + if ( !aName.isEmpty() ) aLogFile.setName( aName ); } else { - if ( aPath.getLength() ) + if ( !aPath.isEmpty() ) aLogFile = INetURLObject( aPath ); else { @@ -96,7 +96,7 @@ MSFilterTracer::MSFilterTracer( const ::rtl::OUString& rConfigPath, uno::Sequenc aLogFile .removeFinalSlash(); } } - if ( !aName.getLength() ) + if ( aName.isEmpty() ) aName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "tracer" )); aLogFile.insertName( aName ); } @@ -191,7 +191,7 @@ void MSFilterTracer::Trace( const rtl::OUString& rElement, const rtl::OUString& if ( mbEnabled && mxLogger.is() ) { sal_Bool bFilter = sal_False; - if ( rMessage.getLength() && mxTextSearch.is() ) + if ( !rMessage.isEmpty() && mxTextSearch.is() ) { maSearchOptions.searchString = rMessage; mxTextSearch->setOptions( maSearchOptions ); @@ -203,7 +203,7 @@ void MSFilterTracer::Trace( const rtl::OUString& rElement, const rtl::OUString& uno::Reference < xml::sax::XAttributeList > xAttrList( new SvXMLAttributeList( *mpAttributeList ) ); if ( mxHandler.is() ) mxHandler->startElement( rElement, xAttrList ); - if ( rMessage.getLength() ) + if ( !rMessage.isEmpty() ) { rtl::OUString aEmpty; mxLogger->logp( 0, aEmpty, aEmpty, rMessage ); diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx index ed1c986dd2c7..044c6910b946 100644 --- a/filter/source/msfilter/mstoolbar.cxx +++ b/filter/source/msfilter/mstoolbar.cxx @@ -328,7 +328,7 @@ bool TBCData::ImportToolBarControl( CustomToolBarImportHelper& helper, std::vect if ( TBCBitMap* pIcon = pSpecificInfo->getIcon() ) { // Without a command openoffice won't display the icon - if ( sCommand.getLength() ) + if ( !sCommand.isEmpty() ) { BitmapEx aBitEx( pIcon->getBitMap() ); if ( pSpecificInfo->getIconMask() ) @@ -345,7 +345,7 @@ bool TBCData::ImportToolBarControl( CustomToolBarImportHelper& helper, std::vect { rtl::OUString sBuiltInCmd = helper.MSOTCIDToOOCommand( *pSpecificInfo->getBtnFace() ); - if ( sBuiltInCmd.getLength() ) + if ( !sBuiltInCmd.isEmpty() ) { uno::Sequence< rtl::OUString> sCmds(1); sCmds[ 0 ] = sBuiltInCmd; @@ -505,7 +505,7 @@ TBCGeneralInfo::ImportToolBarControlData( CustomToolBarImportHelper& helper, std beans::PropertyValue aProp; // probably access to the header would be a better test than seeing if there is an action, e.g. // if ( rHeader.getTct() == 0x01 && rHeader.getTcID() == 0x01 ) // not defined, probably this is a command - if ( extraInfo.getOnAction().getLength() ) + if ( !extraInfo.getOnAction().isEmpty() ) { aProp.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CommandURL") ); ooo::vba::MacroResolvedInfo aMacroInf = ooo::vba::resolveVBAMacro( &helper.GetDocShell(), extraInfo.getOnAction(), true ); diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx index ca7f34d22c76..07a40c05092b 100644 --- a/filter/source/msfilter/msvbahelper.cxx +++ b/filter/source/msfilter/msvbahelper.cxx @@ -106,7 +106,7 @@ SfxObjectShell* findShellForUrl( const rtl::OUString& sMacroURLOrPath ) , rtl::OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ).getStr() ); ::rtl::OUString aName = xModel->getURL() ; - if (0 == aName.getLength()) + if (aName.isEmpty()) { const static rtl::OUString sTitle( RTL_CONSTASCII_USTRINGPARAM("Title" ) ); @@ -143,7 +143,7 @@ SfxObjectShell* findShellForUrl( const rtl::OUString& sMacroURLOrPath ) // sometimes just the name of the document ( without the path // is used bool bDocNameNoPathMatch = false; - if ( aURL.getLength() && aURL.indexOf( '/' ) == -1 ) + if ( !aURL.isEmpty() && aURL.indexOf( '/' ) == -1 ) { sal_Int32 lastSlashIndex = xModel->getURL().lastIndexOf( '/' ); if ( lastSlashIndex > -1 ) @@ -231,7 +231,7 @@ bool hasMacro( SfxObjectShell* pShell, const String& sLibrary, String& sMod, con if( BasicManager* pBasicMgr = pShell ? pShell->GetBasicManager() : 0 ) { aPrjName = pBasicMgr->GetName(); - if( aPrjName.getLength() == 0 ) + if( aPrjName.isEmpty() ) aPrjName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) ); } return aPrjName; @@ -262,7 +262,7 @@ void parseMacro( const rtl::OUString& sMacro, String& sContainer, String& sModul { if( pShell ) { - ::rtl::OUString aLibName = (rLibName.getLength() > 0) ? rLibName : getDefaultProjectName( pShell ); + ::rtl::OUString aLibName = rLibName.isEmpty() ? getDefaultProjectName( pShell ) : rLibName ; String aModuleName = rModuleName; if( hasMacro( pShell, aLibName, aModuleName, rMacroName ) ) return ::rtl::OUStringBuffer( aLibName ).append( sal_Unicode( '.' ) ).append( aModuleName ).append( sal_Unicode( '.' ) ).append( rMacroName ).makeStringAndClear(); @@ -372,7 +372,7 @@ MacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW ); rtl::OUString sCreatedFrom = xDocProps->getTemplateURL(); - if ( sCreatedFrom.getLength() ) + if ( !sCreatedFrom.isEmpty() ) { INetURLObject aObj; aObj.SetURL( sCreatedFrom ); @@ -393,7 +393,7 @@ MacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& sCreatedFrom = sCreatedFrom.copy( 0, nIndex ); rtl::OUString sPrj; - if ( sCreatedFrom.getLength() && xPrjNameCache->hasByName( sCreatedFrom ) ) + if ( !sCreatedFrom.isEmpty() && xPrjNameCache->hasByName( sCreatedFrom ) ) { xPrjNameCache->getByName( sCreatedFrom ) >>= sPrj; // Make sure we don't double up with this project @@ -538,7 +538,7 @@ void SAL_CALL VBAMacroResolver::initialize( const uno::Sequence< uno::Any >& rAr throw uno::RuntimeException(); // second argument: VBA project name - if( !(rArgs[ 1 ] >>= maProjectName) || (maProjectName.getLength() == 0) ) + if( !(rArgs[ 1 ] >>= maProjectName) || (maProjectName.isEmpty()) ) throw uno::RuntimeException(); } @@ -551,7 +551,7 @@ void SAL_CALL VBAMacroResolver::initialize( const uno::Sequence< uno::Any >& rAr // the name may be enclosed in apostrophs ::rtl::OUString aMacroName = trimMacroName( rVBAMacroName ); - if( aMacroName.getLength() == 0 ) + if( aMacroName.isEmpty() ) throw lang::IllegalArgumentException(); // external references not supported here (syntax is "url!macroname" or "[url]!macroname" or "[url]macroname") diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 650f07b1efc2..2f0682c78640 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -156,7 +156,7 @@ ImpPDFTabDialog::ImpPDFTabDialog( Window* pParent, else if ( nLen == 1 ) { Reference< text::XTextRange > xTextRange( xIndexAccess->getByIndex( 0 ), UNO_QUERY ); - if ( xTextRange.is() && ( xTextRange->getString().getLength() == 0 ) ) + if ( xTextRange.is() && ( xTextRange->getString().isEmpty() ) ) mbSelectionPresent = sal_False; } } @@ -252,8 +252,8 @@ ImpPDFTabDialog::ImpPDFTabDialog( Window* pParent, //change text on the Ok button: get the relevant string from resources, update it on the button //according to the exported pdf file destination: send as e-mail or write to file? - GetOKButton().SetText( ( sOkButtonText.getLength() > 0 ) ? - sOkButtonText : OUString( String( PDFFilterResId( STR_PDF_EXPORT ) ) )); + GetOKButton().SetText( ( sOkButtonText.isEmpty() ) ? + OUString( String( PDFFilterResId( STR_PDF_EXPORT ) ) ) : sOkButtonText ); GetCancelButton().SetClickHdl(LINK(this, ImpPDFTabDialog, CancelHdl)); @@ -1217,8 +1217,8 @@ IMPL_LINK( ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl, void*, EMPTYARG ) rtl::OUString aUserPW( aPwdDialog.GetPassword() ); rtl::OUString aOwnerPW( aPwdDialog.GetPassword2() ); - mbHaveUserPassword = (aUserPW.getLength() != 0); - mbHaveOwnerPassword = (aOwnerPW.getLength() != 0); + mbHaveUserPassword = !aUserPW.isEmpty(); + mbHaveOwnerPassword = !aOwnerPW.isEmpty(); mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, aUserPW, true ); diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index f023f04e463b..a027f7479e68 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -325,7 +325,7 @@ static OUString getMimetypeForDocument( const Reference< XMultiServiceFactory >& if( xModuleManager.is() && xStore.is() ) { OUString aDocServiceName = xModuleManager->identify( Reference< XInterface >( xStore, uno::UNO_QUERY ) ); - if ( aDocServiceName.getLength() ) + if ( !aDocServiceName.isEmpty() ) { // get the actual filter name OUString aFilterName; @@ -349,7 +349,7 @@ static OUString getMimetypeForDocument( const Reference< XMultiServiceFactory >& if ( xApplConfig.is() ) { xApplConfig->getByName( OUString( RTL_CONSTASCII_USTRINGPARAM( "ooSetupFactoryActualFilter" ) ) ) >>= aFilterName; - if( aFilterName.getLength() ) + if( !aFilterName.isEmpty() ) { // find the related type name OUString aTypeName; @@ -363,7 +363,7 @@ static OUString getMimetypeForDocument( const Reference< XMultiServiceFactory >& if ( aFilterData[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Type" ) ) ) aFilterData[nInd].Value >>= aTypeName; - if ( aTypeName.getLength() ) + if ( !aTypeName.isEmpty() ) { // find the mediatype Reference< container::XNameAccess > xTypeDetection( @@ -658,7 +658,7 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue //set check for permission change password // if not enabled and no permission password, force permissions to default as if PDF where without encryption - if( mbRestrictPermissions && (xEnc.is() || aPermissionPassword.getLength() > 0) ) + if( mbRestrictPermissions && (xEnc.is() || !aPermissionPassword.isEmpty()) ) { mbEncrypt = sal_True; //permission set as desired, done after @@ -710,7 +710,7 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue aContext.Encryption.CanExtractForAccessibility = mbCanExtractForAccessibility; if( mbEncrypt && ! xEnc.is() ) xEnc = PDFWriter::InitEncryption( aPermissionPassword, aOpenPassword, aContext.Encryption.Security128bit ); - if( mbEncrypt && aPermissionPassword.getLength() && ! aPreparedPermissionPassword.getLength() ) + if( mbEncrypt && !aPermissionPassword.isEmpty() && ! aPreparedPermissionPassword.getLength() ) aPreparedPermissionPassword = comphelper::OStorageHelper::CreatePackageEncryptionData( aPermissionPassword ); } // after this point we don't need the legacy clear passwords anymore @@ -828,7 +828,7 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue aRenderOptions[ 5 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ); aRenderOptions[ 5 ].Value <<= aPageRange; - if( aPageRange.getLength() || !aSelection.hasValue() ) + if( !aPageRange.isEmpty() || !aSelection.hasValue() ) { aSelection = Any(); aSelection <<= mxSrcDoc; @@ -866,7 +866,7 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue bSecondPassForImpressNotes = sal_True; // the export notes checkbox needs to be disabled } - if( !aPageRange.getLength() ) + if( aPageRange.isEmpty() ) { aPageRange = OUStringBuffer() .append( static_cast< sal_Int32 >( 1 ) ) @@ -903,7 +903,7 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue // if during the export the doc locale was set copy it to PDF writer const com::sun::star::lang::Locale& rLoc( pPDFExtOutDevData->GetDocumentLocale() ); - if( rLoc.Language.getLength() ) + if( !rLoc.Language.isEmpty() ) pPDFWriter->SetDocumentLocale( rLoc ); if( bRet ) diff --git a/filter/source/placeware/exporter.cxx b/filter/source/placeware/exporter.cxx index b925b655de5f..8473e3885713 100644 --- a/filter/source/placeware/exporter.cxx +++ b/filter/source/placeware/exporter.cxx @@ -202,7 +202,7 @@ static void createSlideFile( Reference< XComponent > xDoc, ZipFile& rZipFile, co Reference< XDocumentProperties > xDocProps( xDPS->getDocumentProperties() ); aTemp = xDocProps->getTitle(); - if( 0 == aTemp.getLength() ) + if( aTemp.isEmpty() ) { sal_Int32 nPos1 = rURL.lastIndexOf( (sal_Unicode)'/' ); if( -1 != nPos1 ) @@ -229,7 +229,7 @@ static void createSlideFile( Reference< XComponent > xDoc, ZipFile& rZipFile, co aTemp = xDocProps->getAuthor(); - if( aTemp.getLength() ) + if( !aTemp.isEmpty() ) { aInfo += OString( "PresenterName: " ); aInfo += convertString( aTemp ); @@ -243,7 +243,7 @@ static void createSlideFile( Reference< XComponent > xDoc, ZipFile& rZipFile, co PageEntry* pEntry = (*aIter++); aInfo += OString( "slide: " ); - if( pEntry->getTitle().getLength() ) + if( !pEntry->getTitle().isEmpty() ) { aInfo += convertString( pEntry->getTitle() ); } @@ -261,7 +261,7 @@ static void createSlideFile( Reference< XComponent > xDoc, ZipFile& rZipFile, co aInfo += aNewLine; - if( pEntry->getNotes().getLength() ) + if( !pEntry->getNotes().isEmpty() ) { aInfo += OString( "notes: " ); aInfo += convertString( pEntry->getNotes() ); diff --git a/filter/source/placeware/tempfile.cxx b/filter/source/placeware/tempfile.cxx index ad41465c8791..eab253fc9f2d 100644 --- a/filter/source/placeware/tempfile.cxx +++ b/filter/source/placeware/tempfile.cxx @@ -139,7 +139,7 @@ TempFile::~TempFile() { close(); - if( maURL.getLength() ) + if( !maURL.isEmpty() ) osl::File::remove( maURL ); } diff --git a/filter/source/placeware/zip.cxx b/filter/source/placeware/zip.cxx index 32d819a62c4c..549bfcaafb8c 100644 --- a/filter/source/placeware/zip.cxx +++ b/filter/source/placeware/zip.cxx @@ -254,9 +254,9 @@ bool ZipFile::addFile( osl::File& rFile, const OString& rName ) if( !mbOpen ) return false; - OSL_ASSERT( 0 != rName.getLength() ); + OSL_ASSERT( !rName.isEmpty() ); - if(0 == rName.getLength()) + if(rName.isEmpty()) return false; mnRC = rFile.open( osl_File_OpenFlag_Read ); diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index d22c700b8e3b..6149ddf2960d 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -1325,7 +1325,7 @@ sal_Bool SVGFilter::implExportPages( const SVGFilter::XDrawPageSequence & rxPage mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sPageId ); OUString sPageName = implGetInterfaceName( rxPages[i] ); - if( sPageName.getLength() && !mbSinglePage ) + if( !(sPageName.isEmpty() || mbSinglePage )) mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrName, sPageName ); { @@ -1565,7 +1565,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) OUString aTitle; xShapePropSet->getPropertyValue( B2UCONST( "Title" ) ) >>= aTitle; - if( aTitle.getLength() ) + if( !aTitle.isEmpty() ) { SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "title", sal_True, sal_True ); xExtDocHandler->characters( aTitle ); @@ -1573,7 +1573,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) OUString aDescription; xShapePropSet->getPropertyValue( B2UCONST( "Description" ) ) >>= aDescription; - if( aDescription.getLength() ) + if( !aDescription.isEmpty() ) { SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "desc", sal_True, sal_True ); xExtDocHandler->characters( aDescription ); @@ -1582,7 +1582,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) Reference< XInterface > xRef( rxShape, UNO_QUERY ); const OUString& rShapeId = implGetValidIDFromInterface( xRef ); - if( rShapeId.getLength() ) + if( !rShapeId.isEmpty() ) { mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", rShapeId ); //mpSVGExport->AddAttributeIdLegacy( XML_NAMESPACE_DRAW, rShapeId ); diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx index 4b374c059afa..eef0e6f43832 100644 --- a/filter/source/svg/svgfontexport.cxx +++ b/filter/source/svg/svgfontexport.cxx @@ -140,7 +140,7 @@ void SVGFontExport::implCollectGlyphs() break; } - if( aText.getLength() ) + if( !aText.isEmpty() ) { GlyphSet& rGlyphSet = implGetGlyphSet( aVDev.GetFont() ); ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > xBI( @@ -286,7 +286,7 @@ void SVGFontExport::implEmbedGlyph( OutputDevice& rOut, const ::rtl::OUString& r mrExport.AddAttribute( XML_NAMESPACE_NONE, "horiz-adv-x", ::rtl::OUString::valueOf( aBoundRect.GetWidth() ) ); const ::rtl::OUString aPathString( SVGActionWriter::GetPathString( aPolyPoly, sal_False ) ); - if( aPathString.getLength() ) + if( !aPathString.isEmpty() ) { mrExport.AddAttribute( XML_NAMESPACE_NONE, "d", aPathString ); } diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index cfeaaf4c892b..c25bdbc16c7c 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -1060,7 +1060,7 @@ struct AnnotatingVisitor { aCurrToken=sValue.getToken(0,';',nIndex); - if( aCurrToken.getLength() ) + if( !aCurrToken.isEmpty() ) { // split attrib & value nDummyIndex=0; @@ -1621,7 +1621,7 @@ struct ShapeWritingVisitor if (rShearX != 0.0f) sTransformValue += USTR("skewX(")+::rtl::OUString::valueOf(rShearX)+USTR(") "); - if (!sTransformValue.getLength()) + if (sTransformValue.isEmpty()) return; xAttrs->AddAttribute( USTR("draw:transform"), sTransformValue); } diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 6a3c0b0e5fe7..9f70046dfe7f 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -161,7 +161,7 @@ void SVGAttributeWriter::AddColorAttr( const char* pColorAttrName, mrExport.AddAttribute( XML_NAMESPACE_NONE, pColorAttrName, aColor ); - if( aColorOpacity.getLength() && mrExport.IsUseOpacity() ) + if( !aColorOpacity.isEmpty() && mrExport.IsUseOpacity() ) mrExport.AddAttribute( XML_NAMESPACE_NONE, pColorOpacityAttrName, aColorOpacity ); } @@ -177,7 +177,7 @@ void SVGAttributeWriter::AddPaintAttr( const Color& rLineColor, const Color& rFi AddGradientDef( *pObjBoundRect, *pFillGradient, aGradientId ); - if( aGradientId.getLength() ) + if( !aGradientId.isEmpty() ) { ::rtl::OUString aGradientURL( B2UCONST( "url(#" ) ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrFill, ( aGradientURL += aGradientId ) += B2UCONST( ")" ) ); @@ -673,7 +673,7 @@ void SVGActionWriter::ImplWriteShape( const SVGShapeDescriptor& rShape, sal_Bool mpContext->AddPaintAttr( rShape.maShapeLineColor, rShape.maShapeFillColor, &aBoundRect, rShape.mapShapeGradient.get() ); - if( rShape.maId.getLength() ) + if( !rShape.maId.isEmpty() ) mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrId, rShape.maId ); if( rShape.mnStrokeWidth ) diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx index 78fcd893dfd9..3e3abb02d09c 100644 --- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx +++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx @@ -150,7 +150,7 @@ sal_Bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< ::com::sun::star //******************** //Template Loading if Required //******************** - if (msTemplateName.getLength()){ + if (!msTemplateName.isEmpty()){ Reference< XStyleFamiliesSupplier > xstylefamiliessupplier(mxDoc, UNO_QUERY); Reference< XNameAccess >xName; diff --git a/filter/source/xmlfilterdetect/filterdetect.cxx b/filter/source/xmlfilterdetect/filterdetect.cxx index cb68f5747257..b70194bfa12c 100644 --- a/filter/source/xmlfilterdetect/filterdetect.cxx +++ b/filter/source/xmlfilterdetect/filterdetect.cxx @@ -198,17 +198,17 @@ bool isXMLStream(const ::rtl::OString& aHeaderStrm) sal_Int32 new_nlength=0; sal_Int32 i = 0 ; - while ((i < nLength) && (sTypeName.getLength() == 0)) + while ((i < nLength) && (sTypeName.isEmpty())) { Any elem = xTypeCont->getByName(myTypes[i]); elem >>=lProps; new_nlength = lProps.getLength(); sal_Int32 j =0; - while (j < new_nlength && (sTypeName.getLength() == 0)) + while (j < new_nlength && (sTypeName.isEmpty())) { ::rtl::OUString tmpStr; lProps[j].Value >>=tmpStr; - if ((lProps[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ClipboardFormat"))) && tmpStr.getLength()) + if ((lProps[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ClipboardFormat"))) && !tmpStr.isEmpty()) { sTypeName = supportedByType(tmpStr,resultString, myTypes[i]); } @@ -222,7 +222,7 @@ bool isXMLStream(const ::rtl::OString& aHeaderStrm) OSL_FAIL( "An Exception occurred while opening File stream" ); } - if (sTypeName.getLength()) + if (!sTypeName.isEmpty()) { if (location == aArguments.getLength()) { diff --git a/filter/source/xsltdialog/typedetectionexport.cxx b/filter/source/xsltdialog/typedetectionexport.cxx index d373fe4898be..a01b462c440e 100644 --- a/filter/source/xsltdialog/typedetectionexport.cxx +++ b/filter/source/xsltdialog/typedetectionexport.cxx @@ -52,7 +52,7 @@ TypeDetectionExporter::TypeDetectionExporter( Reference< XMultiServiceFactory >& static OUString createRelativeURL( const OUString& rFilterName, const OUString& rURL ) { - if( rURL.getLength() && + if( !rURL.isEmpty() && (rURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM("http:") ) != 0) && (rURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM("shttp:") ) != 0) && (rURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM("jar:") ) != 0) && @@ -60,7 +60,7 @@ static OUString createRelativeURL( const OUString& rFilterName, const OUString& { INetURLObject aURL( rURL ); OUString aName( aURL.GetName() ); - if( aName.getLength() == 0 ) + if( aName.isEmpty() ) { sal_Int32 nPos = rURL.lastIndexOf( sal_Unicode( '/' ) ); if( nPos == -1 ) @@ -138,7 +138,7 @@ void TypeDetectionExporter::doExport( Reference< XOutputStream > xOS, const XML OUString sValue( sal_Unicode('0') ); sValue += sComma; sValue += sComma; - if( pFilter->maDocType.getLength() ) + if( !pFilter->maDocType.isEmpty() ) { sValue += sDocTypePrefix; sValue += pFilter->maDocType; diff --git a/filter/source/xsltdialog/typedetectionimport.cxx b/filter/source/xsltdialog/typedetectionimport.cxx index b370414dd1cd..218434840900 100644 --- a/filter/source/xsltdialog/typedetectionimport.cxx +++ b/filter/source/xsltdialog/typedetectionimport.cxx @@ -207,13 +207,13 @@ filter_info_impl* TypeDetectionImporter::createFilterForNode( Node * pNode ) if( pTypeNode == NULL ) bOk = false; - if( pFilter->maFilterName.getLength() == 0 ) + if( pFilter->maFilterName.isEmpty() ) bOk = false; - if( pFilter->maInterfaceName.getLength() == 0 ) + if( pFilter->maInterfaceName.isEmpty() ) bOk = false; - if( pFilter->maType.getLength() == 0 ) + if( pFilter->maType.isEmpty() ) bOk = false; if( pFilter->maFlags == 0 ) @@ -225,7 +225,7 @@ filter_info_impl* TypeDetectionImporter::createFilterForNode( Node * pNode ) if( aAdapterService != sXSLTFilterService ) bOk = false; - if( pFilter->maExtension.getLength() == 0 ) + if( pFilter->maExtension.isEmpty() ) bOk = false; if( !bOk ) diff --git a/filter/source/xsltdialog/xmlfileview.cxx b/filter/source/xsltdialog/xmlfileview.cxx index 899a0a8b9c74..c38dfc932c18 100644 --- a/filter/source/xsltdialog/xmlfileview.cxx +++ b/filter/source/xsltdialog/xmlfileview.cxx @@ -519,7 +519,7 @@ XMLSourceFileDialog::XMLSourceFileDialog( Window* pParent, ResMgr& rResMgr, cons XMLSourceFileDialog::~XMLSourceFileDialog() { - if( maFileURL.getLength() ) + if( !maFileURL.isEmpty() ) osl::File::remove( maFileURL ); delete mpTextWindow; @@ -528,7 +528,7 @@ XMLSourceFileDialog::~XMLSourceFileDialog() void XMLSourceFileDialog::ShowWindow( const rtl::OUString& rFileName, const filter_info_impl* pFilterInfo ) { EnterWait(); - if( maFileURL.getLength() ) + if( !maFileURL.isEmpty() ) { osl::File::remove( maFileURL ); delete mpTextWindow; diff --git a/filter/source/xsltdialog/xmlfilterjar.cxx b/filter/source/xsltdialog/xmlfilterjar.cxx index 8c4863aa032e..078b62cb774b 100644 --- a/filter/source/xsltdialog/xmlfilterjar.cxx +++ b/filter/source/xsltdialog/xmlfilterjar.cxx @@ -146,7 +146,7 @@ static void addFile( Reference< XInterface > xRootFolder, Reference< XSingleServ void XMLFilterJarHelper::addFile( Reference< XInterface > xRootFolder, Reference< XSingleServiceFactory > xFactory, const OUString& rSourceFile ) throw( Exception ) { - if( rSourceFile.getLength() && + if( !rSourceFile.isEmpty() && (rSourceFile.compareToAscii( RTL_CONSTASCII_STRINGPARAM("http:") ) != 0) && (rSourceFile.compareToAscii( RTL_CONSTASCII_STRINGPARAM("shttp:") ) != 0) && (rSourceFile.compareToAscii( RTL_CONSTASCII_STRINGPARAM("jar:") ) != 0) && @@ -209,14 +209,14 @@ bool XMLFilterJarHelper::savePackage( const OUString& rPackageURL, const XMLFilt if( xFilterRoot.is() ) { - if( pFilter->maDTD.getLength() ) + if( !pFilter->maDTD.isEmpty() ) addFile( xFilterRoot, xFactory, pFilter->maDTD ); - if( pFilter->maExportXSLT.getLength() ) + if( !pFilter->maExportXSLT.isEmpty() ) addFile( xFilterRoot, xFactory, pFilter->maExportXSLT ); try { - if( pFilter->maImportXSLT.getLength() ) + if( !pFilter->maImportXSLT.isEmpty() ) addFile( xFilterRoot, xFactory, pFilter->maImportXSLT ); } catch(const com::sun::star::container::ElementExistException&) @@ -226,7 +226,7 @@ bool XMLFilterJarHelper::savePackage( const OUString& rPackageURL, const XMLFilt OSL_FAIL( "XMLFilterJarHelper::same named xslt filter exception!" ); } - if( pFilter->maImportTemplate.getLength() ) + if( !pFilter->maImportTemplate.isEmpty() ) addFile( xFilterRoot, xFactory, pFilter->maImportTemplate ); } @@ -382,7 +382,7 @@ bool XMLFilterJarHelper::copyFile( Reference< XHierarchicalNameAccess > xIfc, OU rURL = URIHelper::SmartRel2Abs( aBaseURL, szPackagePath, Link(), false ); - if( rURL.getLength() ) + if( !rURL.isEmpty() ) { // create output directory if needed if( !createDirectory( rURL ) ) diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 306fe595dee8..4a04257e2efa 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -503,12 +503,12 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi } // check if we need to copy the template - if( pFilterEntry->maImportTemplate.getLength() ) + if( !pFilterEntry->maImportTemplate.isEmpty() ) { if( !pFilterEntry->maImportTemplate.matchIgnoreAsciiCase( sTemplatePath ) ) { INetURLObject aSourceURL( pFilterEntry->maImportTemplate ); - if( aSourceURL.GetName().getLength() != 0 ) + if( !aSourceURL.GetName().isEmpty() ) { OUString aDestURL( sTemplatePath ); aDestURL += pFilterEntry->maFilterName; @@ -531,13 +531,13 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi if( bOk ) { - if( pFilterEntry->maType.getLength() == 0 ) + if( pFilterEntry->maType.isEmpty() ) { pFilterEntry->maType = createUniqueTypeName( pNewInfo->maFilterName ); } // update import/export flags - if( pFilterEntry->maImportXSLT.getLength() ) + if( !pFilterEntry->maImportXSLT.isEmpty() ) { pFilterEntry->maFlags |= 1; } @@ -546,7 +546,7 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi pFilterEntry->maFlags &= ~1; } - if( pFilterEntry->maExportXSLT.getLength() ) + if( !pFilterEntry->maExportXSLT.isEmpty() ) { pFilterEntry->maFlags |= 2; } @@ -1379,7 +1379,7 @@ OUString getApplicationUIName( const OUString& rServiceName ) else { OUString aRet = String( RESID( STR_UNKNOWN_APPLICATION ) ); - if( rServiceName.getLength() ) + if( !rServiceName.isEmpty() ) { aRet += OUString( RTL_CONSTASCII_USTRINGPARAM( " (" )); aRet += rServiceName; @@ -1581,7 +1581,7 @@ String XMLFilterListBox::getEntryString( const filter_info_impl* pInfo ) const String aEntryStr( pInfo->maFilterName ); aEntryStr += '\t'; // aEntryStr += String( getApplicationUIName( pInfo->maDocumentService ) ); - if ( pInfo->maExportService.getLength() > 0 ) + if ( !pInfo->maExportService.isEmpty() ) aEntryStr += String( getApplicationUIName( pInfo->maExportService ) ); else aEntryStr += String( getApplicationUIName( pInfo->maImportService ) ); diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.cxx b/filter/source/xsltdialog/xmlfiltertabdialog.cxx index 8b046f93706d..242ef898ced6 100644 --- a/filter/source/xsltdialog/xmlfiltertabdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertabdialog.cxx @@ -134,10 +134,10 @@ bool XMLFilterTabDialog::onOk() String aReplace2; // 1. see if the filter name is ok - if( (mpNewInfo->maFilterName.getLength() == 0) || (mpNewInfo->maFilterName != mpOldInfo->maFilterName) ) + if( (mpNewInfo->maFilterName.isEmpty()) || (mpNewInfo->maFilterName != mpOldInfo->maFilterName) ) { // if the user deleted the filter name, we reset the original filter name - if( mpNewInfo->maFilterName.getLength() == 0 ) + if( mpNewInfo->maFilterName.isEmpty() ) { mpNewInfo->maFilterName = mpOldInfo->maFilterName; } @@ -166,10 +166,10 @@ bool XMLFilterTabDialog::onOk() } // 2. see if the interface name is ok - if( (mpNewInfo->maInterfaceName.getLength() == 0) || (mpNewInfo->maInterfaceName != mpOldInfo->maInterfaceName) ) + if( (mpNewInfo->maInterfaceName.isEmpty()) || (mpNewInfo->maInterfaceName != mpOldInfo->maInterfaceName) ) { // if the user deleted the interface name, we reset the original filter name - if( mpNewInfo->maInterfaceName.getLength() == 0 ) + if( mpNewInfo->maInterfaceName.isEmpty() ) { mpNewInfo->maInterfaceName = mpOldInfo->maInterfaceName; } @@ -272,7 +272,7 @@ bool XMLFilterTabDialog::onOk() } // see if we have at least an import or an export dtd - if((mpNewInfo->maImportXSLT.getLength() == 0) && (mpNewInfo->maExportXSLT.getLength() == 0) ) + if((mpNewInfo->maImportXSLT.isEmpty()) && (mpNewInfo->maExportXSLT.isEmpty()) ) { nErrorId = STR_ERROR_EXPORT_XSLT_NOT_FOUND; nErrorPage = RID_XML_FILTER_TABPAGE_XSLT; diff --git a/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx b/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx index 847087e0c929..8042a2c7000f 100644 --- a/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx +++ b/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx @@ -110,7 +110,7 @@ bool XMLFilterTabPageBasic::FillInfo( filter_info_impl* pInfo ) pInfo->maComment = string_encode( maEDDescription.GetText() ); - if( pInfo->maDocumentService.getLength() ) + if( !pInfo->maDocumentService.isEmpty() ) { std::vector< application_info_impl* >& rInfos = getApplicationInfos(); std::vector< application_info_impl* >::iterator aIter( rInfos.begin() ); @@ -140,7 +140,7 @@ void XMLFilterTabPageBasic::SetInfo(const filter_info_impl* pInfo) if( pInfo->maDocumentService.getLength() ) maCBApplication.SetText( getApplicationUIName( pInfo->maDocumentService ) ); */ - if( pInfo->maExportService.getLength() ) + if( !pInfo->maExportService.isEmpty() ) maCBApplication.SetText( getApplicationUIName( pInfo->maExportService ) ); else maCBApplication.SetText( getApplicationUIName( pInfo->maImportService ) ); diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx b/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx index 30442a3bd141..9df711f327b6 100644 --- a/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx +++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx @@ -161,7 +161,7 @@ void XMLFilterTabPageXSLT::SetURL( SvtURLBox& rURLBox, const OUString& rURL ) rURLBox.SetBaseURL( rURL ); rURLBox.SetText( rURL ); } - else if( rURL.getLength() ) + else if( !rURL.isEmpty() ) { rtl::OUString aURL( rURL ); aURL = URIHelper::SmartRel2Abs( sInstPath, aURL, Link(), false ); diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx index aaf274fa8e17..0c341aadddbc 100644 --- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx @@ -261,7 +261,7 @@ void XMLFilterTestDialog::updateCurrentDocumentButtonState( Reference< XComponen } } - if( 0 == aTitle.getLength() ) + if( aTitle.isEmpty() ) { Reference< XStorable > xStorable( xCurrentDocument, UNO_QUERY ); if( xStorable.is() ) @@ -307,13 +307,13 @@ void XMLFilterTestDialog::initDialog() maFLImport.Enable( bImport ); maFTImportXSLT.Enable( bImport ); maFTImportXSLTFile.Enable( bImport ); - maFTImportTemplate.Enable( bImport && mpFilterInfo->maImportTemplate.getLength() ); - maFTImportTemplateFile.Enable( bImport && mpFilterInfo->maImportTemplate.getLength() ); + maFTImportTemplate.Enable( bImport && !mpFilterInfo->maImportTemplate.isEmpty() ); + maFTImportTemplateFile.Enable( bImport && !mpFilterInfo->maImportTemplate.isEmpty() ); maFTTransformFile.Enable( bImport ); maCBXDisplaySource.Enable( bImport ); maPBImportBrowse.Enable( bImport ); - maPBRecentDocument.Enable( bImport && maImportRecentFile.getLength() ); - maFTNameOfRecentFile.Enable( bImport && maImportRecentFile.getLength() ); + maPBRecentDocument.Enable( bImport && !maImportRecentFile.isEmpty() ); + maFTNameOfRecentFile.Enable( bImport && !maImportRecentFile.isEmpty() ); maFTImportXSLTFile.SetText( getFileNameFromURL( mpFilterInfo->maImportXSLT ) ); maFTImportTemplateFile.SetText( getFileNameFromURL( mpFilterInfo->maImportTemplate ) ); @@ -376,7 +376,7 @@ void XMLFilterTestDialog::onExportBrowse() } - if( (nFound == 15) && (aType.getLength() && aService == mpFilterInfo->maDocumentService) ) + if( (nFound == 15) && (!aType.isEmpty() && aService == mpFilterInfo->maDocumentService) ) { // see if this filter is not supressed in dialog if( (nFlags & 0x1000) == 0 ) @@ -484,8 +484,8 @@ void XMLFilterTestDialog::doExport( Reference< XComponent > xComp ) // create xslt exporter Reference< XOutputStream > xIS( new comphelper::OSLOutputStreamWrapper( aOutputFile ) ); - int bUseDTD = (mpFilterInfo->maDTD.getLength() != 0) ? 1 : 0 ; - int bUseDocType = (mpFilterInfo->maDocType.getLength() != 0 ) ? 1 : 0; + int bUseDTD = mpFilterInfo->maDTD.isEmpty() ? 0 : 1 ; + int bUseDocType = mpFilterInfo->maDocType.isEmpty() ? 0 : 1; Sequence< PropertyValue > aSourceData( 2 + bUseDTD + bUseDocType ); int i = 0; diff --git a/filter/source/xsltfilter/XSLTFilter.cxx b/filter/source/xsltfilter/XSLTFilter.cxx index e272ecdab4bc..c61fe17f306c 100644 --- a/filter/source/xsltfilter/XSLTFilter.cxx +++ b/filter/source/xsltfilter/XSLTFilter.cxx @@ -322,7 +322,7 @@ m_rServiceFactory(r), m_bTerminated(sal_False), m_bError(sal_False) args[2] <<= nv; OUString serviceName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.documentconversion.LibXSLTTransformer")); - if (msUserData[1].getLength() != 0) + if (!msUserData[1].isEmpty()) serviceName = msUserData[1]; m_tcontrol = Reference (m_rServiceFactory->createInstanceWithArguments(serviceName, args), UNO_QUERY); @@ -486,7 +486,7 @@ m_rServiceFactory(r), m_bTerminated(sal_False), m_bError(sal_False) args[3] <<= nv; OUString serviceName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.documentconversion.LibXSLTTransformer")); - if (msUserData[1].getLength() != 0) + if (!msUserData[1].isEmpty()) serviceName = msUserData[1]; m_tcontrol = Reference (m_rServiceFactory->createInstanceWithArguments(serviceName, args), UNO_QUERY); -- cgit