diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-08-14 15:27:36 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-08-14 15:27:36 +0000 |
commit | 8ead581613efb4ecd6121a195e04c4f5a7bc8bf1 (patch) | |
tree | 057138b4a348ac6fec10ccd2484f2158cf10004d /i18npool | |
parent | 80a8c174fa995248ec652b8c7af33971c15ecbbf (diff) |
INTEGRATION: CWS i18n44 (1.27.6); FILE MERGED
2008/07/24 16:12:44 khong 1.27.6.2: #i85411# Apply patch for ZWSP
2008/07/23 23:07:44 khong 1.27.6.1: #i85411# Apply patch for ZWSP
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/breakiterator/breakiteratorImpl.cxx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx index 956d77b7f4f6..122d8835df70 100644 --- a/i18npool/source/breakiterator/breakiteratorImpl.cxx +++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: breakiteratorImpl.cxx,v $ - * $Revision: 1.27 $ + * $Revision: 1.28 $ * * This file is part of OpenOffice.org. * @@ -77,6 +77,8 @@ sal_Int32 SAL_CALL BreakIteratorImpl::previousCharacters( const OUString& Text, return LBI->previousCharacters( Text, nStartPos, rLocale, nCharacterIteratorMode, nCount, nDone); } +#define isZWSP(c) (ch == 0x200B) + static sal_Int32 skipSpace(const OUString& Text, sal_Int32 nPos, sal_Int32 len, sal_Int16 rWordType, sal_Bool bDirection) { sal_uInt32 ch=0; @@ -84,23 +86,23 @@ static sal_Int32 skipSpace(const OUString& Text, sal_Int32 nPos, sal_Int32 len, switch (rWordType) { case WordType::ANYWORD_IGNOREWHITESPACES: if (bDirection) - while (nPos < len && u_isWhitespace(Text.iterateCodePoints(&pos, 1))) nPos=pos; + while (nPos < len && (u_isWhitespace(ch = Text.iterateCodePoints(&pos, 1)) || isZWSP(ch))) nPos=pos; else - while (nPos > 0 && u_isWhitespace(Text.iterateCodePoints(&pos, -1))) nPos=pos; + while (nPos > 0 && (u_isWhitespace(ch = Text.iterateCodePoints(&pos, -1)) || isZWSP(ch))) nPos=pos; break; case WordType::DICTIONARY_WORD: if (bDirection) - while (nPos < len && (u_isWhitespace(ch = Text.iterateCodePoints(&pos, 1)) || + while (nPos < len && (u_isWhitespace(ch = Text.iterateCodePoints(&pos, 1)) || isZWSP(ch) || ! (ch == 0x002E || u_isalnum(ch)))) nPos=pos; else - while (nPos > 0 && (u_isWhitespace(ch = Text.iterateCodePoints(&pos, -1)) || + while (nPos > 0 && (u_isWhitespace(ch = Text.iterateCodePoints(&pos, -1)) || isZWSP(ch) || ! (ch == 0x002E || u_isalnum(ch)))) nPos=pos; break; case WordType::WORD_COUNT: if (bDirection) - while (nPos < len && u_isUWhiteSpace(Text.iterateCodePoints(&pos, 1))) nPos=pos; + while (nPos < len && (u_isUWhiteSpace(ch = Text.iterateCodePoints(&pos, 1)) || isZWSP(ch))) nPos=pos; else - while (nPos > 0 && u_isUWhiteSpace(Text.iterateCodePoints(&pos, -1))) nPos=pos; + while (nPos > 0 && (u_isUWhiteSpace(ch = Text.iterateCodePoints(&pos, -1))) || isZWSP(ch)) nPos=pos; break; } return nPos; |