diff options
author | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-01-19 16:01:33 -0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-01-19 22:07:59 -0200 |
commit | 6a1390eaf6464e71668c402d262a21c9192278e9 (patch) | |
tree | 8dda8971f5559c941cd4aa8a19af1835c70ace2b /unotools | |
parent | 55b6485978bbfe17c1355909a5e27d8c846a4ee8 (diff) |
Fix for fdo43460 Part XLII getLength() to isEmpty()
Part XLII
Modules
unotools
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/bootstrap.cxx | 12 | ||||
-rw-r--r-- | unotools/source/config/configitem.cxx | 20 | ||||
-rw-r--r-- | unotools/source/config/confignode.cxx | 4 | ||||
-rw-r--r-- | unotools/source/config/configpathes.cxx | 6 | ||||
-rw-r--r-- | unotools/source/config/eventcfg.cxx | 2 | ||||
-rw-r--r-- | unotools/source/config/fontcfg.cxx | 26 | ||||
-rw-r--r-- | unotools/source/config/lingucfg.cxx | 22 | ||||
-rw-r--r-- | unotools/source/config/moduleoptions.cxx | 10 | ||||
-rw-r--r-- | unotools/source/config/securityoptions.cxx | 2 | ||||
-rw-r--r-- | unotools/source/config/syslocaleoptions.cxx | 10 | ||||
-rw-r--r-- | unotools/source/config/useroptions.cxx | 2 | ||||
-rw-r--r-- | unotools/source/i18n/localedatawrapper.cxx | 8 | ||||
-rw-r--r-- | unotools/source/ucbhelper/progresshandlerwrap.cxx | 4 | ||||
-rw-r--r-- | unotools/source/ucbhelper/tempfile.cxx | 8 |
14 files changed, 68 insertions, 68 deletions
diff --git a/unotools/source/config/bootstrap.cxx b/unotools/source/config/bootstrap.cxx index 8e94a92fa27a..ae5c8ad81a83 100644 --- a/unotools/source/config/bootstrap.cxx +++ b/unotools/source/config/bootstrap.cxx @@ -185,7 +185,7 @@ PathStatus implCheckStatusOfURL(OUString const& _sURL, osl::DirectoryItem& aDirI PathStatus eStatus = Bootstrap::DATA_UNKNOWN; - if (_sURL.getLength() != 0) + if (!_sURL.isEmpty()) { switch( DirectoryItem::get(_sURL, aDirItem) ) { @@ -235,7 +235,7 @@ bool implNormalizeURL(OUString & _sURL, osl::DirectoryItem& aDirItem) OUString aNormalizedURL = aFileStatus.getFileURL(); - if (aNormalizedURL.getLength() == 0) + if (aNormalizedURL.isEmpty()) return false; // #109863# sal/osl returns final slash for file URLs contradicting @@ -337,7 +337,7 @@ PathStatus checkStatusAndNormalizeURL(OUString & _sURL) PathStatus eStatus = Bootstrap::DATA_UNKNOWN; - if (_sURL.getLength() == 0) + if (_sURL.isEmpty()) eStatus = Bootstrap::DATA_MISSING; else if ( !implMakeAbsoluteURL(_sURL) ) @@ -372,12 +372,12 @@ PathStatus getDerivedPath( OUString sDerivedURL; OSL_PRECOND(!_rData.getFrom(_sBootstrapParameter,sDerivedURL),"Setting for derived path is already defined"); - OSL_PRECOND(_sRelativeURL.getLength() != 0 && _sRelativeURL[0] != cURLSeparator,"Invalid Relative URL"); + OSL_PRECOND(!_sRelativeURL.isEmpty() && _sRelativeURL[0] != cURLSeparator,"Invalid Relative URL"); PathStatus aStatus = _aBaseStatus; // do we have a base path ? - if (_aBaseURL.getLength()) + if (!_aBaseURL.isEmpty()) { OSL_PRECOND(_aBaseURL[_aBaseURL.getLength()-1] != cURLSeparator,"Unexpected: base URL ends in slash"); @@ -649,7 +649,7 @@ OUString Bootstrap::getBuildIdData(OUString const& _sDefault) OUString sBuildId; // read buildid from version.ini (versionrc), if it doesn't exist or buildid is empty if ( data().getVersionValue( csBuildIdItem, sBuildId, _sDefault ) != sal_True || - sBuildId.getLength() == 0 ) + sBuildId.isEmpty() ) // read buildid from bootstrap.ini (bootstraprc) sBuildId = data().getBootstrapValue( csBuildIdItem, _sDefault ); return sBuildId; diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index eec5846dea35..eb31e9cec97f 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -432,7 +432,7 @@ Sequence< sal_Bool > ConfigItem::GetReadOnlyStates(const com::sun::star::uno::Se OUString sProperty; ::utl::splitLastFromConfigurationPath(sName,sPath,sProperty); - if (!sPath.getLength() && !sProperty.getLength()) + if (sPath.isEmpty() && sProperty.isEmpty()) { OSL_FAIL("ConfigItem::IsReadonly()\nsplitt failed\n"); continue; @@ -441,7 +441,7 @@ Sequence< sal_Bool > ConfigItem::GetReadOnlyStates(const com::sun::star::uno::Se Reference< XInterface > xNode; Reference< XPropertySet > xSet ; Reference< XPropertySetInfo > xInfo; - if (sPath.getLength()) + if (!sPath.isEmpty()) { Any aNode = xHierarchyAccess->getByHierarchicalName(sPath); if (!(aNode >>= xNode) || !xNode.is()) @@ -746,7 +746,7 @@ Sequence< OUString > ConfigItem::GetNodeNames(const OUString& rNode, ConfigNameF try { Reference<XNameAccess> xCont; - if(rNode.getLength()) + if(!rNode.isEmpty()) { Any aNode = xHierarchyAccess->getByHierarchicalName(rNode); aNode >>= xCont; @@ -775,7 +775,7 @@ sal_Bool ConfigItem::ClearNodeSet(const OUString& rNode) try { Reference<XNameContainer> xCont; - if(rNode.getLength()) + if(!rNode.isEmpty()) { Any aNode = xHierarchyAccess->getByHierarchicalName(rNode); aNode >>= xCont; @@ -814,7 +814,7 @@ sal_Bool ConfigItem::ClearNodeElements(const OUString& rNode, Sequence< OUString try { Reference<XNameContainer> xCont; - if(rNode.getLength()) + if(!rNode.isEmpty()) { Any aNode = xHierarchyAccess->getByHierarchicalName(rNode); aNode >>= xCont; @@ -888,7 +888,7 @@ sal_Bool ConfigItem::SetSetProperties( try { Reference<XNameContainer> xCont; - if(rNode.getLength()) + if(!rNode.isEmpty()) { Any aNode = xHierarchyAccess->getByHierarchicalName(rNode); aNode >>= xCont; @@ -930,7 +930,7 @@ sal_Bool ConfigItem::SetSetProperties( Sequence< Any> aSetValues(rValues.getLength()); Any* pSetValues = aSetValues.getArray(); - sal_Bool bEmptyNode = rNode.getLength() == 0; + sal_Bool bEmptyNode = rNode.isEmpty(); for(sal_Int32 k = 0; k < rValues.getLength(); k++) { pSetNames[k] = pProperties[k].Name.copy( bEmptyNode ? 1 : 0); @@ -987,7 +987,7 @@ sal_Bool ConfigItem::ReplaceSetProperties( try { Reference<XNameContainer> xCont; - if(rNode.getLength()) + if(!rNode.isEmpty()) { Any aNode = xHierarchyAccess->getByHierarchicalName(rNode); aNode >>= xCont; @@ -1069,7 +1069,7 @@ sal_Bool ConfigItem::ReplaceSetProperties( Sequence< Any> aSetValues(rValues.getLength()); Any* pSetValues = aSetValues.getArray(); - sal_Bool bEmptyNode = rNode.getLength() == 0; + sal_Bool bEmptyNode = rNode.isEmpty(); for(sal_Int32 k = 0; k < rValues.getLength(); k++) { pSetNames[k] = pProperties[k].Name.copy( bEmptyNode ? 1 : 0); @@ -1162,7 +1162,7 @@ sal_Bool ConfigItem::AddNode(const rtl::OUString& rNode, const rtl::OUString& rN try { Reference<XNameContainer> xCont; - if(rNode.getLength()) + if(!rNode.isEmpty()) { Any aNode = xHierarchyAccess->getByHierarchicalName(rNode); aNode >>= xCont; diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx index a6a413837e97..12c6ad0a687b 100644 --- a/unotools/source/config/confignode.cxx +++ b/unotools/source/config/confignode.cxx @@ -173,7 +173,7 @@ namespace utl if (getEscape()) { Reference< XStringEscape > xEscaper(m_xDirectAccess, UNO_QUERY); - if (xEscaper.is() && sName.getLength()) + if (xEscaper.is() && !sName.isEmpty()) { try { @@ -414,7 +414,7 @@ namespace utl // check if the name refers to a indirect descendant else if (m_xHierarchyAccess.is() && m_xHierarchyAccess->hasByHierarchicalName(_rPath)) { - OSL_ASSERT(_rPath.getLength()); + OSL_ASSERT(!_rPath.isEmpty()); ::rtl::OUString sParentPath, sLocalName; diff --git a/unotools/source/config/configpathes.cxx b/unotools/source/config/configpathes.cxx index 05b69b088968..6a583ba92d63 100644 --- a/unotools/source/config/configpathes.cxx +++ b/unotools/source/config/configpathes.cxx @@ -230,7 +230,7 @@ sal_Int32 lcl_findPrefixEnd(OUString const& _sNestedPath, OUString const& _sPref sal_Bool isPrefixOfConfigurationPath(OUString const& _sNestedPath, OUString const& _sPrefixPath) { - return _sPrefixPath.getLength() == 0 || lcl_findPrefixEnd(_sNestedPath,_sPrefixPath) != 0; + return _sPrefixPath.isEmpty() || lcl_findPrefixEnd(_sNestedPath,_sPrefixPath) != 0; } //---------------------------------------------------------------------------- @@ -243,7 +243,7 @@ OUString dropPrefixFromConfigurationPath(OUString const& _sNestedPath, } else { - OSL_ENSURE(_sPrefixPath.getLength() == 0, "Path does not start with expected prefix"); + OSL_ENSURE(_sPrefixPath.isEmpty(), "Path does not start with expected prefix"); return _sNestedPath; } @@ -256,7 +256,7 @@ OUString lcl_wrapName(const OUString& _sContent, const OUString& _sType) const sal_Unicode * const pBeginContent = _sContent.getStr(); const sal_Unicode * const pEndContent = pBeginContent + _sContent.getLength(); - OSL_PRECOND(_sType.getLength(), "Unexpected config type name: empty"); + OSL_PRECOND(!_sType.isEmpty(), "Unexpected config type name: empty"); OSL_PRECOND(pBeginContent <= pEndContent, "Invalid config name: empty"); if (pBeginContent == pEndContent) diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx index 84fe68b3e691..589410a89686 100644 --- a/unotools/source/config/eventcfg.cxx +++ b/unotools/source/config/eventcfg.cxx @@ -189,7 +189,7 @@ void GlobalEventConfig_Impl::Commit() for(int i=0;it!=it_end;++it,++i) { //no point in writing out empty bindings! - if(it->second.getLength() == 0 ) + if(it->second.isEmpty() ) continue; sNode = sPrefix + it->first + sPostfix; OSL_TRACE("writing binding for: %s",::rtl::OUStringToOString(sNode , RTL_TEXTENCODING_ASCII_US ).pData->buffer); diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index b3dd31da5d6e..cab7eb3dfb12 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -249,17 +249,17 @@ OUString DefaultFontConfiguration::getDefaultFont( const Locale& rLocale, int nT OUString aType = OUString::createFromAscii( getKeyType( nType ) ); OUString aRet = tryLocale( aLocale, aType ); - if( ! aRet.getLength() && aLocale.Variant.getLength() ) + if( aRet.isEmpty() && !aLocale.Variant.isEmpty() ) { aLocale.Variant = OUString(); aRet = tryLocale( aLocale, aType ); } - if( ! aRet.getLength() && aLocale.Country.getLength() ) + if( aRet.isEmpty() && !aLocale.Country.isEmpty() ) { aLocale.Country = OUString(); aRet = tryLocale( aLocale, aType ); } - if( ! aRet.getLength() ) + if( aRet.isEmpty() ) { aLocale.Language = OUString( RTL_CONSTASCII_USTRINGPARAM( "en" ) ); aRet = tryLocale( aLocale, aType ); @@ -270,12 +270,12 @@ OUString DefaultFontConfiguration::getDefaultFont( const Locale& rLocale, int nT OUString DefaultFontConfiguration::getUserInterfaceFont( const Locale& rLocale ) const { Locale aLocale = rLocale; - if( ! aLocale.Language.getLength() ) + if( aLocale.Language.isEmpty() ) aLocale = SvtSysLocale().GetUILocale(); OUString aUIFont = getDefaultFont( aLocale, DEFAULTFONT_UI_SANS ); - if( aUIFont.getLength() ) + if( !aUIFont.isEmpty() ) return aUIFont; // fallback mechanism (either no configuration or no entry in configuration @@ -978,7 +978,7 @@ void FontSubstConfiguration::fillSubstVector( const com::sun::star::uno::Referen while( nIndex != -1 ) { OUString aSubst( pLine->getToken( 0, ';', nIndex ) ); - if( aSubst.getLength() ) + if( !aSubst.isEmpty() ) { UniqueSubstHash::iterator aEntry = maSubstHash.find( aSubst ); if (aEntry != maSubstHash.end()) @@ -1009,7 +1009,7 @@ FontWeight FontSubstConfiguration::getSubstWeight( const com::sun::star::uno::Re if( aAny.getValueTypeClass() == TypeClass_STRING ) { const OUString* pLine = (const OUString*)aAny.getValue(); - if( pLine->getLength() ) + if( !pLine->isEmpty() ) { for( weight=SAL_N_ELEMENTS(pWeightNames)-1; weight >= 0; weight-- ) if( pLine->equalsIgnoreAsciiCaseAscii( pWeightNames[weight].pName ) ) @@ -1041,7 +1041,7 @@ FontWidth FontSubstConfiguration::getSubstWidth( const com::sun::star::uno::Refe if( aAny.getValueTypeClass() == TypeClass_STRING ) { const OUString* pLine = (const OUString*)aAny.getValue(); - if( pLine->getLength() ) + if( !pLine->isEmpty() ) { for( width=SAL_N_ELEMENTS(pWidthNames)-1; width >= 0; width-- ) if( pLine->equalsIgnoreAsciiCaseAscii( pWidthNames[width].pName ) ) @@ -1073,7 +1073,7 @@ unsigned long FontSubstConfiguration::getSubstType( const com::sun::star::uno::R if( aAny.getValueTypeClass() == TypeClass_STRING ) { const OUString* pLine = (const OUString*)aAny.getValue(); - if( pLine->getLength() ) + if( !pLine->isEmpty() ) { sal_Int32 nIndex = 0; while( nIndex != -1 ) @@ -1196,10 +1196,10 @@ const FontNameAttr* FontSubstConfiguration::getSubstInfo( const String& rFontNam aLocale.Country = rLocale.Country.toAsciiUpperCase(); aLocale.Variant = rLocale.Variant.toAsciiUpperCase(); - if( ! aLocale.Language.getLength() ) + if( aLocale.Language.isEmpty() ) aLocale = SvtSysLocale().GetUILocale(); - while( aLocale.Language.getLength() ) + while( !aLocale.Language.isEmpty() ) { boost::unordered_map< Locale, LocaleSubst, LocaleHash >::const_iterator lang = m_aSubst.find( aLocale ); if( lang != m_aSubst.end() ) @@ -1220,9 +1220,9 @@ const FontNameAttr* FontSubstConfiguration::getSubstInfo( const String& rFontNam } } // gradually become more unspecific - if( aLocale.Variant.getLength() ) + if( !aLocale.Variant.isEmpty() ) aLocale.Variant = OUString(); - else if( aLocale.Country.getLength() ) + else if( !aLocale.Country.isEmpty() ) aLocale.Country = OUString(); else if( ! aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "en" ) ) ) aLocale.Language = OUString( RTL_CONSTASCII_USTRINGPARAM( "en" ) ); diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index 27516fbe14d2..866e142f1788 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -92,7 +92,7 @@ static sal_Int16 lcl_CfgAnyToLanguage( const uno::Any &rVal ) { OUString aTmp; rVal >>= aTmp; - return (aTmp.getLength() == 0) ? LANGUAGE_SYSTEM : MsLangId::convertIsoStringToLanguage( aTmp ); + return (aTmp.isEmpty()) ? LANGUAGE_SYSTEM : MsLangId::convertIsoStringToLanguage( aTmp ); } SvtLinguOptions::SvtLinguOptions() @@ -923,7 +923,7 @@ sal_Bool SvtLinguConfig::GetSupportedDictionaryFormatsFor( const rtl::OUString &rSetEntry, uno::Sequence< rtl::OUString > &rFormatList ) const { - if (rSetName.getLength() == 0 || rSetEntry.getLength() == 0) + if (rSetName.isEmpty() || rSetEntry.isEmpty()) return sal_False; bool bSuccess = false; try @@ -974,7 +974,7 @@ static bool lcl_GetFileUrlFromOrigin( uno::Reference< util::XMacroExpander > &rxMacroExpander ) { bool bSuccess = false; - if (rOrigin.getLength() > 0 && rxMacroExpander.is()) + if (!rOrigin.isEmpty() && rxMacroExpander.is()) { rtl::OUString aURL( rOrigin ); if (( aURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( EXPAND_PROTOCOL )) == 0 ) && @@ -1011,7 +1011,7 @@ sal_Bool SvtLinguConfig::GetDictionaryEntry( const rtl::OUString &rNodeName, SvtLinguConfigDictionaryEntry &rDicEntry ) const { - if (rNodeName.getLength() == 0) + if (rNodeName.isEmpty()) return sal_False; bool bSuccess = false; try @@ -1029,7 +1029,7 @@ sal_Bool SvtLinguConfig::GetDictionaryEntry( (xNA->getByName( aG_Format ) >>= aFormatName) && (xNA->getByName( aG_Locales ) >>= aLocaleNames); DBG_ASSERT( aLocations.getLength(), "Dictionary locations not set" ); - DBG_ASSERT( aFormatName.getLength(), "Dictionary format name not set" ); + DBG_ASSERT( !aFormatName.isEmpty(), "Dictionary format name not set" ); DBG_ASSERT( aLocaleNames.getLength(), "No locales set for the dictionary" ); // if sucessful continue @@ -1078,7 +1078,7 @@ std::vector< SvtLinguConfigDictionaryEntry > SvtLinguConfig::GetActiveDictionari const rtl::OUString &rFormatName ) { std::vector< SvtLinguConfigDictionaryEntry > aRes; - if (rFormatName.getLength() == 0) + if (rFormatName.isEmpty()) return aRes; try @@ -1106,7 +1106,7 @@ std::vector< SvtLinguConfigDictionaryEntry > SvtLinguConfig::GetActiveDictionari if (bDicIsActive) { - DBG_ASSERT( aDicEntry.aFormatName.getLength(), + DBG_ASSERT( !aDicEntry.aFormatName.isEmpty(), "FormatName not set" ); DBG_ASSERT( aDicEntry.aLocations.getLength(), "Locations not set" ); @@ -1204,7 +1204,7 @@ rtl::OUString SvtLinguConfig::GetSpellAndGrammarContextSuggestionImage( ) const { rtl::OUString aRes; - if (rServiceImplName.getLength() > 0) + if (!rServiceImplName.isEmpty()) { rtl::OUString aImageName( A2OU( "SpellAndGrammarContextMenuSuggestionImage" )); rtl::OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) ); @@ -1219,7 +1219,7 @@ rtl::OUString SvtLinguConfig::GetSpellAndGrammarContextDictionaryImage( ) const { rtl::OUString aRes; - if (rServiceImplName.getLength() > 0) + if (!rServiceImplName.isEmpty()) { rtl::OUString aImageName( A2OU( "SpellAndGrammarContextMenuDictionaryImage" )); rtl::OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) ); @@ -1234,7 +1234,7 @@ rtl::OUString SvtLinguConfig::GetSpellAndGrammarContextDictionaryImage( ) const { rtl::OUString aRes; - if (rServiceImplName.getLength() > 0) + if (!rServiceImplName.isEmpty()) { rtl::OUString aImageName( A2OU( "ThesaurusDialogImage" )); rtl::OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) ); @@ -1249,7 +1249,7 @@ rtl::OUString SvtLinguConfig::GetSpellAndGrammarContextDictionaryImage( ) const { rtl::OUString aRes; - if (rServiceImplName.getLength() > 0) + if (!rServiceImplName.isEmpty()) { rtl::OUString aImageName( A2OU( "SynonymsContextMenuImage" )); rtl::OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) ); diff --git a/unotools/source/config/moduleoptions.cxx b/unotools/source/config/moduleoptions.cxx index 6f7403ac2d98..c66bbff292d4 100644 --- a/unotools/source/config/moduleoptions.cxx +++ b/unotools/source/config/moduleoptions.cxx @@ -158,7 +158,7 @@ struct FactoryInfo { lProperties[nRealyChanged].Name = sNodeBase + PROPERTYNAME_TEMPLATEFILE; - if ( sTemplateFile.getLength() > 0 ) + if ( !sTemplateFile.isEmpty() ) { lProperties[nRealyChanged].Value <<= getStringSubstitution() @@ -235,7 +235,7 @@ struct FactoryInfo //--------------------------------------------------------------------------------------------------------- void initTemplateFile( const ::rtl::OUString& sNewTemplateFile ) { - if ( sNewTemplateFile.getLength() > 0 ) + if ( !sNewTemplateFile.isEmpty() ) { sTemplateFile = getStringSubstitution() @@ -1338,7 +1338,7 @@ SvtModuleOptions::EFactory SvtModuleOptions::ClassifyFactoryByURL(const ::rtl::O // is there already a filter inside the descriptor? ::rtl::OUString sFilterName = stlDesc.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName")), ::rtl::OUString()); - if (sFilterName.getLength()) + if (!sFilterName.isEmpty()) { try { @@ -1357,7 +1357,7 @@ SvtModuleOptions::EFactory SvtModuleOptions::ClassifyFactoryByURL(const ::rtl::O // is there already a type inside the descriptor? ::rtl::OUString sTypeName = stlDesc.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TypeName")), ::rtl::OUString()); - if (!sTypeName.getLength()) + if (sTypeName.isEmpty()) { // no :-( // start flat detection of URL @@ -1365,7 +1365,7 @@ SvtModuleOptions::EFactory SvtModuleOptions::ClassifyFactoryByURL(const ::rtl::O sTypeName = xDetect->queryTypeByURL(sURL); } - if (!sTypeName.getLength()) + if (sTypeName.isEmpty()) return E_UNKNOWN_FACTORY; // yes - there is a type info diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx index cb925a240174..2b762f0adae2 100644 --- a/unotools/source/config/securityoptions.cxx +++ b/unotools/source/config/securityoptions.cxx @@ -902,7 +902,7 @@ sal_Bool SvtSecurityOptions_Impl::IsSecureURL( const OUString& sURL , // Trusted referer given? // NO => bState will be false per default // YES => search for it in our internal url list - if( sReferer.getLength() > 0 ) + if( !sReferer.isEmpty() ) { // Search in internal list ::rtl::OUString sRef = sReferer.toAsciiLowerCase(); diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx index 7f40155ec528..eced74b60487 100644 --- a/unotools/source/config/syslocaleoptions.cxx +++ b/unotools/source/config/syslocaleoptions.cxx @@ -60,7 +60,7 @@ namespace com::sun::star::lang::Locale lcl_str_to_locale( const ::rtl::OUString rStr ) { com::sun::star::lang::Locale aRet; - if ( rStr.getLength() ) + if ( !rStr.isEmpty() ) { aRet = com::sun::star::lang::Locale(); sal_Int32 nSep = rStr.indexOf('-'); @@ -255,7 +255,7 @@ SvtSysLocaleOptions_Impl::~SvtSysLocaleOptions_Impl() void SvtSysLocaleOptions_Impl::MakeRealLocale() { m_aRealLocale = lcl_str_to_locale( m_aLocaleString ); - if ( m_aRealLocale.Language.getLength() ) + if ( !m_aRealLocale.Language.isEmpty() ) { m_eRealLanguage = MsLangId::convertLocaleToLanguage( m_aRealLocale ); } @@ -270,7 +270,7 @@ void SvtSysLocaleOptions_Impl::MakeRealUILocale() { // as we can't switch UILocale at runtime, we only store changes in the configuration m_aRealUILocale = lcl_str_to_locale( m_aUILocaleString ); - if ( m_aRealUILocale.Language.getLength() ) + if ( !m_aRealUILocale.Language.isEmpty() ) { m_eRealUILanguage = MsLangId::convertLocaleToLanguage( m_aRealUILocale ); } @@ -380,7 +380,7 @@ void SvtSysLocaleOptions_Impl::SetLocaleString( const OUString& rStr ) MsLangId::setConfiguredSystemLanguage( m_eRealLanguage ); SetModified(); sal_uLong nHint = SYSLOCALEOPTIONS_HINT_LOCALE; - if ( !m_aCurrencyString.getLength() ) + if ( m_aCurrencyString.isEmpty() ) nHint |= SYSLOCALEOPTIONS_HINT_CURRENCY; NotifyListeners( nHint ); } @@ -434,7 +434,7 @@ void SvtSysLocaleOptions_Impl::Notify( const Sequence< rtl::OUString >& seqPrope seqValues[nProp] >>= m_aLocaleString; m_bROLocale = seqROStates[nProp]; nHint |= SYSLOCALEOPTIONS_HINT_LOCALE; - if ( !m_aCurrencyString.getLength() ) + if ( m_aCurrencyString.isEmpty() ) nHint |= SYSLOCALEOPTIONS_HINT_CURRENCY; MakeRealLocale(); } diff --git a/unotools/source/config/useroptions.cxx b/unotools/source/config/useroptions.cxx index ccd42f458fb4..3802072ec865 100644 --- a/unotools/source/config/useroptions.cxx +++ b/unotools/source/config/useroptions.cxx @@ -772,7 +772,7 @@ void SvtUserOptions_Impl::SetApartment( const ::rtl::OUString& sApartment ) sFullName = GetFirstName(); sFullName.trim(); - if ( sFullName.getLength() ) + if ( !sFullName.isEmpty() ) sFullName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")); sFullName += GetLastName(); sFullName.trim(); diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index 2e8ebf7619c6..12aa78d3151d 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -314,11 +314,11 @@ void LocaleDataWrapper::invalidateData() if (areChecksEnabled()) { aDebugLocale = xLoc[i].Language; - if ( xLoc[i].Country.getLength() ) + if ( !xLoc[i].Country.isEmpty() ) { aDebugLocale += '_'; aDebugLocale += String( xLoc[i].Country); - if ( xLoc[i].Variant.getLength() ) + if ( !xLoc[i].Variant.isEmpty() ) { aDebugLocale += '_'; aDebugLocale += String( xLoc[i].Variant); @@ -326,7 +326,7 @@ void LocaleDataWrapper::invalidateData() } } - if ( xLoc[i].Variant.getLength() ) + if ( !xLoc[i].Variant.isEmpty() ) { if (areChecksEnabled()) { @@ -379,7 +379,7 @@ void LocaleDataWrapper::invalidateData() aMsg += String::CreateFromInt32( eLang, 16 ); aMsg.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " -> " ) ); aMsg += String( aLanguage); - if ( aCountry.getLength() ) + if ( !aCountry.isEmpty() ) { aMsg += '_'; aMsg += String( aCountry); diff --git a/unotools/source/ucbhelper/progresshandlerwrap.cxx b/unotools/source/ucbhelper/progresshandlerwrap.cxx index 5ccfc39af736..5bbfe5fac56d 100644 --- a/unotools/source/ucbhelper/progresshandlerwrap.cxx +++ b/unotools/source/ucbhelper/progresshandlerwrap.cxx @@ -51,7 +51,7 @@ sal_Bool getStatusFromAny_Impl( const Any& aAny, ::rtl::OUString& aText, sal_Int if( !bNumIsSet && ( aSetList[ind] >>= nNum ) ) bNumIsSet = sal_True; else - !aText.getLength() && ( aSetList[ind] >>= aText ); + aText.isEmpty() && ( aSetList[ind] >>= aText ); } return bNumIsSet; @@ -81,7 +81,7 @@ void SAL_CALL ProgressHandlerWrap::update( const Any& Status ) if( getStatusFromAny_Impl( Status, aText, nValue ) ) { - if( aText.getLength() ) m_xStatusIndicator->setText( aText ); + if( !aText.isEmpty() ) m_xStatusIndicator->setText( aText ); m_xStatusIndicator->setValue( nValue ); } } diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index cc70904f55d4..449355687825 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -84,7 +84,7 @@ rtl::OUString getParentName( const rtl::OUString& aFileName ) sal_Bool ensuredir( const rtl::OUString& rUnqPath ) { rtl::OUString aPath; - if ( rUnqPath.getLength() < 1 ) + if ( rUnqPath.isEmpty() ) return sal_False; // remove trailing slash @@ -152,7 +152,7 @@ String ConstructTempDir_Impl( const String* pParent ) ::osl::FileBase::getFileURLFromSystemPath( ::ucbhelper::getSystemPathFromFileURL( xManager, aTmp ), aRet ); - if ( aRet.getLength() ) + if ( !aRet.isEmpty() ) { ::osl::DirectoryItem aItem; sal_Int32 i = aRet.getLength(); @@ -172,7 +172,7 @@ String ConstructTempDir_Impl( const String* pParent ) if ( !aName.Len() ) { ::rtl::OUString &rTempNameBase_Impl = TempNameBase_Impl::get(); - if (rTempNameBase_Impl.getLength() == 0) + if (rTempNameBase_Impl.isEmpty()) { ::rtl::OUString ustrTempDirURL; ::osl::FileBase::RC rc = ::osl::File::getTempDirURL( @@ -181,7 +181,7 @@ String ConstructTempDir_Impl( const String* pParent ) rTempNameBase_Impl = ustrTempDirURL; } // if no parent or invalid parent : use default directory - DBG_ASSERT( rTempNameBase_Impl.getLength(), "No TempDir!" ); + DBG_ASSERT( !rTempNameBase_Impl.isEmpty(), "No TempDir!" ); aName = rTempNameBase_Impl; ensuredir( aName ); } |