diff --git a/i18npool/inc/collator_unicode.hxx b/i18npool/inc/collator_unicode.hxx
index 69d317797870..d943bc9bc2c1 100644
a
|
b
|
public:
|
63 | 63 | |
64 | 64 | private: |
65 | 65 | const sal_Char *implementationName; |
66 | | RuleBasedCollator *uca_base, *collator; |
| 66 | icu::RuleBasedCollator *uca_base, *collator; |
67 | 67 | #ifndef DISABLE_DYNLOADING |
68 | 68 | oslModule hModule; |
69 | 69 | #endif |
diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx
index a81a80e153ba..02da856a5b99 100644
a
|
b
|
BreakIterator_Unicode::~BreakIterator_Unicode()
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /* |
59 | | Wrapper class to provide public access to the RuleBasedBreakIterator's |
| 59 | Wrapper class to provide public access to the icu::RuleBasedBreakIterator's |
60 | 60 | setbreakType method. |
61 | 61 | */ |
62 | | class OOoRuleBasedBreakIterator : public RuleBasedBreakIterator |
| 62 | class OOoRuleBasedBreakIterator : public icu::RuleBasedBreakIterator |
63 | 63 | { |
64 | 64 | public: |
65 | 65 | #if (U_ICU_VERSION_MAJOR_NUM < 58) |
66 | | // RuleBasedBreakIterator::setBreakType() is private as of ICU 58. |
| 66 | // icu::RuleBasedBreakIterator::setBreakType() is private as of ICU 58. |
67 | 67 | void publicSetBreakType(int32_t type) |
68 | 68 | { |
69 | 69 | setBreakType(type); |
… |
… |
class OOoRuleBasedBreakIterator : public RuleBasedBreakIterator
|
71 | 71 | #endif |
72 | 72 | OOoRuleBasedBreakIterator(UDataMemory* image, |
73 | 73 | UErrorCode &status) |
74 | | : RuleBasedBreakIterator(image, status) |
| 74 | : icu::RuleBasedBreakIterator(image, status) |
75 | 75 | { }; |
76 | 76 | |
77 | 77 | }; |
… |
… |
sal_Int32 SAL_CALL BreakIterator_Unicode::nextCharacters( const OUString& Text,
|
334 | 334 | icu::BreakIterator* pBI = character.mpValue->mpBreakIterator.get(); |
335 | 335 | for (nDone = 0; nDone < nCount; nDone++) { |
336 | 336 | nStartPos = pBI->following(nStartPos); |
337 | | if (nStartPos == BreakIterator::DONE) |
| 337 | if (nStartPos == icu::BreakIterator::DONE) |
338 | 338 | return Text.getLength(); |
339 | 339 | } |
340 | 340 | } else { // for CHARACTER mode |
… |
… |
sal_Int32 SAL_CALL BreakIterator_Unicode::previousCharacters( const OUString& Te
|
353 | 353 | icu::BreakIterator* pBI = character.mpValue->mpBreakIterator.get(); |
354 | 354 | for (nDone = 0; nDone < nCount; nDone++) { |
355 | 355 | nStartPos = pBI->preceding(nStartPos); |
356 | | if (nStartPos == BreakIterator::DONE) |
| 356 | if (nStartPos == icu::BreakIterator::DONE) |
357 | 357 | return 0; |
358 | 358 | } |
359 | 359 | } else { // for BS to delete one char and CHARACTER mode. |
… |
… |
Boundary SAL_CALL BreakIterator_Unicode::nextWord( const OUString& Text, sal_Int
|
371 | 371 | |
372 | 372 | Boundary rv; |
373 | 373 | rv.startPos = icuBI->mpValue->mpBreakIterator->following(nStartPos); |
374 | | if( rv.startPos >= Text.getLength() || rv.startPos == BreakIterator::DONE ) |
| 374 | if( rv.startPos >= Text.getLength() || rv.startPos == icu::BreakIterator::DONE ) |
375 | 375 | rv.endPos = result.startPos; |
376 | 376 | else { |
377 | 377 | if ( (rWordType == WordType::ANYWORD_IGNOREWHITESPACES || |
… |
… |
Boundary SAL_CALL BreakIterator_Unicode::nextWord( const OUString& Text, sal_Int
|
380 | 380 | rv.startPos = icuBI->mpValue->mpBreakIterator->following(rv.startPos); |
381 | 381 | |
382 | 382 | rv.endPos = icuBI->mpValue->mpBreakIterator->following(rv.startPos); |
383 | | if(rv.endPos == BreakIterator::DONE) |
| 383 | if(rv.endPos == icu::BreakIterator::DONE) |
384 | 384 | rv.endPos = rv.startPos; |
385 | 385 | } |
386 | 386 | return rv; |
… |
… |
Boundary SAL_CALL BreakIterator_Unicode::previousWord(const OUString& Text, sal_
|
394 | 394 | |
395 | 395 | Boundary rv; |
396 | 396 | rv.startPos = icuBI->mpValue->mpBreakIterator->preceding(nStartPos); |
397 | | if( rv.startPos < 0 || rv.startPos == BreakIterator::DONE) |
| 397 | if( rv.startPos < 0 || rv.startPos == icu::BreakIterator::DONE) |
398 | 398 | rv.endPos = rv.startPos; |
399 | 399 | else { |
400 | 400 | if ( (rWordType == WordType::ANYWORD_IGNOREWHITESPACES || |
… |
… |
Boundary SAL_CALL BreakIterator_Unicode::previousWord(const OUString& Text, sal_
|
403 | 403 | rv.startPos = icuBI->mpValue->mpBreakIterator->preceding(rv.startPos); |
404 | 404 | |
405 | 405 | rv.endPos = icuBI->mpValue->mpBreakIterator->following(rv.startPos); |
406 | | if(rv.endPos == BreakIterator::DONE) |
| 406 | if(rv.endPos == icu::BreakIterator::DONE) |
407 | 407 | rv.endPos = rv.startPos; |
408 | 408 | } |
409 | 409 | return rv; |
… |
… |
Boundary SAL_CALL BreakIterator_Unicode::getWordBoundary( const OUString& Text,
|
435 | 435 | rv.endPos = icuBI->mpValue->mpBreakIterator->following(nPos); |
436 | 436 | } |
437 | 437 | } |
438 | | if (rv.startPos == BreakIterator::DONE) |
| 438 | if (rv.startPos == icu::BreakIterator::DONE) |
439 | 439 | rv.startPos = rv.endPos; |
440 | | else if (rv.endPos == BreakIterator::DONE) |
| 440 | else if (rv.endPos == icu::BreakIterator::DONE) |
441 | 441 | rv.endPos = rv.startPos; |
442 | 442 | |
443 | 443 | return rv; |
… |
… |
LineBreakResults SAL_CALL BreakIterator_Unicode::getLineBreak(
|
502 | 502 | lbr.breakIndex = nStartPos; |
503 | 503 | lbr.breakType = BreakType::WORDBOUNDARY; |
504 | 504 | } else if (hOptions.rHyphenator.is()) { //Hyphenation break |
505 | | sal_Int32 boundary_with_punctuation = (pLineBI->next() != BreakIterator::DONE) ? pLineBI->current() : 0; |
| 505 | sal_Int32 boundary_with_punctuation = (pLineBI->next() != icu::BreakIterator::DONE) ? pLineBI->current() : 0; |
506 | 506 | pLineBI->preceding(nStartPos + 1); // reset to check correct hyphenation of "word-word" |
507 | 507 | |
508 | 508 | sal_Int32 nStartPosWordEnd = nStartPos; |
diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx
index 71bc4ed84d1e..37dc7eec6ea6 100644
a
|
b
|
Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
|
138 | 138 | UErrorCode status = U_ZERO_ERROR; |
139 | 139 | OUString rule = LocaleDataImpl::get()->getCollatorRuleByAlgorithm(rLocale, rAlgorithm); |
140 | 140 | if (!rule.isEmpty()) { |
141 | | collator = new RuleBasedCollator(reinterpret_cast<const UChar *>(rule.getStr()), status); |
| 141 | collator = new icu::RuleBasedCollator(reinterpret_cast<const UChar *>(rule.getStr()), status); |
142 | 142 | if (! U_SUCCESS(status)) throw RuntimeException(); |
143 | 143 | } |
144 | 144 | if (!collator && OUString(LOCAL_RULE_LANGS).indexOf(rLocale.Language) >= 0) { |
… |
… |
Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
|
343 | 343 | size_t ruleImageSize = funclen(); |
344 | 344 | |
345 | 345 | #if (U_ICU_VERSION_MAJOR_NUM == 4) && (U_ICU_VERSION_MINOR_NUM <= 2) |
346 | | uca_base = new RuleBasedCollator(static_cast<UChar*>(NULL), status); |
| 346 | uca_base = new icu::RuleBasedCollator(static_cast<UChar*>(NULL), status); |
347 | 347 | #else |
348 | 348 | // Not only changed ICU 53.1 the API behavior that a negative |
349 | 349 | // length (ruleImageSize) now leads to failure, but also that |
… |
… |
Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
|
354 | 354 | // The default collator of the en-US locale would also fulfill |
355 | 355 | // the requirement. The collator of the actual locale or the |
356 | 356 | // NULL (default) locale does not. |
357 | | uca_base = static_cast<RuleBasedCollator*>(icu::Collator::createInstance( |
| 357 | uca_base = static_cast<icu::RuleBasedCollator*>(icu::Collator::createInstance( |
358 | 358 | icu::Locale::getRoot(), status)); |
359 | 359 | #endif |
360 | 360 | if (! U_SUCCESS(status)) throw RuntimeException(); |
361 | | collator = new RuleBasedCollator( |
| 361 | collator = new icu::RuleBasedCollator( |
362 | 362 | reinterpret_cast<const uint8_t*>(ruleImage), ruleImageSize, uca_base, status); |
363 | 363 | if (! U_SUCCESS(status)) throw RuntimeException(); |
364 | 364 | } |
… |
… |
Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
|
372 | 372 | */ |
373 | 373 | icu::Locale icuLocale( LanguageTagIcu::getIcuLocale( LanguageTag( rLocale), rAlgorithm)); |
374 | 374 | // load ICU collator |
375 | | collator = static_cast<RuleBasedCollator*>( icu::Collator::createInstance(icuLocale, status) ); |
| 375 | collator = static_cast<icu::RuleBasedCollator*>( icu::Collator::createInstance(icuLocale, status) ); |
376 | 376 | if (! U_SUCCESS(status)) throw RuntimeException(); |
377 | 377 | } |
378 | 378 | } |
379 | 379 | |
380 | 380 | if (options & CollatorOptions::CollatorOptions_IGNORE_CASE_ACCENT) |
381 | | collator->setStrength(Collator::PRIMARY); |
| 381 | collator->setStrength(icu::Collator::PRIMARY); |
382 | 382 | else if (options & CollatorOptions::CollatorOptions_IGNORE_CASE) |
383 | | collator->setStrength(Collator::SECONDARY); |
| 383 | collator->setStrength(icu::Collator::SECONDARY); |
384 | 384 | else |
385 | | collator->setStrength(Collator::TERTIARY); |
| 385 | collator->setStrength(icu::Collator::TERTIARY); |
386 | 386 | |
387 | 387 | return 0; |
388 | 388 | } |
diff --git a/i18npool/source/collator/gencoll_rule.cxx b/i18npool/source/collator/gencoll_rule.cxx
index 7d795b5af079..3048d12bb90b 100644
a
|
b
|
SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
|
113 | 113 | //UCollator *coll = ucol_openRules(Obuf.getStr(), Obuf.getLength(), UCOL_OFF, |
114 | 114 | // UCOL_DEFAULT_STRENGTH, &parseError, &status); |
115 | 115 | |
116 | | auto coll = o3tl::make_unique<RuleBasedCollator>(reinterpret_cast<const UChar *>(Obuf.getStr()), status); |
| 116 | auto coll = o3tl::make_unique<icu::RuleBasedCollator>(reinterpret_cast<const UChar *>(Obuf.getStr()), status); |
117 | 117 | |
118 | 118 | if (U_SUCCESS(status)) { |
119 | 119 | std::vector<uint8_t> data; |
diff --git a/i18npool/source/ordinalsuffix/ordinalsuffix.cxx b/i18npool/source/ordinalsuffix/ordinalsuffix.cxx
index 1a63dcb2e6fd..b9efd51e1176 100644
a
|
b
|
uno::Sequence< OUString > SAL_CALL OrdinalSuffixService::getOrdinalSuffix( sal_I
|
79 | 79 | if (!U_SUCCESS(nCode)) |
80 | 80 | return retValue; |
81 | 81 | |
82 | | std::unique_ptr<NumberFormat> xNumberFormat(icu::NumberFormat::createInstance(aIcuLocale, nCode)); |
| 82 | std::unique_ptr<icu::NumberFormat> xNumberFormat(icu::NumberFormat::createInstance(aIcuLocale, nCode)); |
83 | 83 | if (!U_SUCCESS(nCode)) |
84 | 84 | return retValue; |
85 | 85 | |
diff --git a/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx b/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx
index 0ddfe645abaa..2b5ca1ed1bdb 100644
a
|
b
|
ignoreDiacritics_CTL::transliterateChar2Char(sal_Unicode nInChar)
|
35 | 35 | if (!m_transliterator) |
36 | 36 | throw css::uno::RuntimeException(); |
37 | 37 | |
38 | | UnicodeString aChar(nInChar); |
| 38 | icu::UnicodeString aChar(nInChar); |
39 | 39 | m_transliterator->transliterate(aChar); |
40 | 40 | |
41 | 41 | if (aChar.isEmpty()) |
… |
… |
ignoreDiacritics_CTL::folding(const OUString& rInStr, sal_Int32 nStartPos,
|
68 | 68 | { |
69 | 69 | sal_Int32 nIndex = nPosition; |
70 | 70 | UChar32 nChar = rInStr.iterateCodePoints(&nIndex); |
71 | | UnicodeString aUStr(nChar); |
| 71 | icu::UnicodeString aUStr(nChar); |
72 | 72 | m_transliterator->transliterate(aUStr); |
73 | 73 | |
74 | 74 | if (nOffset + aUStr.length() > rOffset.getLength()) |
… |
… |
ignoreDiacritics_CTL::folding(const OUString& rInStr, sal_Int32 nStartPos,
|
87 | 87 | } |
88 | 88 | else |
89 | 89 | { |
90 | | UnicodeString aUStr(reinterpret_cast<const UChar*>(rInStr.getStr()) + nStartPos, nCount); |
| 90 | icu::UnicodeString aUStr(reinterpret_cast<const UChar*>(rInStr.getStr()) + nStartPos, nCount); |
91 | 91 | m_transliterator->transliterate(aUStr); |
92 | 92 | return OUString(reinterpret_cast<const sal_Unicode*>(aUStr.getBuffer()), aUStr.length()); |
93 | 93 | } |
diff --git a/i18nutil/source/utility/unicode.cxx b/i18nutil/source/utility/unicode.cxx
index 96c0194a9149..f225b3adc55d 100644
a
|
b
|
OUString unicode::formatPercent(double dNumber,
|
750 | 750 | |
751 | 751 | icu::Locale aLocale = LanguageTagIcu::getIcuLocale(aLangTag); |
752 | 752 | |
753 | | std::unique_ptr<NumberFormat> xF( |
754 | | NumberFormat::createPercentInstance(aLocale, errorCode)); |
| 753 | std::unique_ptr<icu::NumberFormat> xF( |
| 754 | icu::NumberFormat::createPercentInstance(aLocale, errorCode)); |
755 | 755 | if(U_FAILURE(errorCode)) |
756 | 756 | { |
757 | | SAL_WARN("i18n", "NumberFormat::createPercentInstance failed"); |
| 757 | SAL_WARN("i18n", "icu::NumberFormat::createPercentInstance failed"); |
758 | 758 | return OUString::number(dNumber) + "%"; |
759 | 759 | } |
760 | 760 | |
761 | | UnicodeString output; |
| 761 | icu::UnicodeString output; |
762 | 762 | xF->format(dNumber/100, output); |
763 | 763 | OUString aRet(reinterpret_cast<const sal_Unicode *>(output.getBuffer()), |
764 | 764 | output.length()); |
diff --git a/lotuswordpro/source/filter/localtime.cxx b/lotuswordpro/source/filter/localtime.cxx
index 47d202412724..3805c5d6f973 100644
a
|
b
|
bool LtgLocalTime(long rtime,LtTm& rtm)
|
174 | 174 | |
175 | 175 | if ((rtime > 3 * DAY_SEC)&&(rtime < LONG_MAX - 3 * DAY_SEC)) |
176 | 176 | { |
177 | | TimeZone* pLocalZone = TimeZone::createDefault(); |
| 177 | icu::TimeZone* pLocalZone = icu::TimeZone::createDefault(); |
178 | 178 | long offset = (pLocalZone->getRawOffset())/1000; |
179 | 179 | delete pLocalZone; |
180 | 180 | long ltime = rtime + offset; |
diff --git a/opencl/source/openclconfig.cxx b/opencl/source/openclconfig.cxx
index b81ffed22937..0ec2347fb332 100644
a
|
b
|
bool match(const OUString& rPattern, const OUString& rInput)
|
119 | 119 | UErrorCode nIcuError(U_ZERO_ERROR); |
120 | 120 | icu::UnicodeString sIcuPattern(reinterpret_cast<const UChar*>(rPattern.getStr()), rPattern.getLength()); |
121 | 121 | icu::UnicodeString sIcuInput(reinterpret_cast<const UChar*>(rInput.getStr()), rInput.getLength()); |
122 | | RegexMatcher aMatcher(sIcuPattern, sIcuInput, 0, nIcuError); |
| 122 | icu::RegexMatcher aMatcher(sIcuPattern, sIcuInput, 0, nIcuError); |
123 | 123 | |
124 | 124 | return U_SUCCESS(nIcuError) && aMatcher.matches(nIcuError) && U_SUCCESS(nIcuError); |
125 | 125 | } |