summaryrefslogtreecommitdiffstats
path: root/i18npool/source/breakiterator/xdictionary.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-01-06 12:54:16 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-01-06 12:54:16 +0000
commit4e1fd2fa161708049f1c3b6039659d0bf4f4539e (patch)
tree860f7ec49a96dbb04a3161d44dd1598ce26da2a4 /i18npool/source/breakiterator/xdictionary.cxx
parentCWS-TOOLING: integrate CWS ooxml02 (diff)
downloadcore-4e1fd2fa161708049f1c3b6039659d0bf4f4539e.tar.gz
core-4e1fd2fa161708049f1c3b6039659d0bf4f4539e.zip
CWS-TOOLING: integrate CWS locales31
2008-12-10 14:56:44 +0100 er r265193 : calling convention mismatch 2008-12-08 12:04:56 +0100 er r264984 : #i96840# classify some extra languages as CTL 2008-12-05 19:54:02 +0100 erack r264916 : ImpSvNumberformatScan::ScanType: do not miscategorize as automtic currency if currency symbol in General string, such as R in Standard 2008-12-04 12:07:05 +0100 erack r264831 : CWS-TOOLING: rebase CWS locales31 to trunk@264807 (milestone: DEV300:m37) 2008-12-03 16:14:17 +0100 erack r264797 : #i93694# update script+language -> unicode digit mapping; patch from <hdu> 2008-11-25 02:01:18 +0100 erack r264270 : #i83349# apply remaining parts of the patch, now that we use ICU 4.0; contributed by <kstribley> 2008-11-25 01:38:20 +0100 erack r264269 : #i93694# test the bit, not the constant ... 2008-11-24 10:34:58 +0100 erack r264211 : #i93694# LANGUAGE_ARABIC is gone 2008-11-24 01:39:25 +0100 erack r264192 : #i94435# LANGUAGE_SPANISH now is an alias of LANGUAGE_SPANISH_MODERN, need LANGUAGE_SPANISH_DATED in switch case if both are to be used 2008-11-23 22:54:17 +0100 erack r264190 : CWS-TOOLING: rebase CWS locales31 to trunk@263288 (milestone: DEV300:m35) 2008-11-23 20:23:28 +0100 erack r264189 : migrate CWS locales31 to SVN
Diffstat (limited to 'i18npool/source/breakiterator/xdictionary.cxx')
-rw-r--r--i18npool/source/breakiterator/xdictionary.cxx34
1 files changed, 20 insertions, 14 deletions
diff --git a/i18npool/source/breakiterator/xdictionary.cxx b/i18npool/source/breakiterator/xdictionary.cxx
index e532c0520077..eeafc899a39f 100644
--- a/i18npool/source/breakiterator/xdictionary.cxx
+++ b/i18npool/source/breakiterator/xdictionary.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xdictionary.cxx,v $
- * $Revision: 1.18.22.1 $
+ * $Revision: 1.18.24.1 $
*
* This file is part of OpenOffice.org.
*
@@ -90,8 +90,9 @@ xdictionary::xdictionary(const sal_Char *lang)
for (sal_Int32 i = 0; i < CACHE_MAX; i++)
cache[i].size = 0;
- // for CTL breakiterator, which the word boundary should not inside cell.
+#if USE_CELL_BOUNDARY_CODE
useCellBoundary = sal_False;
+#endif
japaneseWordBreak = sal_False;
}
@@ -105,7 +106,7 @@ xdictionary::~xdictionary() {
}
}
-void SAL_CALL xdictionary::setJapaneseWordBreak()
+void xdictionary::setJapaneseWordBreak()
{
japaneseWordBreak = sal_True;
}
@@ -118,8 +119,7 @@ sal_Bool xdictionary::exists(const sal_Unicode c) {
return exist;
}
-sal_Int32 SAL_CALL
-xdictionary::getLongestMatch(const sal_Unicode* str, sal_Int32 sLen) {
+sal_Int32 xdictionary::getLongestMatch(const sal_Unicode* str, sal_Int32 sLen) {
if ( !index1 ) return 0;
@@ -153,7 +153,7 @@ xdictionary::getLongestMatch(const sal_Unicode* str, sal_Int32 sLen) {
* Compare two unicode string,
*/
-sal_Bool SAL_CALL WordBreakCache::equals(const sal_Unicode* str, Boundary& boundary) {
+sal_Bool WordBreakCache::equals(const sal_Unicode* str, Boundary& boundary) {
// Different length, different string.
if (length != boundary.endPos - boundary.startPos) return sal_False;
@@ -169,7 +169,7 @@ sal_Bool SAL_CALL WordBreakCache::equals(const sal_Unicode* str, Boundary& bound
* @param pos : Position of the given character.
* @return true if CJK.
*/
-sal_Bool SAL_CALL xdictionary::seekSegment(const sal_Unicode *text, sal_Int32 pos,
+sal_Bool xdictionary::seekSegment(const sal_Unicode *text, sal_Int32 pos,
sal_Int32 len, Boundary& segBoundary) {
for (segBoundary.startPos = pos - 1;
segBoundary.startPos >= 0 &&
@@ -189,7 +189,7 @@ sal_Bool SAL_CALL xdictionary::seekSegment(const sal_Unicode *text, sal_Int32 po
#define KATAKANA 2
#define HIRAKANA 3
-static sal_Int16 SAL_CALL JapaneseCharType(sal_Unicode c)
+static sal_Int16 JapaneseCharType(sal_Unicode c)
{
if (0x3041 <= c && c <= 0x309e)
return HIRAKANA;
@@ -198,7 +198,7 @@ static sal_Int16 SAL_CALL JapaneseCharType(sal_Unicode c)
return KANJA;
}
-WordBreakCache& SAL_CALL xdictionary::getCache(const sal_Unicode *text, Boundary& wordBoundary)
+WordBreakCache& xdictionary::getCache(const sal_Unicode *text, Boundary& wordBoundary)
{
WordBreakCache& aCache = cache[text[0] & 0x1f];
@@ -253,11 +253,14 @@ WordBreakCache& SAL_CALL xdictionary::getCache(const sal_Unicode *text, Boundary
if (count) {
aCache.wordboundary[i+1] = aCache.wordboundary[i] + count;
i++;
+
+#if USE_CELL_BOUNDARY_CODE
if (useCellBoundary) {
sal_Int32 cBoundary = cellBoundary[aCache.wordboundary[i] + wordBoundary.startPos - 1];
if (cBoundary > 0)
aCache.wordboundary[i] = cBoundary - wordBoundary.startPos;
}
+#endif
}
}
@@ -265,11 +268,13 @@ WordBreakCache& SAL_CALL xdictionary::getCache(const sal_Unicode *text, Boundary
aCache.wordboundary[i+1] = aCache.wordboundary[i] + len;
i++;
+#if USE_CELL_BOUNDARY_CODE
if (useCellBoundary) {
sal_Int32 cBoundary = cellBoundary[aCache.wordboundary[i] + wordBoundary.startPos - 1];
if (cBoundary > 0)
aCache.wordboundary[i] = cBoundary - wordBoundary.startPos;
}
+#endif
}
}
aCache.wordboundary[i + 1] = aCache.length + 1;
@@ -277,7 +282,7 @@ WordBreakCache& SAL_CALL xdictionary::getCache(const sal_Unicode *text, Boundary
return aCache;
}
-Boundary SAL_CALL xdictionary::previousWord(const OUString& rText, sal_Int32 anyPos, sal_Int16 wordType)
+Boundary xdictionary::previousWord(const OUString& rText, sal_Int32 anyPos, sal_Int16 wordType)
{
// looking for the first non-whitespace character from anyPos
sal_uInt32 ch = rText.iterateCodePoints(&anyPos, -1);
@@ -287,7 +292,7 @@ Boundary SAL_CALL xdictionary::previousWord(const OUString& rText, sal_Int32 any
return getWordBoundary(rText, anyPos, wordType, true);
}
-Boundary SAL_CALL xdictionary::nextWord(const OUString& rText, sal_Int32 anyPos, sal_Int16 wordType)
+Boundary xdictionary::nextWord(const OUString& rText, sal_Int32 anyPos, sal_Int16 wordType)
{
boundary = getWordBoundary(rText, anyPos, wordType, true);
anyPos = boundary.endPos;
@@ -301,7 +306,7 @@ Boundary SAL_CALL xdictionary::nextWord(const OUString& rText, sal_Int32 anyPos,
return getWordBoundary(rText, anyPos, wordType, true);
}
-Boundary SAL_CALL xdictionary::getWordBoundary(const OUString& rText, sal_Int32 anyPos, sal_Int16 wordType, sal_Bool bDirection)
+Boundary xdictionary::getWordBoundary(const OUString& rText, sal_Int32 anyPos, sal_Int16 wordType, sal_Bool bDirection)
{
const sal_Unicode *text=rText.getStr();
sal_Int32 len=rText.getLength();
@@ -334,11 +339,12 @@ Boundary SAL_CALL xdictionary::getWordBoundary(const OUString& rText, sal_Int32
return boundary;
}
-
-void SAL_CALL xdictionary::setCellBoundary(sal_Int32* cellArray)
+#if USE_CELL_BOUNDARY_CODE
+void xdictionary::setCellBoundary(sal_Int32* cellArray)
{
useCellBoundary = sal_True;
cellBoundary = cellArray;
}
+#endif
} } } }