diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-02-20 21:03:06 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-02-23 10:31:19 +0000 |
commit | e4825f45e583a2309f343a8abedfcc4200e08268 (patch) | |
tree | 1596f7959696620259034df2cee07236160a7241 /l10ntools | |
parent | 8f6321b77528b70f170a8f0e74ce003e8bd9219d (diff) |
make sure we retain fix for fdo#40665 in clucene
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/source/help/HelpIndexer.cxx | 18 | ||||
-rw-r--r-- | l10ntools/source/help/LuceneHelper.cxx | 2 |
2 files changed, 8 insertions, 12 deletions
diff --git a/l10ntools/source/help/HelpIndexer.cxx b/l10ntools/source/help/HelpIndexer.cxx index a3ab752287a3..fdae9e63d273 100644 --- a/l10ntools/source/help/HelpIndexer.cxx +++ b/l10ntools/source/help/HelpIndexer.cxx @@ -1,11 +1,6 @@ #include <l10ntools/HelpIndexer.hxx> #include "LuceneHelper.hxx" - -#define TODO - -#ifdef TODO #include <CLucene/analysis/LanguageBasedAnalyzer.h> -#endif #include <rtl/string.hxx> #include <osl/file.hxx> @@ -24,16 +19,17 @@ bool HelpIndexer::indexDocuments() { return false; } -#ifdef TODO + rtl::OUString sLang = d_lang.getToken(0, '-'); + bool bUseCJK = + sLang.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ja")) || + sLang.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ko")) || + sLang.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("zh")); + // Construct the analyzer appropriate for the given language lucene::analysis::Analyzer *analyzer = ( - d_lang.compareToAscii("ja") == 0 ? + bUseCJK ? (lucene::analysis::Analyzer*)new lucene::analysis::LanguageBasedAnalyzer(L"cjk") : (lucene::analysis::Analyzer*)new lucene::analysis::standard::StandardAnalyzer()); -#else - lucene::analysis::Analyzer *analyzer = ( - (lucene::analysis::Analyzer*)new lucene::analysis::standard::StandardAnalyzer()); -#endif rtl::OString indexDirStr; d_indexDir.convertToString(&indexDirStr, RTL_TEXTENCODING_ASCII_US, 0); diff --git a/l10ntools/source/help/LuceneHelper.cxx b/l10ntools/source/help/LuceneHelper.cxx index 762475b17dcd..f83d888f6222 100644 --- a/l10ntools/source/help/LuceneHelper.cxx +++ b/l10ntools/source/help/LuceneHelper.cxx @@ -24,5 +24,5 @@ rtl::OUString TCHARArrayToOUString(TCHAR const *str) return rtl::OUString((const sal_Unicode*)(str)); // UTF-32 - return ::OUString((const sal_uInt32*)str, wcslen(str)); + return rtl::OUString((const sal_uInt32*)str, wcslen(str)); } |