-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Please find attached a partial fix for Easy Hack FDO43460
Part XXI Modules i18npool, idl, idlc, io, javaunohelper, jvmaccess - -- Olivier Hallot Founder, Board of Directors Member - The Document Foundation LibreOffice translation leader for Brazilian Portuguese +55-21-8822-8812 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJO+MoJAAoJEJp3R7nH3vLxopQIAIqBe2ylM0W0XG2zrUILA1A2 0a8KsptrVP3gU4RYJ4TPA8A17aew50RlFs+aGnwGI8c4oRWNYoD9sTQKzCvMc6t8 1GXZmTlviqPhLGZCYE02b3pf+SWf5xIMxXOUkcpqbt9ikR9wPWcr0PXsFExwX28R Esy0IAnrtHOjuse0uWmfVNBb2cpvBUcQZ767ZgcQB8PwjWukzKcnAm0BWHpNMful /liR7f0jSrKI/D4Kw00xik0XEBI6A6mqro8/9+y6qICeLmd4WEmm2hoA8JnLTJ+C 2IsPbtBYcocdw7aLrwB+/8RLMmGQwWyRlpFzowZDutqJtMKHLAmwOq6/D/RjGYs= =f6a7 -----END PGP SIGNATURE-----
>From a60b5f0d20e96c39efb8e2c75d413ea6a728131c Mon Sep 17 00:00:00 2001 From: Olivier Hallot <olivier.hal...@alta.org.br> Date: Mon, 26 Dec 2011 17:19:24 -0200 Subject: [PATCH] Fix for fdo43460 Part XXI getLength() to isEmpty() Part XXI Modules i18npool, idl, idlc, io, javaunohelper, jvmaccess --- .../source/breakiterator/breakiteratorImpl.cxx | 4 +- .../source/breakiterator/breakiterator_unicode.cxx | 2 +- i18npool/source/collator/collator_unicode.cxx | 2 +- .../defaultnumberingprovider.cxx | 2 +- i18npool/source/indexentry/indexentrysupplier.cxx | 4 +- .../source/indexentry/indexentrysupplier_asian.cxx | 2 +- .../indexentry/indexentrysupplier_common.cxx | 2 +- .../indexentry/indexentrysupplier_default.cxx | 8 ++-- .../indexentry/indexentrysupplier_ja_phonetic.cxx | 2 +- i18npool/source/isolang/isolang.cxx | 12 ++-- i18npool/source/isolang/mslangid.cxx | 8 ++-- i18npool/source/localedata/LocaleNode.cxx | 54 ++++++++++---------- i18npool/source/localedata/localedata.cxx | 2 +- i18npool/source/paper/paper.cxx | 8 ++-- i18npool/source/search/textsearch.cxx | 2 +- .../transliteration/transliteration_Ignore.cxx | 4 +- .../transliteration/transliteration_body.cxx | 6 +- idl/source/prj/database.cxx | 4 +- idl/source/prj/svidl.cxx | 4 +- idlc/source/astdeclaration.cxx | 4 +- idlc/source/astdump.cxx | 8 ++-- idlc/source/astscope.cxx | 4 +- idlc/source/errorhandler.cxx | 2 +- idlc/source/idlccompile.cxx | 4 +- io/source/acceptor/acceptor.cxx | 4 +- javaunohelper/source/javaunohelper.cxx | 2 +- jvmaccess/source/classpath.cxx | 2 +- 27 files changed, 81 insertions(+), 81 deletions(-) diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx index f7690c1..1d26968 100644 --- a/i18npool/source/breakiterator/breakiteratorImpl.cxx +++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx @@ -231,7 +231,7 @@ sal_Int32 SAL_CALL BreakIteratorImpl::beginOfSentence( const OUString& Text, sal { if (nStartPos < 0 || nStartPos > Text.getLength()) return -1; - if (Text.getLength() == 0) return 0; + if (Text.isEmpty()) return 0; return LBI->beginOfSentence(Text, nStartPos, rLocale); } @@ -240,7 +240,7 @@ sal_Int32 SAL_CALL BreakIteratorImpl::endOfSentence( const OUString& Text, sal_I { if (nStartPos < 0 || nStartPos > Text.getLength()) return -1; - if (Text.getLength() == 0) return 0; + if (Text.isEmpty()) return 0; return LBI->endOfSentence(Text, nStartPos, rLocale); } diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx index 78ba7a6..5f35795 100644 --- a/i18npool/source/breakiterator/breakiterator_unicode.cxx +++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx @@ -129,7 +129,7 @@ void SAL_CALL BreakIterator_Unicode::loadICUBreakIterator(const com::sun::star:: OOoRuleBasedBreakIterator *rbi = NULL; - if (breakRules.getLength() > breakType && breakRules[breakType].getLength() > 0) { + if (breakRules.getLength() > breakType && !breakRules[breakType].isEmpty()) { rbi = new OOoRuleBasedBreakIterator(udata_open("OpenOffice", "brk", OUStringToOString(breakRules[breakType], RTL_TEXTENCODING_ASCII_US).getStr(), &status), status); } else { diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx index 6eebd6f..0488d59 100644 --- a/i18npool/source/collator/collator_unicode.cxx +++ b/i18npool/source/collator/collator_unicode.cxx @@ -79,7 +79,7 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang:: if (!collator) { UErrorCode status = U_ZERO_ERROR; OUString rule = LocaleData().getCollatorRuleByAlgorithm(rLocale, rAlgorithm); - if (rule.getLength() > 0) { + if (!rule.isEmpty()) { collator = new RuleBasedCollator(reinterpret_cast<const UChar *>(rule.getStr()), status); // UChar != sal_Unicode in MinGW if (! U_SUCCESS(status)) throw RuntimeException(); } diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index 6c4cb5f..27a673d 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -532,7 +532,7 @@ static int should_ignore( OUString s ) { // return true if blank or null - return s.compareToAscii(" ")==0 || (s.getLength()>0 && s[0]==0); + return s.compareToAscii(" ")==0 || (!s.isEmpty() && s[0]==0); } static diff --git a/i18npool/source/indexentry/indexentrysupplier.cxx b/i18npool/source/indexentry/indexentrysupplier.cxx index cb53771..3d87914 100644 --- a/i18npool/source/indexentry/indexentrysupplier.cxx +++ b/i18npool/source/indexentry/indexentrysupplier.cxx @@ -129,13 +129,13 @@ IndexEntrySupplier::getLocaleSpecificIndexEntrySupplier(const Locale& rLocale, c else if (xMSF.is()) { LocaleData ld; aLocale = rLocale; - if (rSortAlgorithm.getLength() == 0) + if (rSortAlgorithm.isEmpty()) aSortAlgorithm = ld.getDefaultIndexAlgorithm( rLocale ); else aSortAlgorithm = rSortAlgorithm; OUString module = ld.getIndexModuleByAlgorithm(rLocale, aSortAlgorithm); - if (module.getLength() > 0 && createLocaleSpecificIndexEntrySupplier(module)) + if (!module.isEmpty() && createLocaleSpecificIndexEntrySupplier(module)) return xIES; sal_Int32 l = rLocale.Language.getLength(); diff --git a/i18npool/source/indexentry/indexentrysupplier_asian.cxx b/i18npool/source/indexentry/indexentrysupplier_asian.cxx index d25830f..1c88b9b 100644 --- a/i18npool/source/indexentry/indexentrysupplier_asian.cxx +++ b/i18npool/source/indexentry/indexentrysupplier_asian.cxx @@ -104,7 +104,7 @@ IndexEntrySupplier_asian::compareIndexEntry( // equivalent of phonetic entries does not mean equivalent of index entries. // we have to continue comparing index entry here. - if (result == 0 && usePhonetic && rPhoneticEntry1.getLength() > 0 && + if (result == 0 && usePhonetic && !rPhoneticEntry1.isEmpty() && rLocale1.Language == rLocale2.Language && rLocale1.Country == rLocale2.Country && rLocale1.Variant == rLocale2.Variant) result = collator->compareString(rIndexEntry1, rIndexEntry2); diff --git a/i18npool/source/indexentry/indexentrysupplier_common.cxx b/i18npool/source/indexentry/indexentrysupplier_common.cxx index 01dcb62..cd44168 100644 --- a/i18npool/source/indexentry/indexentrysupplier_common.cxx +++ b/i18npool/source/indexentry/indexentrysupplier_common.cxx @@ -119,7 +119,7 @@ IndexEntrySupplier_Common::getEntry( const OUString& IndexEntry, // rLocale for phonetic entry is same as aLocale for algorithm, // which means Chinese phonetic will not be used for Japanese algorithm; // phonetic entry is not blank. - if (usePhonetic && PhoneticEntry.getLength() > 0 && rLocale.Language == aLocale.Language && + if (usePhonetic && !PhoneticEntry.isEmpty() && rLocale.Language == aLocale.Language && rLocale.Country == aLocale.Country && rLocale.Variant == aLocale.Variant) return PhoneticEntry; else diff --git a/i18npool/source/indexentry/indexentrysupplier_default.cxx b/i18npool/source/indexentry/indexentrysupplier_default.cxx index de24b96..7b054e3 100644 --- a/i18npool/source/indexentry/indexentrysupplier_default.cxx +++ b/i18npool/source/indexentry/indexentrysupplier_default.cxx @@ -133,7 +133,7 @@ sal_Int16 Index::compare(sal_Unicode c1, sal_Unicode c2) sal_Int16 Index::getIndexWeight(const OUString& rIndexEntry) { sal_Int32 startPos=0; - if (skipping_chars.getLength() > 0) + if (!skipping_chars.isEmpty()) while (skipping_chars.indexOf(rIndexEntry[startPos]) >= 0) startPos++; if (mkey_count > 0) { @@ -156,7 +156,7 @@ OUString Index::getIndexDescription(const OUString& rIndexEntry) { sal_Int16 wgt = getIndexWeight(rIndexEntry); if (wgt < MAX_KEYS) { - if (keys[wgt].desc.getLength()) + if (!keys[wgt].desc.isEmpty()) return keys[wgt].desc; else if (keys[wgt].key > 0) return OUString(&keys[wgt].key, 1); @@ -174,10 +174,10 @@ void Index::makeIndexKeys(const lang::Locale &rLocale, const OUString &algorithm { OUString keyStr = LocaleData().getIndexKeysByAlgorithm(rLocale, algorithm); - if (!keyStr.getLength()) { + if (keyStr.isEmpty()) { keyStr = LocaleData().getIndexKeysByAlgorithm(LOCALE_EN, LocaleData().getDefaultIndexAlgorithm(LOCALE_EN)); - if (!keyStr.getLength()) + if (keyStr.isEmpty()) throw RuntimeException(); } diff --git a/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx b/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx index 92af92b..eb0ee3b 100644 --- a/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx +++ b/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx @@ -55,7 +55,7 @@ OUString SAL_CALL IndexEntrySupplier_ja_phonetic::getIndexKey( const OUString& I const OUString& PhoneticEntry, const lang::Locale& rLocale ) throw (com::sun::star::uno::RuntimeException) { - return getIndexCharacter( PhoneticEntry.getLength() > 0 ? PhoneticEntry : IndexEntry, rLocale, OUString()); + return getIndexCharacter( (PhoneticEntry.isEmpty() ? IndexEntry : PhoneticEntry) , rLocale, OUString()); } sal_Int16 SAL_CALL IndexEntrySupplier_ja_phonetic::compareIndexEntry( diff --git a/i18npool/source/isolang/isolang.cxx b/i18npool/source/isolang/isolang.cxx index 68a654b..f9f7b49 100644 --- a/i18npool/source/isolang/isolang.cxx +++ b/i18npool/source/isolang/isolang.cxx @@ -848,7 +848,7 @@ rtl::OUString MsLangId::convertLanguageToIsoString( LanguageType nLang, rtl::OUString aLangStr; rtl::OUString aCountry; convertLanguageToIsoNames( nLang, aLangStr, aCountry ); - if ( aCountry.getLength() ) + if ( !aCountry.isEmpty() ) { rtl::OUStringBuffer aBuf( aLangStr); aBuf.append( cSep ); @@ -868,7 +868,7 @@ rtl::OString MsLangId::convertLanguageToIsoByteString( LanguageType nLang, rtl::OString aLangStr; rtl::OString aCountry; convertLanguageToIsoNames( nLang, aLangStr, aCountry ); - if ( aCountry.getLength() ) + if ( !aCountry.isEmpty() ) { rtl::OStringBuffer aBuf( aLangStr); aBuf.append( cSep ); @@ -896,7 +896,7 @@ LanguageType MsLangId::convertIsoNamesToLanguage( const rtl::OUString& rLang, { if ( aLowerLang.equalsAscii( pEntry->maLangStr ) ) { - if ( !aUpperCountry.getLength() || + if ( aUpperCountry.isEmpty() || aUpperCountry.equalsAscii( pEntry->maCountry ) ) return pEntry->mnLang; if ( !pFirstLang ) @@ -953,7 +953,7 @@ LanguageType MsLangId::convertIsoNamesToLanguage( const rtl::OUString& rLang, // if only the country is set, look for any entry matching the country // (to allow reading country and language in separate steps, in any order) - if ( rCountry.getLength() && !rLang.getLength() ) + if ( !rCountry.isEmpty() && rLang.isEmpty() ) { const IsoLangEntry* pEntry2 = aImplIsoLangEntries; do @@ -1070,7 +1070,7 @@ LanguageType MsLangId::convertUnxByteStringToLanguage( } // if there is a glibc modifier, first look for exact match in modifier table - if (aAtString.getLength()) + if (!aAtString.isEmpty()) { // language is lower case in table rtl::OString aLowerLang = aLang.toAsciiLowerCase(); @@ -1082,7 +1082,7 @@ LanguageType MsLangId::convertUnxByteStringToLanguage( if (( aLowerLang.equals( pGLIBCModifiersEntry->maLangStr ) ) && ( aAtString.equals( pGLIBCModifiersEntry->maAtString ) )) { - if ( !aUpperCountry.getLength() || + if ( aUpperCountry.isEmpty() || aUpperCountry.equals( pGLIBCModifiersEntry->maCountry ) ) { return pGLIBCModifiersEntry->mnLang; diff --git a/i18npool/source/isolang/mslangid.cxx b/i18npool/source/isolang/mslangid.cxx index e5661da..59a37ed 100644 --- a/i18npool/source/isolang/mslangid.cxx +++ b/i18npool/source/isolang/mslangid.cxx @@ -154,7 +154,7 @@ LanguageType MsLangId::resolveSystemLanguageByScriptType( LanguageType nLang, sa void MsLangId::convertLanguageToLocale( LanguageType nLang, ::com::sun::star::lang::Locale & rLocale ) { - if (rLocale.Variant.getLength()) + if (!rLocale.Variant.isEmpty()) rLocale.Variant = rtl::OUString(); convertLanguageToIsoNames( nLang, rLocale.Language, rLocale.Country); } @@ -184,7 +184,7 @@ LanguageType MsLangId::convertLocaleToLanguage( const ::com::sun::star::lang::Locale& rLocale ) { // empty language => LANGUAGE_SYSTEM - if (rLocale.Language.getLength() == 0) + if (rLocale.Language.isEmpty()) return LANGUAGE_SYSTEM; LanguageType nRet = convertIsoNamesToLanguage( rLocale.Language, @@ -201,7 +201,7 @@ LanguageType MsLangId::convertLocaleToLanguageWithFallback( const ::com::sun::star::lang::Locale & rLocale ) { // empty language => LANGUAGE_SYSTEM - if (rLocale.Language.getLength() == 0) + if (rLocale.Language.isEmpty()) return lookupFallbackLanguage( LANGUAGE_SYSTEM); return lookupFallbackLanguage( rLocale); @@ -221,7 +221,7 @@ LanguageType MsLangId::convertLocaleToLanguageWithFallback( const ::com::sun::star::lang::Locale & rLocale ) { // empty language => LANGUAGE_SYSTEM - if (rLocale.Language.getLength() == 0) + if (rLocale.Language.isEmpty()) return convertLanguageToLocaleWithFallback( LANGUAGE_SYSTEM); return lookupFallbackLocale( rLocale); diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index 4d107ed..d30eec7 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -170,7 +170,7 @@ void print_OUString( const OUString& s ) bool is_empty_string( const OUString& s ) { - return (s.getLength()==0) || (s.getLength()==1 && s[0]=='\n'); + return (s.isEmpty()) || (s.getLength()==1 && s[0]=='\n'); } void print_indent( int depth ) @@ -384,7 +384,7 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const { const LocaleNode * sepNode = 0; ::rtl::OUString useLocale = getAttr().getValueByName("ref"); - if (useLocale.getLength() > 0) { + if (!useLocale.isEmpty()) { of.writeRefFunction("getLocaleItem_", useLocale); return; } @@ -424,14 +424,14 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const sepNode = findNode("LongDateMonthSeparator"); aLDS = sepNode->getValue(); of.writeParameter("LongDateMonthSeparator", aLDS); - if (aLDS.getLength() == 0) + if (aLDS.isEmpty()) fprintf( stderr, "Warning: %s\n", "LongDateMonthSeparator is empty. Usually this is not the case and may lead to concatenated display names like \"Wednesday, May9, 2007\"."); sepNode = findNode("LongDateYearSeparator"); aLDS = sepNode->getValue(); of.writeParameter("LongDateYearSeparator", aLDS); - if (aLDS.getLength() == 0) + if (aLDS.isEmpty()) fprintf( stderr, "Warning: %s\n", "LongDateYearSeparator is empty. Usually this is not the case and may lead to concatenated display names like \"Wednesday, 2007May 9\"."); @@ -613,7 +613,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const OUString strFrom( getAttr().getValueByName("replaceFrom")); of.writeParameter("replaceFrom", strFrom, mnSection); str = getAttr().getValueByName("replaceTo"); - if (strFrom.getLength() && !str.getLength()) + if (!strFrom.isEmpty() && str.isEmpty()) incErrorStr("replaceFrom=\"%s\" replaceTo=\"\" is empty replacement.", strFrom); // Locale data generator inserts FFFF for LangID, we need to adapt that. if (str.endsWithIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "-FFFF]"))) @@ -632,7 +632,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const } } ::rtl::OUString useLocale = getAttr().getValueByName("ref"); - if (useLocale.getLength() > 0) { + if (!useLocale.isEmpty()) { switch (mnSection) { case 0: @@ -720,7 +720,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const else { OUString aRef( pCtype->getAttr().getValueByName("ref")); - if (aRef.getLength() > 0) + if (!aRef.isEmpty()) { if (!bCtypeIsRef) fprintf( stderr, @@ -968,7 +968,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const void LCCollationNode::generateCode (const OFileWriter &of) const { ::rtl::OUString useLocale = getAttr().getValueByName("ref"); - if (useLocale.getLength() > 0) { + if (!useLocale.isEmpty()) { of.writeRefFunction("getCollatorImplementation_", useLocale); of.writeRefFunction("getCollationOptions_", useLocale); return; @@ -1041,7 +1041,7 @@ void LCCollationNode::generateCode (const OFileWriter &of) const void LCSearchNode::generateCode (const OFileWriter &of) const { ::rtl::OUString useLocale = getAttr().getValueByName("ref"); - if (useLocale.getLength() > 0) { + if (!useLocale.isEmpty()) { of.writeRefFunction("getSearchOptions_", useLocale); return; } @@ -1079,7 +1079,7 @@ void LCSearchNode::generateCode (const OFileWriter &of) const void LCIndexNode::generateCode (const OFileWriter &of) const { ::rtl::OUString useLocale = getAttr().getValueByName("ref"); - if (useLocale.getLength() > 0) { + if (!useLocale.isEmpty()) { of.writeRefFunction("getIndexAlgorithm_", useLocale); of.writeRefFunction("getUnicodeScripts_", useLocale); of.writeRefFunction("getFollowPageWords_", useLocale); @@ -1239,7 +1239,7 @@ static void lcl_writeAbbrFullNarrArrays( const OFileWriter & of, sal_Int16 nCoun void LCCalendarNode::generateCode (const OFileWriter &of) const { ::rtl::OUString useLocale = getAttr().getValueByName("ref"); - if (useLocale.getLength() > 0) { + if (!useLocale.isEmpty()) { of.writeRefFunction("getAllCalendars_", useLocale); return; } @@ -1271,14 +1271,14 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const const sal_Char *elementTag; LocaleNode * daysNode = NULL; ::rtl::OUString ref_name = calNode->getChildAt(nChild)->getAttr().getValueByName("ref"); - if (ref_name.getLength() > 0 && i > 0) { + if (!ref_name.isEmpty() && i > 0) { for (j = 0; j < i; j++) { str = getChildAt(j)->getAttr().getValueByName("unoid"); if (str.equals(ref_name)) daysNode = getChildAt(j)->getChildAt(0); } } - if (ref_name.getLength() > 0 && daysNode == NULL) { + if (!ref_name.isEmpty() && daysNode == NULL) { of.writeParameter("dayRef", OUString(RTL_CONSTASCII_USTRINGPARAM("ref")), i); of.writeParameter("dayRefName", ref_name, i); nbOfDays[i] = 0; @@ -1303,14 +1303,14 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const // Generate Months of Year LocaleNode * monthsNode = NULL; ref_name = calNode->getChildAt(nChild)->getAttr().getValueByName("ref"); - if (ref_name.getLength() > 0 && i > 0) { + if (!ref_name.isEmpty() && i > 0) { for (j = 0; j < i; j++) { str = getChildAt(j)->getAttr().getValueByName("unoid"); if (str.equals(ref_name)) monthsNode = getChildAt(j)->getChildAt(1); } } - if (ref_name.getLength() > 0 && monthsNode == NULL) { + if (!ref_name.isEmpty() && monthsNode == NULL) { of.writeParameter("monthRef", OUString(RTL_CONSTASCII_USTRINGPARAM("ref")), i); of.writeParameter("monthRefName", ref_name, i); nbOfMonths[i] = 0; @@ -1338,14 +1338,14 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const --nChild; LocaleNode * genitiveMonthsNode = NULL; ref_name = calNode->getChildAt(nChild)->getAttr().getValueByName("ref"); - if (ref_name.getLength() > 0 && i > 0) { + if (!ref_name.isEmpty() && i > 0) { for (j = 0; j < i; j++) { str = getChildAt(j)->getAttr().getValueByName("unoid"); if (str.equals(ref_name)) genitiveMonthsNode = getChildAt(j)->getChildAt(1); } } - if (ref_name.getLength() > 0 && genitiveMonthsNode == NULL) { + if (!ref_name.isEmpty() && genitiveMonthsNode == NULL) { of.writeParameter("genitiveMonthRef", OUString(RTL_CONSTASCII_USTRINGPARAM("ref")), i); of.writeParameter("genitiveMonthRefName", ref_name, i); nbOfGenitiveMonths[i] = 0; @@ -1374,14 +1374,14 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const --nChild; LocaleNode * partitiveMonthsNode = NULL; ref_name = calNode->getChildAt(nChild)->getAttr().getValueByName("ref"); - if (ref_name.getLength() > 0 && i > 0) { + if (!ref_name.isEmpty() && i > 0) { for (j = 0; j < i; j++) { str = getChildAt(j)->getAttr().getValueByName("unoid"); if (str.equals(ref_name)) partitiveMonthsNode = getChildAt(j)->getChildAt(1); } } - if (ref_name.getLength() > 0 && partitiveMonthsNode == NULL) { + if (!ref_name.isEmpty() && partitiveMonthsNode == NULL) { of.writeParameter("partitiveMonthRef", OUString(RTL_CONSTASCII_USTRINGPARAM("ref")), i); of.writeParameter("partitiveMonthRefName", ref_name, i); nbOfPartitiveMonths[i] = 0; @@ -1406,14 +1406,14 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const // Generate Era name LocaleNode * erasNode = NULL; ref_name = calNode -> getChildAt(nChild) ->getAttr().getValueByName("ref"); - if (ref_name.getLength() > 0 && i > 0) { + if (!ref_name.isEmpty() && i > 0) { for (j = 0; j < i; j++) { str = getChildAt(j)->getAttr().getValueByName("unoid"); if (str.equals(ref_name)) erasNode = getChildAt(j)->getChildAt(2); } } - if (ref_name.getLength() > 0 && erasNode == NULL) { + if (!ref_name.isEmpty() && erasNode == NULL) { of.writeParameter("eraRef", OUString(RTL_CONSTASCII_USTRINGPARAM("ref")), i); of.writeParameter("eraRefName", ref_name, i); nbOfEras[i] = 0; @@ -1554,7 +1554,7 @@ bool isIso4217( const OUString& rStr ) void LCCurrencyNode :: generateCode (const OFileWriter &of) const { ::rtl::OUString useLocale = getAttr().getValueByName("ref"); - if (useLocale.getLength() > 0) { + if (!useLocale.isEmpty()) { of.writeRefFunction("getAllCurrencies_", useLocale); return; } @@ -1655,7 +1655,7 @@ void LCCurrencyNode :: generateCode (const OFileWriter &of) const void LCTransliterationNode::generateCode (const OFileWriter &of) const { ::rtl::OUString useLocale = getAttr().getValueByName("ref"); - if (useLocale.getLength() > 0) { + if (!useLocale.isEmpty()) { of.writeRefFunction("getTransliterations_", useLocale); return; } @@ -1704,7 +1704,7 @@ static NameValuePair ReserveWord[] = { void LCMiscNode::generateCode (const OFileWriter &of) const { ::rtl::OUString useLocale = getAttr().getValueByName("ref"); - if (useLocale.getLength() > 0) { + if (!useLocale.isEmpty()) { of.writeRefFunction("getForbiddenCharacters_", useLocale); of.writeRefFunction("getBreakIteratorRules_", useLocale); of.writeRefFunction("getReservedWords_", useLocale); @@ -1730,7 +1730,7 @@ void LCMiscNode::generateCode (const OFileWriter &of) const "Warning: No %s in ReservedWords, using en_US default: \"%s\".\n", ReserveWord[i].name, ReserveWord[i].value); str = curNode ? curNode -> getValue() : OUString::createFromAscii(ReserveWord[i].value); - if (!str.getLength()) + if (str.isEmpty()) { ++nError; fprintf( stderr, "Error: No content for ReservedWords %s.\n", ReserveWord[i].name); @@ -1801,7 +1801,7 @@ void LCNumberingLevelNode::generateCode (const OFileWriter &of) const { of.writeAsciiString("// ---> ContinuousNumbering\n"); ::rtl::OUString useLocale = getAttr().getValueByName("ref"); - if (useLocale.getLength() > 0) { + if (!useLocale.isEmpty()) { of.writeRefFunction2("getContinuousNumberingLevels_", useLocale); return; } @@ -1871,7 +1871,7 @@ void LCOutlineNumberingLevelNode::generateCode (const OFileWriter &of) const { of.writeAsciiString("// ---> OutlineNumbering\n"); ::rtl::OUString useLocale = getAttr().getValueByName("ref"); - if (useLocale.getLength() > 0) { + if (!useLocale.isEmpty()) { of.writeRefFunction3("getOutlineNumberingLevels_", useLocale); return; } diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index a6a8578..2750297 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -417,7 +417,7 @@ oslGenericFunction SAL_CALL lcl_LookupTableHelper::getFunctionSymbolByName( Locale aFbLocale = MsLangId::getFallbackLocale( aLocale); if (aFbLocale == aLocale) bFallback = false; // may be a "language-only-locale" like Interlingua (ia) - else if (aFbLocale.Country.getLength()) { + else if (!aFbLocale.Country.isEmpty()) { OUStringBuffer aBuf(5); aFallback = aBuf.append(aFbLocale.Language).append( under).append(aFbLocale.Country).makeStringAndClear(); } diff --git a/i18npool/source/paper/paper.cxx b/i18npool/source/paper/paper.cxx index fd583fa..d9e2f47 100644 --- a/i18npool/source/paper/paper.cxx +++ b/i18npool/source/paper/paper.cxx @@ -250,7 +250,7 @@ PaperInfo PaperInfo::getSystemDefaultPaper() #ifdef UNX // if set to "use system", get papersize from system - if (aLocaleStr.getLength() == 0) + if (aLocaleStr.isEmpty()) { static bool bInitialized = false; static PaperInfo aInstance(PAPER_A4); @@ -365,7 +365,7 @@ PaperInfo PaperInfo::getSystemDefaultPaper() try { // if set to "use system", try to get locale from system - if (aLocaleStr.getLength() == 0 && xConfigProv.is()) + if (aLocaleStr.isEmpty() && xConfigProv.is()) { aArgs[ 0 ] <<= CREATE_OUSTRING( "org.openoffice.System/L10N/" ); xConfigNA.set( xConfigProv->createInstanceWithArguments( @@ -378,7 +378,7 @@ PaperInfo PaperInfo::getSystemDefaultPaper() { } - if (aLocaleStr.getLength() == 0) + if (aLocaleStr.isEmpty()) aLocaleStr = CREATE_OUSTRING("en-US"); // convert locale string to locale struct @@ -427,7 +427,7 @@ rtl::OString PaperInfo::toPSName(Paper ePaper) Paper PaperInfo::fromPSName(const rtl::OString &rName) { - if (!rName.getLength()) + if (rName.isEmpty()) return PAPER_USER; for ( size_t i = 0; i < nTabSize; ++i ) diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx index 7d8f8a2..3f0b529 100644 --- a/i18npool/source/search/textsearch.cxx +++ b/i18npool/source/search/textsearch.cxx @@ -642,7 +642,7 @@ SearchResult TextSearch::NSrchBkwrd( const OUString& searchStr, sal_Int32 startP OUString aStr( searchStr ); sal_Int32 nSuchIdx = aStr.getLength(); sal_Int32 nEnde = endPos; - if( nSuchIdx == 0 || sSearchKey.getLength() == 0 || sSearchKey.getLength() > nSuchIdx) + if( nSuchIdx == 0 || sSearchKey.isEmpty() || sSearchKey.getLength() > nSuchIdx) return aRet; if (bUsePrimarySrchStr) diff --git a/i18npool/source/transliteration/transliteration_Ignore.cxx b/i18npool/source/transliteration/transliteration_Ignore.cxx index 87af941..76f4943 100644 --- a/i18npool/source/transliteration/transliteration_Ignore.cxx +++ b/i18npool/source/transliteration/transliteration_Ignore.cxx @@ -74,7 +74,7 @@ transliteration_Ignore::equals(const OUString& str1, sal_Int32 pos1, sal_Int32 n Sequence< OUString > SAL_CALL transliteration_Ignore::transliterateRange( const OUString& str1, const OUString& str2 ) throw(RuntimeException) { - if (str1.getLength() < 1 || str2.getLength() < 1) + if (str1.isEmpty() || str2.isEmpty()) throw RuntimeException(); Sequence< OUString > r(2); @@ -104,7 +104,7 @@ Sequence< OUString > SAL_CALL transliteration_Ignore::transliterateRange( const OUString& str1, const OUString& str2, XTransliteration& t1, XTransliteration& t2 ) throw(RuntimeException) { - if (str1.getLength() < 1 || str2.getLength() < 1) + if (str1.isEmpty() || str2.isEmpty()) throw RuntimeException(); Sequence< sal_Int32 > offset; diff --git a/i18npool/source/transliteration/transliteration_body.cxx b/i18npool/source/transliteration/transliteration_body.cxx index 02f9ca1..0db0f338 100644 --- a/i18npool/source/transliteration/transliteration_body.cxx +++ b/i18npool/source/transliteration/transliteration_body.cxx @@ -280,19 +280,19 @@ static rtl::OUString transliterate_titlecase_Impl( const OUString aText( inStr.copy( startPos, nCount ) ); OUString aRes; - if (aText.getLength() > 0) + if (!aText.isEmpty()) { Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); CharacterClassificationImpl aCharClassImpl( xMSF ); - // because aCharClassImpl.toTitle does not handle ligatures or ß but will raise + // because aCharClassImpl.toTitle does not handle ligatures or � but will raise // an exception we need to handle the first chara manually... // we don't want to change surrogates by accident, thuse we use proper code point iteration sal_Int32 nPos = 0; sal_uInt32 cFirstChar = aText.iterateCodePoints( &nPos ); OUString aResolvedLigature( &cFirstChar, 1 ); //lcl_ResolveLigature( cFirstChar ) ); - // toUpper can be used to properly resolve ligatures and characters like ß + // toUpper can be used to properly resolve ligatures and characters like � aResolvedLigature = aCharClassImpl.toUpper( aResolvedLigature, 0, aResolvedLigature.getLength(), rLocale ); // since toTitle will leave all-uppercase text unchanged we first need to // use toLower to bring possible 2nd and following charas in lowercase diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx index d3882cf..2cddc15 100644 --- a/idl/source/prj/database.cxx +++ b/idl/source/prj/database.cxx @@ -575,7 +575,7 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm ) { // error set // search error token // error text - if( aError.GetText().getLength() ) + if( !aError.GetText().isEmpty() ) { aErrorText.append(RTL_CONSTASCII_STRINGPARAM("may be <")); aErrorText.append(aError.GetText()); @@ -617,7 +617,7 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm ) if( pTok && pTok->IsIdentifier() ) { rtl::OString aN = IDLAPP->pHashTable->GetNearString( pTok->GetString() ); - if( aN.getLength() ) + if( !aN.isEmpty() ) fprintf( stderr, "%s versus %s\n", pTok->GetString().GetBuffer(), aN.getStr() ); } } diff --git a/idl/source/prj/svidl.cxx b/idl/source/prj/svidl.cxx index f633c9a..c250f35 100644 --- a/idl/source/prj/svidl.cxx +++ b/idl/source/prj/svidl.cxx @@ -232,7 +232,7 @@ int cdecl main ( int argc, char ** argv) fprintf(stderr, "%s\n", aStr.getStr()); } } - if (nExit == 0 && aCommand.m_DepFile.getLength()) + if (nExit == 0 && !aCommand.m_DepFile.isEmpty()) { DirEntry aDE(aCommand.m_DepFile); aDE.ToAbs(); @@ -336,7 +336,7 @@ int cdecl main ( int argc, char ** argv) aErrFile2 = aTmpDocuFile; } } - if (!bErr && aCommand.m_DepFile.getLength()) + if (!bErr && !aCommand.m_DepFile.isEmpty()) { bErr |= !FileMove_Impl( aCommand.m_DepFile, aTmpDepFile, bDoMove ); if (bErr) { diff --git a/idlc/source/astdeclaration.cxx b/idlc/source/astdeclaration.cxx index 5e4dcdd..87eda04 100644 --- a/idlc/source/astdeclaration.cxx +++ b/idlc/source/astdeclaration.cxx @@ -41,7 +41,7 @@ static OString convertName(const OString& name) do { OString token( name.getToken( 0, ':', nIndex ) ); - if( token.getLength() ) + if( !token.isEmpty() ) { nameBuffer.append('/'); nameBuffer.append( token ); @@ -65,7 +65,7 @@ AstDeclaration::AstDeclaration(NodeType type, const OString& name, AstScope* pSc if (pDecl) { m_scopedName = pDecl->getScopedName(); - if (m_scopedName.getLength() > 0) + if (!m_scopedName.isEmpty()) m_scopedName += sGlobal; m_scopedName += m_localName; } diff --git a/idlc/source/astdump.cxx b/idlc/source/astdump.cxx index 5f1c738..a1c2154 100644 --- a/idlc/source/astdump.cxx +++ b/idlc/source/astdump.cxx @@ -189,7 +189,7 @@ sal_Bool AstService::dump(RegistryKey& rKey) case NT_interface: case NT_typedef: version = TYPEREG_VERSION_1; - OSL_ASSERT(superName.getLength() == 0); + OSL_ASSERT(superName.isEmpty()); superName = (*i)->getRelativName(); break; @@ -205,7 +205,7 @@ sal_Bool AstService::dump(RegistryKey& rKey) case NT_service_member: if (getNodeType() == NT_singleton) { - OSL_ASSERT(superName.getLength() == 0); + OSL_ASSERT(superName.isEmpty()); superName = ((AstServiceMember *)(*i))-> getRealService()->getRelativName(); break; @@ -243,9 +243,9 @@ sal_Bool AstService::dump(RegistryKey& rKey) getNodeType() == NT_singleton ? RT_TYPE_SINGLETON : RT_TYPE_SERVICE, m_bPublished, rtl::OStringToOUString(getRelativName(), RTL_TEXTENCODING_UTF8), - superName.getLength() == 0 ? 0 : 1, properties, constructors, + superName.isEmpty() ? 0 : 1, properties, constructors, references); - if (superName.getLength() != 0) { + if (!superName.isEmpty()) { writer.setSuperTypeName( 0, rtl::OStringToOUString(superName, RTL_TEXTENCODING_UTF8)); } diff --git a/idlc/source/astscope.cxx b/idlc/source/astscope.cxx index 49bd39a..e89b2d5 100644 --- a/idlc/source/astscope.cxx +++ b/idlc/source/astscope.cxx @@ -36,7 +36,7 @@ using namespace ::rtl; sal_Bool isGlobal(const OString& scopedName) { - if ((scopedName.getLength() == 0) || (scopedName.indexOf(':') == 0)) + if ((scopedName.isEmpty()) || (scopedName.indexOf(':') == 0)) { return sal_True; } @@ -124,7 +124,7 @@ AstDeclaration* AstScope::lookupByName(const OString& scopedName) { AstDeclaration* pDecl = NULL; AstScope* pScope = NULL; - if (scopedName.getLength() == 0) + if (scopedName.isEmpty()) return NULL; // If name starts with "::" start look up in global scope diff --git a/idlc/source/errorhandler.cxx b/idlc/source/errorhandler.cxx index 4f5dcfc..a5ee0eb 100644 --- a/idlc/source/errorhandler.cxx +++ b/idlc/source/errorhandler.cxx @@ -481,7 +481,7 @@ static OString flagToString(sal_uInt32 flag) flagStr += "'attribute'"; if ( (flag & AF_PROPERTY) == AF_PROPERTY ) flagStr += "'property'"; - if ( !flagStr.getLength() ) + if ( flagStr.isEmpty() ) flagStr += "'unknown'"; return flagStr; diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx index b8ceb33..72806d9 100644 --- a/idlc/source/idlccompile.cxx +++ b/idlc/source/idlccompile.cxx @@ -145,7 +145,7 @@ OString makeTempName(const OString& prefix) } } - if ( uTmpPath.getLength() ) + if ( !uTmpPath.isEmpty() ) tmpPath = OUStringToOString(uTmpPath, RTL_TEXTENCODING_UTF8); #if defined(SAL_W32) || defined(SAL_UNX) @@ -262,7 +262,7 @@ sal_Int32 compileFile(const OString * pathname) { filePath = fileName.copy(0, index); - if ( filePath.getLength() ) + if ( !filePath.isEmpty() ) { cppArgs.append(" -I\""); cppArgs.append(filePath); diff --git a/io/source/acceptor/acceptor.cxx b/io/source/acceptor/acceptor.cxx index f703d2d..d54eaac 100644 --- a/io/source/acceptor/acceptor.cxx +++ b/io/source/acceptor/acceptor.cxx @@ -145,7 +145,7 @@ namespace io_acceptor struct BeingInAccept guard( &m_bInAccept, sConnectionDescription ); Reference< XConnection > r; - if( m_sLastDescription.getLength() && + if( !m_sLastDescription.isEmpty() && m_sLastDescription != sConnectionDescription ) { // instantiate another acceptor for different ports @@ -154,7 +154,7 @@ namespace io_acceptor throw ConnectionSetupException( sMessage, Reference< XInterface > () ); } - if( ! m_sLastDescription.getLength() ) + if( m_sLastDescription.isEmpty() ) { // setup the acceptor try diff --git a/javaunohelper/source/javaunohelper.cxx b/javaunohelper/source/javaunohelper.cxx index 018c83e..5178c76 100644 --- a/javaunohelper/source/javaunohelper.cxx +++ b/javaunohelper/source/javaunohelper.cxx @@ -265,7 +265,7 @@ Java_com_sun_star_comp_helper_RegistryServiceFactory_createRegistryServiceFactor // bootstrap Reference< lang::XMultiServiceFactory > rMSFac; - if (aReadRegFile.getLength() == 0) + if (aReadRegFile.isEmpty()) rMSFac = ::cppu::createRegistryServiceFactory( aWriteRegFile, bReadOnly); else rMSFac = ::cppu::createRegistryServiceFactory(aWriteRegFile, aReadRegFile, bReadOnly); diff --git a/jvmaccess/source/classpath.cxx b/jvmaccess/source/classpath.cxx index b1a26df..c99290b 100644 --- a/jvmaccess/source/classpath.cxx +++ b/jvmaccess/source/classpath.cxx @@ -74,7 +74,7 @@ void * ::jvmaccess::ClassPath::doTranslateToUrls( ::std::vector< jobject > urls; for (::sal_Int32 i = 0; i != -1;) { ::rtl::OUString url(classPath.getToken(0, ' ', i)); - if (url.getLength() != 0) { + if (!url.isEmpty()) { css::uno::Reference< css::uri::XVndSunStarExpandUrlReference > expUrl( css::uri::UriReferenceFactory::create(context)->parse(url), -- 1.7.5.4
_______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice