diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-05-01 15:08:29 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-05-01 16:27:17 +0100 |
commit | 268ec2e64f89eb39fd5f02688787cd6f53e948b5 (patch) | |
tree | 1b949370f0632b4a816b5cafcf5d8f420189c7d6 /i18npool/source | |
parent | 44d470c71740a6679b154eeec6af7bf352748c16 (diff) |
Related: fdo#49208 crazy to create the string *twice*
Change-Id: Ib31919672d0754fa4f650dcb32dc2c59a410b54c
Diffstat (limited to 'i18npool/source')
-rw-r--r-- | i18npool/source/breakiterator/breakiterator_unicode.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx index 0d6df0f5401b..08a5e6c7feb6 100644 --- a/i18npool/source/breakiterator/breakiterator_unicode.cxx +++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx @@ -199,13 +199,15 @@ void SAL_CALL BreakIterator_Unicode::loadICUBreakIterator(const com::sun::star:: } } - if (newBreak || icuBI->aICUText.compare(UnicodeString(reinterpret_cast<const UChar *>(rText.getStr()), rText.getLength()))) { // UChar != sal_Unicode in MinGW - icuBI->aICUText=UnicodeString(reinterpret_cast<const UChar *>(rText.getStr()), rText.getLength()); + // UChar != sal_Unicode in MinGW + const UChar *pText = reinterpret_cast<const UChar *>(rText.getStr()); + if (newBreak || icuBI->aICUText.compare(pText, rText.getLength())) + { + icuBI->aICUText=UnicodeString(pText, rText.getLength()); icuBI->aBreakIterator->setText(icuBI->aICUText); } } - sal_Int32 SAL_CALL BreakIterator_Unicode::nextCharacters( const OUString& Text, sal_Int32 nStartPos, const lang::Locale &rLocale, sal_Int16 nCharacterIteratorMode, sal_Int32 nCount, sal_Int32& nDone ) |