diff options
author | Thomas Lange [tl] <tl@openoffice.org> | 2010-01-06 12:22:41 +0100 |
---|---|---|
committer | Thomas Lange [tl] <tl@openoffice.org> | 2010-01-06 12:22:41 +0100 |
commit | 23d9ba05de57aea727e82bda46a0d004a9adfc8e (patch) | |
tree | 6326375a7c26e4d760760728313bb92a2f27d31b /lingucomponent | |
parent | ba9d7414d5c748ce8d54c692703a8ad601dfdd89 (diff) | |
parent | b87a09786de6f985602ef29f275f44a9944992ce (diff) |
cws tl74: merge with DEV300_m68; AND Unix LF conversion for some files!
Diffstat (limited to 'lingucomponent')
9 files changed, 57 insertions, 30 deletions
diff --git a/lingucomponent/prj/build.lst b/lingucomponent/prj/build.lst index 46272c68b69f..65e8459bea3f 100644 --- a/lingucomponent/prj/build.lst +++ b/lingucomponent/prj/build.lst @@ -1,4 +1,4 @@ -lc lingucomponent : linguistic libtextcat svtools hyphen HUNSPELL:hunspell NULL +lc lingucomponent : linguistic libtextcat svl hyphen HUNSPELL:hunspell NULL lc lingucomponent usr1 - all lc_mkout NULL lc lingucomponent\inc nmake - all lc_inc NULL lc lingucomponent\source\lingutil nmake - all lc_util lc_inc NULL diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx index b24bc6ee80f5..8f43530c5a3a 100644 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx @@ -39,8 +39,8 @@ #include <cppuhelper/factory.hxx> // helper for factories #include <com/sun/star/registry/XRegistryKey.hpp> #include <i18npool/mslangid.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/useroptions.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/useroptions.hxx> #include <tools/debug.hxx> #include <unotools/processfactory.hxx> #include <osl/mutex.hxx> @@ -57,9 +57,9 @@ #include <rtl/ustrbuf.hxx> #include <linguistic/lngprops.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/useroptions.hxx> -#include <svtools/lingucfg.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/useroptions.hxx> +#include <unotools/lingucfg.hxx> #include <osl/file.hxx> #include "dictmgr.hxx" @@ -534,7 +534,7 @@ Reference < XHyphenatedWord > SAL_CALL Reference< XPossibleHyphens > SAL_CALL Hyphenator::createPossibleHyphens( const ::rtl::OUString& aWord, const ::com::sun::star::lang::Locale& aLocale, - const ::com::sun::star::beans::PropertyValues& /*aProperties*/ ) + const ::com::sun::star::beans::PropertyValues& aProperties ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) @@ -544,6 +544,10 @@ Reference< XPossibleHyphens > SAL_CALL char *lcword; int k; + PropertyHelper_Hyphen & rHelper = GetPropHelper();
+ rHelper.SetTmpPropVals(aProperties);
+ sal_Int16 minTrail = rHelper.GetMinTrailing();
+ sal_Int16 minLead = rHelper.GetMinLeading();
HyphenDict *dict = NULL; rtl_TextEncoding aEnc = 0; @@ -617,6 +621,9 @@ Reference< XPossibleHyphens > SAL_CALL wordlen = encWord.getLength(); lcword = new char[wordlen+1]; hyphens = new char[wordlen+5]; + char ** rep = NULL; // replacements of discretionary hyphenation
+ int * pos = NULL; // array of [hyphenation point] minus [deletion position]
+ int * cut = NULL; // length of deletions in original word
// copy converted word into simple char buffer strcpy(lcword,encWord.getStr()); @@ -627,10 +634,22 @@ Reference< XPossibleHyphens > SAL_CALL n++; // fprintf(stderr,"hyphenate... %s\n",lcword); fflush(stderr); if (n > 0) { - if (hnj_hyphen_hyphenate(dict, lcword, n, hyphens)) + if (hnj_hyphen_hyphenate3(dict, lcword, n, hyphens, NULL, &rep, &pos, &cut,
+ minLead, minTrail, Max(dict->clhmin, Max(dict->clhmin, 2) + Max(0, minLead - Max(dict->lhmin, 2))),
+ Max(dict->crhmin, Max(dict->crhmin, 2) + Max(0, minTrail - Max(dict->rhmin, 2)))))
{ delete[] hyphens; delete[] lcword; +
+ if (rep) {
+ for(int j = 0; j < n; j++) {
+ if (rep[j]) free(rep[j]);
+ }
+ free(rep);
+ }
+ if (pos) free(pos);
+ if (cut) free(cut);
+ return NULL; } } @@ -643,7 +662,7 @@ Reference< XPossibleHyphens > SAL_CALL INT16 i; for ( i = 0; i < encWord.getLength(); i++) - if (hyphens[i]&1) + if (hyphens[i]&1 && (!rep || !rep[i]))
nHyphCount++; Sequence< INT16 > aHyphPos(nHyphCount); @@ -652,15 +671,14 @@ Reference< XPossibleHyphens > SAL_CALL OUString hyphenatedWord; nHyphCount = 0; - for (i = 0; i < encWord.getLength(); i++) - { + for (i = 0; i < nWord.getLength(); i++) {
hyphenatedWordBuffer.append(aWord[i]); - if (hyphens[i]&1) - { - pPos[nHyphCount] = i; - hyphenatedWordBuffer.append(sal_Unicode('=')); - nHyphCount++; - } + // hyphenation position (not alternative)
+ if (hyphens[i]&1 && (!rep || !rep[i])) {
+ pPos[nHyphCount] = i;
+ hyphenatedWordBuffer.append(sal_Unicode('='));
+ nHyphCount++;
+ }
} hyphenatedWord = hyphenatedWordBuffer.makeStringAndClear(); @@ -672,6 +690,16 @@ Reference< XPossibleHyphens > SAL_CALL delete[] hyphens; delete[] lcword; +
+ if (rep) {
+ for(int j = 0; j < n; j++) {
+ if (rep[j]) free(rep[j]);
+ }
+ free(rep);
+ }
+ if (pos) free(pos);
+ if (cut) free(cut);
+ return xRes; } diff --git a/lingucomponent/source/languageguessing/guesslang.cxx b/lingucomponent/source/languageguessing/guesslang.cxx index bd2c29430f76..fd3e123e1d26 100644 --- a/lingucomponent/source/languageguessing/guesslang.cxx +++ b/lingucomponent/source/languageguessing/guesslang.cxx @@ -50,7 +50,7 @@ #include <com/sun/star/registry/XRegistryKey.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/linguistic2/XLanguageGuessing.hpp> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <unotools/localfilehelper.hxx> #include <osl/thread.h> diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx index d32af21f7e7a..2e00035628bc 100644 --- a/lingucomponent/source/lingutil/lingutil.cxx +++ b/lingucomponent/source/lingutil/lingutil.cxx @@ -49,8 +49,8 @@ #include <tools/debug.hxx> #include <tools/urlobj.hxx> #include <i18npool/mslangid.hxx> -#include <svtools/lingucfg.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/lingucfg.hxx> +#include <unotools/pathoptions.hxx> #include <rtl/ustring.hxx> #include <rtl/string.hxx> #include <linguistic/misc.hxx> diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.cxx b/lingucomponent/source/spellcheck/macosxspell/macspellimp.cxx index d1d8103eedd5..7244a4988236 100644 --- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.cxx +++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.cxx @@ -46,8 +46,8 @@ //#include <linguistic/lngprops.hxx> #include <linguistic/spelldta.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/useroptions.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/useroptions.hxx> #include <osl/file.hxx> #include <rtl/ustrbuf.hxx> diff --git a/lingucomponent/source/spellcheck/macosxspell/makefile.mk b/lingucomponent/source/spellcheck/macosxspell/makefile.mk index ac3ac3b7d3a0..e4bf1d88d220 100644 --- a/lingucomponent/source/spellcheck/macosxspell/makefile.mk +++ b/lingucomponent/source/spellcheck/macosxspell/makefile.mk @@ -71,9 +71,7 @@ SHL1STDLIBS= \ $(CPPUHELPERLIB) \ $(VOSLIB) \ $(TOOLSLIB) \ - $(SVTOOLLIB) \ $(SVLLIB) \ - $(VCLLIB) \ $(SALLIB) \ $(UCBHELPERLIB) \ $(UNOTOOLSLIB) \ diff --git a/lingucomponent/source/spellcheck/spell/makefile.mk b/lingucomponent/source/spellcheck/spell/makefile.mk index 623ade9f3f3c..cbc41c00633b 100644 --- a/lingucomponent/source/spellcheck/spell/makefile.mk +++ b/lingucomponent/source/spellcheck/spell/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -65,6 +65,7 @@ SHL1STDLIBS= \ $(CPPUHELPERLIB) \ $(I18NISOLANGLIB) \ $(TOOLSLIB) \ + $(UNOTOOLSLIB) \ $(SVLLIB) \ $(SALLIB) \ $(LNGLIB) \ diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index ed1ddf4ca77b..1a92db58a4dc 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -50,9 +50,9 @@ #include <linguistic/lngprops.hxx> #include <linguistic/spelldta.hxx> #include <i18npool/mslangid.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/lingucfg.hxx> -#include <svtools/useroptions.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/lingucfg.hxx> +#include <unotools/useroptions.hxx> #include <osl/file.hxx> #include <rtl/ustrbuf.hxx> diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx index 1ecba30bcb8c..c526d2b07444 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx +++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx @@ -41,8 +41,8 @@ #include <tools/debug.hxx> #include <unotools/processfactory.hxx> #include <osl/mutex.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/lingucfg.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/lingucfg.hxx> #include <rtl/string.hxx> #include <rtl/ustrbuf.hxx> |