Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | Thesaurus must be shared | ||
---|---|---|---|
Product: | Infrastructure | Reporter: | maison.godard |
Component: | Website general issues | Assignee: | khendricks |
Status: | CLOSED FIXED | QA Contact: | issues@lingucomponent <issues> |
Severity: | Trivial | ||
Priority: | P3 | CC: | issues |
Version: | current | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Issue Type: | DEFECT | Latest Confirmation in: | --- |
Developer Difficulty: | --- |
Description
maison.godard
2003-10-06 14:23:39 UTC
Hi, Targeting this one to 1.1.1 Also here is a patch to allow both user and shared thesauri just as with dictioanries and hyphenation for approval for the 1.1.1 tree. --- thesimp.cxx.~1.13.~ 2003-06-12 06:41:13.000000000 -0400 +++ thesimp.cxx 2003-10-09 08:35:50.000000000 -0400 @@ -187,10 +187,23 @@ MutexGuard aGuard( GetLinguMutex() ); dictentry * spthes; // shared thesaurus list entry pointer + dictentry * upthes; // shared thesaurus list entry pointer SvtPathOptions aPathOpt; + int numusr; // number of user dictionary entries + int numshr; // number of shared dictionary entries if (!numthes) { + // invoke a dictionary manager to get the user dictionary list + OUString usrlst = aPathOpt.GetUserDictionaryPath() + A2OU("/dictionary.lst"); + OUString ulst; + osl::FileBase::getSystemPathFromFileURL(usrlst,ulst); + OString uTmp(OU2ENC(ulst, osl_getThreadTextEncoding())); + DictMgr* udMgr = new DictMgr(uTmp.getStr(),"THES"); + numusr = 0; + if (udMgr) + numusr = udMgr->get_list(&upthes); + // invoke a dictionary manager to get the shared thesaurus list OUString shrlst = aPathOpt.GetLinguisticPath() + A2OU("/ooo/dictionary.lst"); OUString slst; @@ -198,11 +211,14 @@ OString sTmp(OU2ENC(slst, osl_getThreadTextEncoding())); DictMgr* sdMgr = new DictMgr(sTmp.getStr(),"THES"); if (sdMgr) - numthes = sdMgr->get_list(&spthes); + numshr = sdMgr->get_list(&spthes); + - // we are implicitly limiting thesauri to be installed in - // shared locations only (no user installs) since they - // are "processed files" and not text based + // we really should merge these and remove duplicates but since + // users can name their dictionaries anything they want it would + // be impossible to know if a real duplication exists unless we + // add some unique key to each dictionary + numthes = numshr + numusr; if (numthes) { aThes = new ThesLookup* [numthes]; @@ -217,8 +233,33 @@ int i,j; int k = 0; - // add the thesauri - for (i = 0; i < numthes; i++) { + //first add the user dictionaries + for (i = 0; i < numusr; i++) { + Locale nLoc( A2OU(upthes->lang), A2OU(upthes->region), OUString() ); + newloc = 1; + for (j = 0; j < numlocs; j++) { + if (nLoc == pLocale[j]) newloc = 0; + } + if (newloc) { + pLocale[numlocs] = nLoc; + numlocs++; + } + aTLocs[k] = nLoc; + aThes[k] = NULL; + const char * enc_string = get_default_enc(upthes->lang); + if (enc_string) { + aTEncs[k] = rtl_getTextEncodingFromUnixCharset(enc_string); + } else { + aTEncs[k] = rtl_getTextEncodingFromUnixCharset("ISO8859-1"); + } + aTNames[k] = aPathOpt.GetUserDictionaryPath() + A2OU("/") + A2OU(upthes->filename); + aCharSetInfo[k] = new CharClass(nLoc); + k++; + upthes++; + } + + // now add the shared thesauri + for (i = 0; i < numshr; i++) { Locale nLoc( A2OU(spthes->lang), A2OU(spthes->region), OUString() ); newloc = 1; for (j = 0; j < numlocs; j++) { @@ -256,6 +297,11 @@ } /* de-allocation of memory is handled inside the DictMgr */ + upthes = NULL; + if (udMgr) { + delete udMgr; + udMgr = NULL; + } spthes = NULL; if (sdMgr) { delete sdMgr; mh: target approved. Hi, Committed the fix to this to OOo 1.1.1 So I am resolving this as fixed. Please verify when OOo 1.1.1 is released and then close this issue. (I personally tested this by removing my thesaurus and entry in dictionary.lst from share/dict/ooo/ and installing them in user/wordbook/ and after restarting OOo I was able to access the thesaurus just fine). Kevin Thanks a lot Kevin Waiting for 1.1.1 ;-)) Laurent close issue |