summaryrefslogtreecommitdiffstats
path: root/filter/source/config
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@alta.org.br>2011-12-23 18:23:14 -0200
committerIvan Timofeev <timofeev.i.s@gmail.com>2011-12-26 14:05:06 +0400
commite7bddf732798508e347221590110486e97bb45e6 (patch)
tree5b37f87e2683d758ae9429215fa9cdec26a40b4a /filter/source/config
parentfdo#32936: Remove Tahoma from the Hebrew font list (except the UI list) (diff)
downloadcore-e7bddf732798508e347221590110486e97bb45e6.tar.gz
core-e7bddf732798508e347221590110486e97bb45e6.zip
Fix for fdo43460 Part XVII getLength() to isEmpty()
Part XVII Module fileaccess and filter
Diffstat (limited to 'filter/source/config')
-rw-r--r--filter/source/config/cache/basecontainer.cxx6
-rw-r--r--filter/source/config/cache/cacheitem.cxx4
-rw-r--r--filter/source/config/cache/cacheupdatelistener.cxx2
-rw-r--r--filter/source/config/cache/filtercache.cxx28
-rw-r--r--filter/source/config/cache/filterfactory.cxx6
-rw-r--r--filter/source/config/cache/querytokenizer.cxx2
-rw-r--r--filter/source/config/cache/typedetection.cxx42
7 files changed, 45 insertions, 45 deletions
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();