diff options
author | Olivier Hallot <olivier.hallot@alta.org.br> | 2011-12-26 17:19:24 -0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-12-30 11:52:45 +0100 |
commit | a17fb882569046cd9f6940cf2e87435200bb666b (patch) | |
tree | 36c9a0bff1d5dd5490c03f36553f5ae7b0f4bdf1 /i18npool/source | |
parent | 6cfae09e5dafa477db210272949e253d4fb24349 (diff) |
Fix for fdo43460 Part XXI getLength() to isEmpty()
Part XXI
Modules
i18npool, idl, idlc, io, javaunohelper, jvmaccess
Diffstat (limited to 'i18npool/source')
17 files changed, 60 insertions, 60 deletions
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx index f7690c1a865a..1d26968190a8 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 78ba7a654420..5f35795916e1 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 6eebd6fe7541..0488d59743de 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 6c4cb5f953f0..27a673d9b07c 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 cb53771e5768..3d87914ec8f3 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 d25830feb673..1c88b9b8997e 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 01dcb621986e..cd441686bdc4 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 de24b96c56a4..7b054e33d4ed 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 92af92b701d0..1d44ba958fe3 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 68a654bed9ee..f9f7b4946517 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 e5661dab2d9d..59a37ed4f1ad 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 4d107ed894e0..a7b653c0bc9f 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 a6a8578fb369..2750297d2bc7 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 fd583fa32fe1..d9e2f47ef618 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 7d8f8a2ac61d..3f0b529a74fb 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 87af9419233f..76f4943af73a 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 02f9ca14bc59..5b1ddc168b0a 100644 --- a/i18npool/source/transliteration/transliteration_body.cxx +++ b/i18npool/source/transliteration/transliteration_body.cxx @@ -280,7 +280,7 @@ 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 ); |