summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2006-01-06 12:13:04 +0000
committerKurt Zenker <kz@openoffice.org>2006-01-06 12:13:04 +0000
commitf6047f1ec3845bc1f5f23c147b36a2cf2938df03 (patch)
tree6d241a195fffca67294b5f82a4809905655ce1f7
parent887a2e4dd1d676f6dd02be2bfbec795e103fc1f7 (diff)
INTEGRATION: CWS hunspell (1.13.36); FILE MERGED
2005/09/19 22:13:09 nemeth 1.13.36.2: RESYNC: (1.13-1.14); FILE MERGED 2005/09/19 21:54:28 nemeth 1.13.36.1: i52383
-rw-r--r--lingucomponent/source/spellcheck/spell/sspellimp.cxx27
1 files changed, 15 insertions, 12 deletions
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 3853025d8e27..3ac4f385676e 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sspellimp.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: rt $ $Date: 2005-09-07 19:43:11 $
+ * last change: $Author: kz $ $Date: 2006-01-06 13:13:04 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -54,7 +54,7 @@
#include <osl/mutex.hxx>
#endif
-#include <myspell.hxx>
+#include <hunspell.hxx>
#include <dictmgr.hxx>
#ifndef _SPELLIMP_HXX
@@ -191,7 +191,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales()
numdict = numshr + numusr;
if (numdict) {
- aDicts = new MySpell* [numdict];
+ aDicts = new Hunspell* [numdict];
aDEncs = new rtl_TextEncoding [numdict];
aDLocs = new Locale [numdict];
aDNames = new OUString [numdict];
@@ -295,7 +295,7 @@ sal_Bool SAL_CALL SpellChecker::hasLocale(const Locale& rLocale)
INT16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rLocale )
{
- MySpell * pMS;
+ Hunspell * pMS;
rtl_TextEncoding aEnc;
// initialize a myspell object for each dictionary once
@@ -334,13 +334,17 @@ INT16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rLocal
osl::FileBase::getSystemPathFromFileURL(affpath,aff);
OString aTmpaff(OU2ENC(aff,osl_getThreadTextEncoding()));
OString aTmpdict(OU2ENC(dict,osl_getThreadTextEncoding()));
- aDicts[i] = new MySpell(aTmpaff.getStr(),aTmpdict.getStr());
+ aDicts[i] = new Hunspell(aTmpaff.getStr(),aTmpdict.getStr());
aDEncs[i] = 0;
if (aDicts[i]) {
+ char * dic_encoding = aDicts[i]->get_dic_encoding();
aDEncs[i] = rtl_getTextEncodingFromUnixCharset(aDicts[i]->get_dic_encoding());
- if ((aDEncs[i] == RTL_TEXTENCODING_DONTKNOW)
- && (strcmp("ISCII-DEVANAGARI",aDicts[i]->get_dic_encoding()) == 0)) {
- aDEncs[i] = RTL_TEXTENCODING_ISCII_DEVANAGARI;
+ if (aDEncs[i] == RTL_TEXTENCODING_DONTKNOW) {
+ if (strcmp("ISCII-DEVANAGARI", dic_encoding) == 0) {
+ aDEncs[i] = RTL_TEXTENCODING_ISCII_DEVANAGARI;
+ } else if (strcmp("UTF-8", dic_encoding) == 0) {
+ aDEncs[i] = RTL_TEXTENCODING_UTF8;
+ }
}
}
}
@@ -420,7 +424,7 @@ Reference< XSpellAlternatives >
Reference< XSpellAlternatives > xRes;
// note: mutex is held by higher up by spell which covers both
- MySpell* pMS;
+ Hunspell* pMS;
rtl_TextEncoding aEnc;
int count;
int numsug = 0;
@@ -453,7 +457,6 @@ Reference< XSpellAlternatives >
aEnc = aDEncs[i];
}
-
if (pMS)
{
char ** suglst = NULL;
@@ -567,7 +570,7 @@ OUString SAL_CALL
throw(RuntimeException)
{
MutexGuard aGuard( GetLinguMutex() );
- return A2OU( "OpenOffice.org MySpell SpellChecker" );
+ return A2OU( "OpenOffice.org Hunspell SpellChecker" );
}