summaryrefslogtreecommitdiff
path: root/i18npool/source/breakiterator/xdictionary.cxx
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-12-16 10:59:24 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-12-16 10:59:24 +0000
commit692b9bb291b9c5efb6c2daf77b213bde07326016 (patch)
tree0128da2605b9233bbc7bbb919c2e09ef8c872f9f /i18npool/source/breakiterator/xdictionary.cxx
parent97396d0614f87ed8cdbad577dbccc217e2e98c58 (diff)
CWS-TOOLING: integrate CWS odfp30_DEV300
Diffstat (limited to 'i18npool/source/breakiterator/xdictionary.cxx')
-rw-r--r--i18npool/source/breakiterator/xdictionary.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/i18npool/source/breakiterator/xdictionary.cxx b/i18npool/source/breakiterator/xdictionary.cxx
index 301dac5622fd..e532c0520077 100644
--- a/i18npool/source/breakiterator/xdictionary.cxx
+++ b/i18npool/source/breakiterator/xdictionary.cxx
@@ -56,6 +56,7 @@ extern "C" { static void SAL_CALL thisModule() {} }
xdictionary::xdictionary(const sal_Char *lang)
{
+ index1 = 0;
#ifdef SAL_DLLPREFIX
OUStringBuffer aBuf( strlen(lang) + 7 + 6 ); // mostly "lib*.so" (with * == dict_zh)
aBuf.appendAscii( SAL_DLLPREFIX );
@@ -78,7 +79,14 @@ xdictionary::xdictionary(const sal_Char *lang)
dataArea = (sal_Unicode*) (*func)();
}
else
+ {
existMark = NULL;
+ index1 = NULL;
+ index2 = NULL;
+ lenArray = NULL;
+ dataArea = NULL;
+ }
+
for (sal_Int32 i = 0; i < CACHE_MAX; i++)
cache[i].size = 0;
@@ -113,6 +121,8 @@ sal_Bool xdictionary::exists(const sal_Unicode c) {
sal_Int32 SAL_CALL
xdictionary::getLongestMatch(const sal_Unicode* str, sal_Int32 sLen) {
+ if ( !index1 ) return 0;
+
sal_Int16 idx = index1[str[0] >> 8];
if (idx == 0xFF) return 0;