From 692b9bb291b9c5efb6c2daf77b213bde07326016 Mon Sep 17 00:00:00 2001 From: RĂ¼diger Timm Date: Tue, 16 Dec 2008 10:59:24 +0000 Subject: CWS-TOOLING: integrate CWS odfp30_DEV300 --- i18npool/source/breakiterator/xdictionary.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'i18npool/source/breakiterator/xdictionary.cxx') 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; -- cgit