summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2007-09-05 16:37:28 +0000
committerKurt Zenker <kz@openoffice.org>2007-09-05 16:37:28 +0000
commit1967d8fb182b3101dee4f715e78be384400bc1e8 (patch)
treeae86bdd99fb0eb26c5a11366edec3af7d6595e1c
parent81265bb3758e4abbde64bf9ce6c70a716e0f4a18 (diff)
INTEGRATION: CWS i18n37 (1.22.6); FILE MERGED
2007/09/03 18:27:39 khong 1.22.6.2: i8132 fixed a problem in skiping space for word breakiterator 2007/08/31 21:30:30 khong 1.22.6.1: i81158 fix skipping space problem
-rw-r--r--i18npool/source/breakiterator/breakiteratorImpl.cxx25
1 files changed, 11 insertions, 14 deletions
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index 155b7ecdd8e8..295216c2813c 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: breakiteratorImpl.cxx,v $
*
- * $Revision: 1.23 $
+ * $Revision: 1.24 $
*
- * last change: $Author: vg $ $Date: 2007-08-28 12:46:34 $
+ * last change: $Author: kz $ $Date: 2007-09-05 17:37:28 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -84,33 +84,30 @@ sal_Int32 SAL_CALL BreakIteratorImpl::previousCharacters( const OUString& Text,
static sal_Int32 skipSpace(const OUString& Text, sal_Int32 nPos, sal_Int32 len, sal_Int16 rWordType, sal_Bool bDirection)
{
- if (bDirection ? nPos >= len : nPos <= 0) {
- return nPos;
- }
sal_uInt32 ch=0;
+ sal_Int32 pos=nPos;
switch (rWordType) {
case WordType::ANYWORD_IGNOREWHITESPACES:
if (bDirection)
- while (nPos < len && u_isWhitespace(Text.iterateCodePoints(&nPos, 1)));
+ while (nPos < len && u_isWhitespace(Text.iterateCodePoints(&pos, 1))) nPos=pos;
else
- while (nPos > 0 && u_isWhitespace(Text.iterateCodePoints(&nPos, -1)));
+ while (nPos > 0 && u_isWhitespace(Text.iterateCodePoints(&pos, -1))) nPos=pos;
break;
case WordType::DICTIONARY_WORD:
if (bDirection)
- while (nPos < len && (u_isWhitespace(ch = Text.iterateCodePoints(&nPos, 1)) ||
- ! (ch == 0x002E || u_isalnum(ch))));
+ while (nPos < len && (u_isWhitespace(ch = Text.iterateCodePoints(&pos, 1)) ||
+ ! (ch == 0x002E || u_isalnum(ch)))) nPos=pos;
else
- while (nPos > 0 && (u_isWhitespace(ch = Text.iterateCodePoints(&nPos, -1)) ||
- ! (ch == 0x002E || u_isalnum(ch))));
+ while (nPos > 0 && (u_isWhitespace(ch = Text.iterateCodePoints(&pos, -1)) ||
+ ! (ch == 0x002E || u_isalnum(ch)))) nPos=pos;
break;
case WordType::WORD_COUNT:
if (bDirection)
- while (nPos < len && (u_isWhitespace(ch = Text.iterateCodePoints(&nPos, 1)) || ! u_isalnum(ch)));
+ while (nPos < len && (u_isWhitespace(ch = Text.iterateCodePoints(&pos, 1)) || ! u_isalnum(ch))) nPos=pos;
else
- while (nPos > 0 && (u_isWhitespace(ch = Text.iterateCodePoints(&nPos, -1)) || ! u_isalnum(ch)));
+ while (nPos > 0 && (u_isWhitespace(ch = Text.iterateCodePoints(&pos, -1)) || ! u_isalnum(ch))) nPos=pos;
break;
}
- Text.iterateCodePoints(&nPos, bDirection ? -1 : 1);
return nPos;
}