diff options
author | Mathias Bauer <mba@openoffice.org> | 2011-02-24 17:08:10 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-06-16 12:14:15 +0200 |
commit | c683c55b54d3708ebe458146253d147186590c79 (patch) | |
tree | 49dcee4fe25e057791d837837c83a8c90eafa3ff | |
parent | 2151303db47b9dc6a262df884939db4240d291a5 (diff) |
CWS gnumake4: convert linguistic to new build system
22 files changed, 615 insertions, 646 deletions
diff --git a/linguistic/JunitTest_linguistic_complex.mk b/linguistic/JunitTest_linguistic_complex.mk new file mode 100644 index 000000000000..fa7fad3a9d9c --- /dev/null +++ b/linguistic/JunitTest_linguistic_complex.mk @@ -0,0 +1,53 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2011 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$(eval $(call gb_JunitTest_JunitTest,linguistic_complex)) + +$(eval $(call gb_JunitTest_set_defs,linguistic_complex,\ + $$(DEFS) \ + -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/linguistic/qa/complex/linguistic/testdocuments \ +)) + +$(eval $(call gb_JunitTest_add_jars,linguistic_complex,\ + $(OUTDIR)/bin/OOoRunner.jar \ + $(OUTDIR)/bin/ridl.jar \ + $(OUTDIR)/bin/test.jar \ + $(OUTDIR)/bin/test-tools.jar \ + $(OUTDIR)/bin/unoil.jar \ + $(OUTDIR)/bin/jurt.jar \ +)) + +$(eval $(call gb_JunitTest_add_sourcefiles,linguistic_complex,\ + linguistic/qa/complex/linguistic/HangulHanjaConversion \ + linguistic/qa/complex/linguistic/TestDocument \ +)) + +$(eval $(call gb_JunitTest_add_classes,linguistic_complex,\ + complex.linguistic.HangulHanjaConversion \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/linguistic/JunitTest_linguistic_unoapi.mk b/linguistic/JunitTest_linguistic_unoapi.mk new file mode 100644 index 000000000000..237769e5d7f6 --- /dev/null +++ b/linguistic/JunitTest_linguistic_unoapi.mk @@ -0,0 +1,53 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2011 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$(eval $(call gb_JunitTest_JunitTest,linguistic_unoapi)) + +$(eval $(call gb_JunitTest_set_defs,linguistic_unoapi,\ + $$(DEFS) \ + -Dorg.openoffice.test.arg.sce=$(SRCDIR)/linguistic/qa/unoapi/lng.sce \ + -Dorg.openoffice.test.arg.xcl=$(SRCDIR)/linguistic/qa/unoapi/knownissues.xcl \ + -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/linguistic/qa/unoapi \ +)) + +$(eval $(call gb_JunitTest_add_jars,linguistic_unoapi,\ + $(OUTDIR)/bin/OOoRunner.jar \ + $(OUTDIR)/bin/ridl.jar \ + $(OUTDIR)/bin/test.jar \ + $(OUTDIR)/bin/unoil.jar \ + $(OUTDIR)/bin/jurt.jar \ +)) + +$(eval $(call gb_JunitTest_add_sourcefiles,linguistic_unoapi,\ + linguistic/qa/unoapi/Test \ +)) + +$(eval $(call gb_JunitTest_add_classes,linguistic_unoapi,\ + org.openoffice.linguistic.qa.unoapi.Test \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/linguistic/Library_lng.mk b/linguistic/Library_lng.mk new file mode 100644 index 000000000000..1181a9ae62d5 --- /dev/null +++ b/linguistic/Library_lng.mk @@ -0,0 +1,88 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2011 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$(eval $(call gb_Library_Library,lng)) + +$(eval $(call gb_Library_add_package_headers,lng,linguistic_inc)) + +$(eval $(call gb_Library_add_precompiled_header,lng,$(SRCDIR)/linguistic/inc/pch/precompiled_linguistic)) + +$(eval $(call gb_Library_set_componentfile,lng,linguistic/source/lng)) + +$(eval $(call gb_Library_set_include,lng,\ + $$(INCLUDE) \ + -I$(SRCDIR)/linguistic/inc \ + -I$(SRCDIR)/linguistic/inc/pch \ + -I$(OUTDIR)/inc/offuh \ +)) + +$(eval $(call gb_Library_set_defs,lng,\ + $$(DEFS) \ + -DLNG_DLLIMPLEMENTATION \ +)) + +$(eval $(call gb_Library_add_linked_libs,lng,\ + cppu \ + cppuhelper \ + comphelper \ + vos3 \ + tl \ + i18nisolang1 \ + svl \ + stl \ + sal \ + xo \ + ucbhelper \ + utl \ + icuuc \ + $(gb_STDLIBS) \ +)) + +$(eval $(call gb_Library_add_exception_objects,lng,\ + linguistic/source/convdic \ + linguistic/source/convdiclist \ + linguistic/source/convdicxml \ + linguistic/source/dicimp \ + linguistic/source/dlistimp \ + linguistic/source/gciterator \ + linguistic/source/hhconvdic \ + linguistic/source/hyphdsp \ + linguistic/source/hyphdta \ + linguistic/source/iprcache \ + linguistic/source/lngopt \ + linguistic/source/lngprophelp \ + linguistic/source/lngreg \ + linguistic/source/lngsvcmgr \ + linguistic/source/misc \ + linguistic/source/misc2 \ + linguistic/source/spelldsp \ + linguistic/source/spelldta \ + linguistic/source/thesdsp \ + linguistic/source/thesdta \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/linguistic/qa/complex/linguistic/makefile.mk b/linguistic/Makefile index 43a88ee0a198..90947b2e5f48 100644 --- a/linguistic/qa/complex/linguistic/makefile.mk +++ b/linguistic/Makefile @@ -2,7 +2,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2000, 2010 Oracle and/or its affiliates. +# Copyright 2000, 2011 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # @@ -25,37 +25,14 @@ # #************************************************************************* -.IF "$(OOO_SUBSEQUENT_TESTS)" == "" -nothing .PHONY: -.ELSE +ifeq ($(strip $(SOLARENV)),) +$(error No environment set!) +endif -PRJ = ../../.. -PRJNAME = sc -TARGET = qa_complex_linguistic +gb_PARTIALBUILD := T +GBUILDDIR := $(SOLARENV)/gbuild +include $(GBUILDDIR)/gbuild.mk -.IF "$(OOO_JUNIT_JAR)" != "" -PACKAGE = complex/linguistic +$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk))) -# here store only Files which contain a @Test -JAVATESTFILES = \ - HangulHanjaConversion.java - -# put here all other files -JAVAFILES = $(JAVATESTFILES) \ - TestDocument.java - -JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar -EXTRAJARFILES = $(OOO_JUNIT_JAR) - -# Sample how to debug -# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y - -.END - -.INCLUDE: settings.mk -.INCLUDE: target.mk -.INCLUDE: installationtest.mk - -ALLTAR : javatest - -.END +# vim: set noet sw=4 ts=4: diff --git a/linguistic/qa/unoapi/makefile.mk b/linguistic/Module_linguistic.mk index bd330c6fbaca..045a6b9da292 100644 --- a/linguistic/qa/unoapi/makefile.mk +++ b/linguistic/Module_linguistic.mk @@ -1,7 +1,8 @@ #************************************************************************* -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2000, 2010 Oracle and/or its affiliates. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2011 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # @@ -21,28 +22,24 @@ # version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. -#***********************************************************************/ +# +#************************************************************************* -.IF "$(OOO_SUBSEQUENT_TESTS)" == "" -nothing .PHONY: -.ELSE +$(eval $(call gb_Module_Module,linguistic)) -PRJ = ../.. -PRJNAME = linguistic -TARGET = qa_unoapi +$(eval $(call gb_Module_add_targets,linguistic,\ + Library_lng \ + Package_inc \ +)) -.IF "$(OOO_JUNIT_JAR)" != "" -PACKAGE = org/openoffice/linguistic/qa/unoapi -JAVATESTFILES = Test.java -JAVAFILES = $(JAVATESTFILES) -JARFILES = OOoRunner.jar ridl.jar test.jar -EXTRAJARFILES = $(OOO_JUNIT_JAR) -.END +#$(eval $(call gb_Module_add_check_targets,linguistic,\ +#)) -.INCLUDE: settings.mk -.INCLUDE: target.mk -.INCLUDE: installationtest.mk +$(eval $(call gb_Module_add_subsequentcheck_targets,linguistic,\ + JunitTest_linguistic_unoapi \ +)) -ALLTAR : javatest +# was disabled in old build system +# JunitTest_linguistic_complex \ -.END +# vim: set noet sw=4 ts=4: diff --git a/linguistic/Package_inc.mk b/linguistic/Package_inc.mk new file mode 100644 index 000000000000..4c86bddc7c96 --- /dev/null +++ b/linguistic/Package_inc.mk @@ -0,0 +1,40 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2011 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$(eval $(call gb_Package_Package,linguistic_inc,$(SRCDIR)/linguistic/inc)) + +# add files to the package +# SOURCE_RELPATH/file.ext is the name of the source file (relative to the root give above) +# DESTINATION_RELPATH/file.ext is the destination file (relative to $(OUTDIR)) +$(eval $(call gb_Package_add_file,linguistic_inc,inc/linguistic/lngdllapi.h,linguistic/lngdllapi.h)) +$(eval $(call gb_Package_add_file,linguistic_inc,inc/linguistic/hyphdta.hxx,linguistic/hyphdta.hxx)) +$(eval $(call gb_Package_add_file,linguistic_inc,inc/linguistic/lngprophelp.hxx,linguistic/lngprophelp.hxx)) +$(eval $(call gb_Package_add_file,linguistic_inc,inc/linguistic/lngprops.hxx,linguistic/lngprops.hxx)) +$(eval $(call gb_Package_add_file,linguistic_inc,inc/linguistic/misc.hxx,linguistic/misc.hxx)) +$(eval $(call gb_Package_add_file,linguistic_inc,inc/linguistic/spelldta.hxx,linguistic/spelldta.hxx)) + +# vim: set noet sw=4 ts=4: diff --git a/linguistic/inc/linguistic/hyphdta.hxx b/linguistic/inc/linguistic/hyphdta.hxx index 5d163e827239..7814c7821aa9 100644 --- a/linguistic/inc/linguistic/hyphdta.hxx +++ b/linguistic/inc/linguistic/hyphdta.hxx @@ -28,15 +28,12 @@ #ifndef _LINGUISTIC_HYPHDTA_HXX_ #define _LINGUISTIC_HYPHDTA_HXX_ - #include <com/sun/star/linguistic2/XHyphenatedWord.hpp> #include <com/sun/star/linguistic2/XPossibleHyphens.hpp> - #include <tools/solar.h> - #include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type #include <cppuhelper/implbase1.hxx> // helper for implementations - +#include <linguistic/lngdllapi.h> namespace linguistic { @@ -91,6 +88,9 @@ public: void SetWord( ::rtl::OUString &rTxt ) { aWord = rTxt; } void SetHyphenatedWord( ::rtl::OUString &rTxt ) { aHyphenatedWord = rTxt; } void SetLanguage( sal_Int16 nLang ) { nLanguage = nLang; } + static com::sun::star::uno::Reference <com::sun::star::linguistic2::XHyphenatedWord> LNG_DLLPUBLIC CreateHyphenatedWord( + const ::rtl::OUString &rWord, sal_Int16 nLang, sal_Int16 nHyphenationPos, + const ::rtl::OUString &rHyphenatedWord, sal_Int16 nHyphenPos ); }; @@ -135,6 +135,11 @@ public: sal_Int16 GetLanguage() { return nLanguage; } void SetWord( ::rtl::OUString &rTxt ) { aWord = rTxt; } void SetLanguage( sal_Int16 nLang ) { nLanguage = nLang; } + + static com::sun::star::uno::Reference < com::sun::star::linguistic2::XPossibleHyphens > LNG_DLLPUBLIC CreatePossibleHyphens + (const ::rtl::OUString &rWord, sal_Int16 nLang, + const ::rtl::OUString &rHyphWord, + const ::com::sun::star::uno::Sequence< sal_Int16 > &rPositions); }; diff --git a/linguistic/inc/linguistic/lngdllapi.h b/linguistic/inc/linguistic/lngdllapi.h new file mode 100644 index 000000000000..5db6d4dbd799 --- /dev/null +++ b/linguistic/inc/linguistic/lngdllapi.h @@ -0,0 +1,42 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef INCLUDED_LNG_DLLAPI_H +#define INCLUDED_LNG_DLLAPI_H + +#include "sal/config.h" +#include "sal/types.h" + +#if defined LNG_DLLIMPLEMENTATION +#define LNG_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define LNG_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif + +#define LNG_DLLPRIVATE SAL_DLLPRIVATE + +#endif diff --git a/linguistic/inc/linguistic/lngprophelp.hxx b/linguistic/inc/linguistic/lngprophelp.hxx index 2deef9539fbc..879b67e46b50 100644 --- a/linguistic/inc/linguistic/lngprophelp.hxx +++ b/linguistic/inc/linguistic/lngprophelp.hxx @@ -29,14 +29,13 @@ #define _LINGUISTIC_LNGPROPHELP_HXX_ #include <tools/solar.h> - #include <uno/lbnames.h> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/interfacecontainer.h> #include <com/sun/star/beans/XPropertyChangeListener.hpp> #include <com/sun/star/beans/PropertyValues.hpp> - #include <com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp> +#include <linguistic/lngdllapi.h> namespace com { namespace sun { namespace star { namespace beans { class XPropertySet; @@ -161,7 +160,6 @@ public: /////////////////////////////////////////////////////////////////////////// - class PropertyHelper_Thes : public PropertyChgHelper { @@ -183,6 +181,28 @@ public: throw(::com::sun::star::uno::RuntimeException); }; +class LNG_DLLPUBLIC PropertyHelper_Thesaurus +{ + PropertyHelper_Thes* pInst; + com::sun::star::uno::Reference< com::sun::star::beans::XPropertyChangeListener > xPropHelper; + + // disallow use of copy-constructor and assignment-operator + PropertyHelper_Thesaurus( const PropertyHelper_Thes & ); + PropertyHelper_Thesaurus & operator = ( const PropertyHelper_Thes & ); + +public: + PropertyHelper_Thesaurus( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > &rxSource, + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > &rxPropSet ); + ~PropertyHelper_Thesaurus(); + void AddAsPropListener(); + void RemoveAsPropListener(); + void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ); +}; + + /////////////////////////////////////////////////////////////////////////// class PropertyHelper_Spell : @@ -234,6 +254,41 @@ public: sal_Bool IsSpellCapitalization() const { return bResIsSpellCapitalization; } }; + +class LNG_DLLPUBLIC PropertyHelper_Spelling +{ + PropertyHelper_Spell* pInst; + com::sun::star::uno::Reference< com::sun::star::beans::XPropertyChangeListener > xPropHelper; + + // disallow use of copy-constructor and assignment-operator + PropertyHelper_Spelling( const PropertyHelper_Spell & ); + PropertyHelper_Spelling & operator = ( const PropertyHelper_Spell & ); + +public: + PropertyHelper_Spelling( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > &rxSource, + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > &rxPropSet ); + ~PropertyHelper_Spelling(); + + void AddAsPropListener(); + void RemoveAsPropListener(); + void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ); + sal_Int16 GetMaxNumberOfSuggestions() const; + sal_Bool IsSpellUpperCase() const; + sal_Bool IsSpellWithDigits() const; + sal_Bool IsSpellCapitalization() const; + sal_Bool addLinguServiceEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) + throw(::com::sun::star::uno::RuntimeException); + sal_Bool removeLinguServiceEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) + throw(::com::sun::star::uno::RuntimeException); +}; + /////////////////////////////////////////////////////////////////////////// class PropertyHelper_Hyphen : @@ -280,6 +335,39 @@ public: sal_Int16 GetMinWordLength() const { return nResHyphMinWordLength; } }; +class LNG_DLLPUBLIC PropertyHelper_Hyphenation +{ + PropertyHelper_Hyphen* pInst; + com::sun::star::uno::Reference< com::sun::star::beans::XPropertyChangeListener > xPropHelper; + + // disallow use of copy-constructor and assignment-operator + PropertyHelper_Hyphenation( const PropertyHelper_Hyphen & ); + PropertyHelper_Hyphenation & operator = ( const PropertyHelper_Hyphen & ); + +public: + PropertyHelper_Hyphenation( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > &rxSource, + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > &rxPropSet); + ~PropertyHelper_Hyphenation(); + + void AddAsPropListener(); + void RemoveAsPropListener(); + void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ); + sal_Int16 GetMinLeading() const; + sal_Int16 GetMinTrailing() const; + sal_Int16 GetMinWordLength() const; + sal_Bool addLinguServiceEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) + throw(::com::sun::star::uno::RuntimeException); + sal_Bool removeLinguServiceEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) + throw(::com::sun::star::uno::RuntimeException); +}; + /////////////////////////////////////////////////////////////////////////// } // namespace linguistic diff --git a/linguistic/inc/linguistic/misc.hxx b/linguistic/inc/linguistic/misc.hxx index 2b49f37858c0..957fbd429b9f 100644 --- a/linguistic/inc/linguistic/misc.hxx +++ b/linguistic/inc/linguistic/misc.hxx @@ -28,7 +28,6 @@ #ifndef _LINGUISTIC_MISC_HXX_ #define _LINGUISTIC_MISC_HXX_ - #include <com/sun/star/uno/Sequence.h> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/beans/PropertyValues.hpp> @@ -47,6 +46,7 @@ #include <unotools/charclass.hxx> #include <osl/thread.h> #include <osl/mutex.hxx> +#include <linguistic/lngdllapi.h> namespace com { namespace sun { namespace star { namespace beans { class XPropertySet; @@ -95,7 +95,7 @@ namespace linguistic /////////////////////////////////////////////////////////////////////////// -::osl::Mutex & GetLinguMutex(); +LNG_DLLPUBLIC ::osl::Mutex& GetLinguMutex(); LocaleDataWrapper & GetLocaleDataWrapper( sal_Int16 nLang ); @@ -124,7 +124,7 @@ sal_Int32 LevDistance( const rtl::OUString &rTxt1, const rtl::OUString &rTxt2 ); ::com::sun::star::lang::Locale CreateLocale( LanguageType eLang ); -LanguageType +LNG_DLLPUBLIC LanguageType LocaleToLanguage( const ::com::sun::star::lang::Locale& rLocale ); ::com::sun::star::lang::Locale& @@ -162,7 +162,7 @@ String GetModulePath( SvtPathOptions::Pathes ePath, sal_Bool bAddAccessDelim = /// @returns an URL for a new and writable dictionary rDicName. /// The URL will point to the path given by 'GetDictionaryWriteablePath' -String GetWritableDictionaryURL( const String &rDicName ); +LNG_DLLPUBLIC String GetWritableDictionaryURL( const String &rDicName ); // looks for the specified file in the list of paths. // In case of multiple occurences only the first found is returned. @@ -171,7 +171,7 @@ String SearchFileInPaths( const String &rFile, const ::com::sun::star::uno:: /////////////////////////////////////////////////////////////////////////// -sal_Int32 GetPosInWordToCheck( const rtl::OUString &rTxt, sal_Int32 nPos ); +LNG_DLLPUBLIC sal_Int32 GetPosInWordToCheck( const rtl::OUString &rTxt, sal_Int32 nPos ); ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenatedWord > @@ -181,8 +181,8 @@ sal_Int32 GetPosInWordToCheck( const rtl::OUString &rTxt, sal_Int32 nPos ) /////////////////////////////////////////////////////////////////////////// -sal_Bool IsUpper( const String &rText, xub_StrLen nPos, xub_StrLen nLen, sal_Int16 nLanguage ); -sal_Bool IsLower( const String &rText, xub_StrLen nPos, xub_StrLen nLen, sal_Int16 nLanguage ); +LNG_DLLPUBLIC sal_Bool IsUpper( const String &rText, xub_StrLen nPos, xub_StrLen nLen, sal_Int16 nLanguage ); +LNG_DLLPUBLIC sal_Bool IsLower( const String &rText, xub_StrLen nPos, xub_StrLen nLen, sal_Int16 nLanguage ); inline sal_Bool IsUpper( const String &rText, sal_Int16 nLanguage ) { return IsUpper( rText, 0, rText.Len(), nLanguage ); } inline sal_Bool IsLower( const String &rText, sal_Int16 nLanguage ) { return IsLower( rText, 0, rText.Len(), nLanguage ); } @@ -192,13 +192,13 @@ String ToUpper( const String &rText, sal_Int16 nLanguage ); String ToTitle( const String &rText, sal_Int16 nLanguage ); sal_Unicode ToLower( const sal_Unicode cChar, sal_Int16 nLanguage ); sal_Unicode ToUpper( const sal_Unicode cChar, sal_Int16 nLanguage ); -sal_Bool HasDigits( const ::rtl::OUString &rText ); -sal_Bool IsNumeric( const String &rText ); +LNG_DLLPUBLIC sal_Bool HasDigits( const ::rtl::OUString &rText ); +LNG_DLLPUBLIC sal_Bool IsNumeric( const String &rText ); /////////////////////////////////////////////////////////////////////////// ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > GetOneInstanceService( const char *pServiceName ); -::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GetLinguProperties(); +LNG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GetLinguProperties(); ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSearchableDictionaryList > GetSearchableDictionaryList(); ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryList > GetDictionaryList(); ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > GetIgnoreAllList(); @@ -220,13 +220,13 @@ sal_Bool IsIgnoreControlChars( const ::com::sun::star::beans::PropertyValues &rP const ::rtl::OUString& rWord, sal_Int16 nLanguage, sal_Bool bSearchPosDics, sal_Bool bSearchSpellEntry ); -sal_uInt8 AddEntryToDic( +LNG_DLLPUBLIC sal_uInt8 AddEntryToDic( ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > &rxDic, const ::rtl::OUString &rWord, sal_Bool bIsNeg, const ::rtl::OUString &rRplcTxt, sal_Int16 nRplcLang, sal_Bool bStripDot = sal_True ); -sal_Bool SaveDictionaries( const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryList > &xDicList ); +LNG_DLLPUBLIC sal_Bool SaveDictionaries( const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryList > &xDicList ); /////////////////////////////////////////////////////////////////////////// // diff --git a/linguistic/inc/linguistic/spelldta.hxx b/linguistic/inc/linguistic/spelldta.hxx index 7ab7cab06b56..5d2c55b162a0 100644 --- a/linguistic/inc/linguistic/spelldta.hxx +++ b/linguistic/inc/linguistic/spelldta.hxx @@ -36,6 +36,7 @@ #include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type #include <cppuhelper/implbase2.hxx> +#include <linguistic/lngdllapi.h> namespace com { namespace sun { namespace star { namespace linguistic2 { @@ -117,6 +118,8 @@ public: // XSetSpellAlternatives virtual void SAL_CALL setAlternatives( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aAlternatives ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setFailureType( ::sal_Int16 nFailureType ) throw (::com::sun::star::uno::RuntimeException); + static com::sun::star::uno::Reference < com::sun::star::linguistic2::XSpellAlternatives > LNG_DLLPUBLIC CreateSpellAlternatives( + const ::rtl::OUString &rWord, sal_Int16 nLang, sal_Int16 nTypeP, const ::com::sun::star::uno::Sequence< ::rtl::OUString > &rAlt ); // non-interface specific functions void SetWordLanguage(const ::rtl::OUString &rWord, sal_Int16 nLang); diff --git a/linguistic/prj/build.lst b/linguistic/prj/build.lst index 0043eaffc6ed..cae9ac8692a6 100644 --- a/linguistic/prj/build.lst +++ b/linguistic/prj/build.lst @@ -1,10 +1,2 @@ lg linguistic : svl xmloff ucbhelper vos comphelper ICU:icu LIBXSLT:libxslt NULL -lg linguistic usr1 - all lg_mkout NULL -lg linguistic\prj get - all lg_prj NULL -lg linguistic\inc nmake - all lg_inc NULL -lg linguistic\source nmake - all lg_src lg_inc NULL - -lg linguistic\qa\unoapi nmake - all lg_qa_unoapi NULL - -# could be we need a Japanese office version -# lg linguistic\qa\complex\linguistic nmake - all lg_qa_complex NULL +lg linguistic\prj nmake - all lg_prj NULL diff --git a/linguistic/prj/d.lst b/linguistic/prj/d.lst index 03237f925764..e69de29bb2d1 100644 --- a/linguistic/prj/d.lst +++ b/linguistic/prj/d.lst @@ -1,13 +0,0 @@ -..\%__SRC%\bin\lng* %_DEST%\bin%_EXT%\lng* -..\%__SRC%\lib\ilng* %_DEST%\lib%_EXT%\ilng* -..\%__SRC%\lib\liblng.a %_DEST%\lib%_EXT%\liblng.a -..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib -..\%__SRC%\lib\liblng*.so %_DEST%\lib%_EXT%\liblng*.so - -..\xml\*.xml %_DEST%\xml%_EXT%\*.xml - -mkdir: %_DEST%\inc%_EXT%\linguistic -..\inc\linguistic\*.hxx %_DEST%\inc%_EXT%\linguistic\*.hxx - -..\%__SRC%\misc\lng.component %_DEST%\xml%_EXT%\lng.component - diff --git a/linguistic/inc/makefile.mk b/linguistic/prj/makefile.mk index fa5aad7b0a40..88cd9dfe08b8 100644 --- a/linguistic/inc/makefile.mk +++ b/linguistic/prj/makefile.mk @@ -24,24 +24,17 @@ # for a copy of the LGPLv3 License. # #************************************************************************* -PRJ=.. - -PRJNAME=linguistic -TARGET=inc - -# --- Settings ----------------------------------------------------- -.INCLUDE : settings.mk - -# --- Files -------------------------------------------------------- -# --- Targets ------------------------------------------------------- +PRJ=.. +TARGET=prj -.INCLUDE : target.mk +.INCLUDE : settings.mk -.IF "$(ENABLE_PCH)"!="" -ALLTAR : \ - $(SLO)$/precompiled.pch \ - $(SLO)$/precompiled_ex.pch - -.ENDIF # "$(ENABLE_PCH)"!="" +.IF "$(VERBOSE)"!="" +VERBOSEFLAG := +.ELSE +VERBOSEFLAG := -s +.ENDIF +all: + cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog diff --git a/linguistic/qa/unoapi/Test.java b/linguistic/qa/unoapi/Test.java index 4a96418255ff..eca9622d5247 100644 --- a/linguistic/qa/unoapi/Test.java +++ b/linguistic/qa/unoapi/Test.java @@ -27,6 +27,7 @@ package org.openoffice.linguistic.qa.unoapi; import org.openoffice.Runner; import org.openoffice.test.OfficeConnection; +import org.openoffice.test.Argument; import static org.junit.Assert.*; public final class Test { @@ -43,8 +44,8 @@ public final class Test { @org.junit.Test public void test() { assertTrue( Runner.run( - "-sce", "lng.sce", "-xcl", "knownissues.xcl", "-cs", - connection.getDescription())); + "-sce", Argument.get("sce"), "-xcl", Argument.get("xcl"), "-tdoc", + Argument.get("tdoc"), "-cs", connection.getDescription())); } private final OfficeConnection connection = new OfficeConnection(); diff --git a/linguistic/source/grammarchecker.cxx b/linguistic/source/grammarchecker.cxx deleted file mode 100644 index 6f4b1c5d3da8..000000000000 --- a/linguistic/source/grammarchecker.cxx +++ /dev/null @@ -1,305 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "precompiled_linguistic.hxx" - -#include <sal/config.h> -#include <com/sun/star/uno/XComponentContext.hpp> -#include <cppuhelper/implbase1.hxx> -#include <com/sun/star/linguistic2/XGrammarChecker.hpp> -#include <com/sun/star/i18n/XBreakIterator.hpp> -#include <cppuhelper/implbase4.hxx> -#include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include "linguistic/misc.hxx" -#include "defs.hxx" -#include <cppuhelper/factory.hxx> -#include <com/sun/star/registry/XRegistryKey.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> - -#include <cppuhelper/interfacecontainer.h> -#include <com/sun/star/container/XContentEnumerationAccess.hpp> -#include <com/sun/star/container/XEnumeration.hpp> -#include <com/sun/star/linguistic2/XSupportedLocales.hpp> -#include <com/sun/star/linguistic2/SingleGrammarError.hpp> -#include <com/sun/star/linguistic2/GrammarCheckingResult.hpp> -#include "lngopt.hxx" -#include <comphelper/extract.hxx> -#include <unotools/processfactory.hxx> -#include <map> -#include <com/sun/star/text/TextMarkupType.hpp> - -#include "grammarchecker.hxx" - -using namespace ::utl; -using namespace ::rtl; -using namespace ::com::sun::star; - -//////////////////////////////////////////////////////////// - -GrammarChecker::GrammarChecker( /*uno::Reference< uno::XComponentContext > const & context*/ ) - /*m_xContext(context)*/ -{} - -GrammarChecker::~GrammarChecker() -{ -} - - -sal_Bool SAL_CALL GrammarChecker::isSpellChecker() throw (uno::RuntimeException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); - return sal_False; -} - - -sal_Bool SAL_CALL GrammarChecker::hasLocale( const lang::Locale & aLocale ) throw (uno::RuntimeException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); - (void) aLocale; - return sal_False; -} - -uno::Sequence< lang::Locale > SAL_CALL GrammarChecker::getLocales( ) throw (uno::RuntimeException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); - return uno::Sequence< lang::Locale >(); -} - - -void SAL_CALL GrammarChecker::startDocument(sal_Int32 nDocId) - throw (uno::RuntimeException, lang::IllegalArgumentException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); - (void) nDocId; -} - -void SAL_CALL GrammarChecker::startParagraph(sal_Int32 nDocId) - throw (uno::RuntimeException, lang::IllegalArgumentException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); - (void) nDocId; -} - -void SAL_CALL GrammarChecker::endParagraph( sal_Int32 nDocId ) - throw (uno::RuntimeException, lang::IllegalArgumentException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); - (void) nDocId; -} - -void SAL_CALL GrammarChecker::endDocument(sal_Int32 nDocId) - throw (uno::RuntimeException, lang::IllegalArgumentException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); - (void) nDocId; -} - -linguistic2::GrammarCheckingResult SAL_CALL GrammarChecker::doGrammarChecking( - sal_Int32 nDocId, - const rtl::OUString& rText, - const lang::Locale& rLocale, - sal_Int32 nStartOfSentencePos, - sal_Int32 nSuggestedSentenceEndPos, - const uno::Sequence< ::sal_Int32 >& rLanguagePortions, - const uno::Sequence< lang::Locale >& rLanguagePortionsLocales ) - throw (lang::IllegalArgumentException, uno::RuntimeException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); - - (void) rLanguagePortions; - (void) rLanguagePortionsLocales; - - linguistic2::GrammarCheckingResult aRes; - aRes.nDocumentId = nDocId; - aRes.aText = rText; - aRes.aLocale = rLocale; - aRes.nEndOfSentencePos = nSuggestedSentenceEndPos; - aRes.xGrammarChecker = this; - aRes.aGrammarErrors = GrammarCheckingInDummy( nDocId, rText, rLocale, nStartOfSentencePos, nSuggestedSentenceEndPos );; - - return aRes; -} - -uno::Sequence< linguistic2::SingleGrammarError > GrammarChecker::GrammarCheckingInDummy( - sal_Int32 nDocId, - const OUString & rFlatParaText, - const lang::Locale & rLocale, - sal_Int32 nStartOfSentencePos, - sal_Int32 nSuggestedSentenceEndPos ) -{ - (void) nDocId; - (void) rFlatParaText; - (void) rLocale; - (void) nStartOfSentencePos; - (void) nSuggestedSentenceEndPos; - - - typedef std::map< OUString, uno::Sequence<OUString> > Error_t; - Error_t aError; - uno::Sequence< OUString > aSuggestion(1); - OUString *pSeggestion = aSuggestion.getArray(); - pSeggestion[0] = OUString::createFromAscii("Modified"); - - aError[OUString::createFromAscii("GrammarError")] = aSuggestion; - aError[OUString::createFromAscii("Grammar Error")] = aSuggestion; - - typedef std::vector< linguistic2::SingleGrammarError> ErrorVector_t; - ErrorVector_t aErrorVector; - - OUString aText = rFlatParaText.copy( nStartOfSentencePos, nSuggestedSentenceEndPos - nStartOfSentencePos ); - sal_Int32 nIndexOf = 0; - for(Error_t::const_iterator it = aError.begin(); it != aError.end(); ++it) - { - - while(nIndexOf >= 0) - { - nIndexOf=aText.indexOf(it->first, nIndexOf); - if(nIndexOf > -1) - { - //error found - linguistic2::SingleGrammarError aErr; - aErr.nErrorStart = nIndexOf + nStartOfSentencePos; - nIndexOf += it->first.getLength(); - aErr.nErrorLength = it->first.getLength(); - aErr.nErrorType = text::TextMarkupType::GRAMMAR; - aErr.nErrorLevel = 0; - aErr.aShortComment = OUString(); - aErr.aFullComment = OUString(); - aErr.aNewLocale = rLocale; - aErr.aSuggestions = it->second; - - aErrorVector.push_back( aErr ); - } - } - nIndexOf = 0; - } - - sal_Int32 nCount = aErrorVector.size(); - uno::Sequence< linguistic2::SingleGrammarError > aErrors( nCount ); - if( nCount > 0 ) - { - linguistic2::SingleGrammarError* pErrors = aErrors.getArray(); - for (sal_Int32 i=0; i < nCount; ++i) - { - pErrors[i] = aErrorVector[i]; - } - } - return aErrors; -} - - -sal_Bool SAL_CALL GrammarChecker::hasOptionsDialog( ) throw (uno::RuntimeException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); - return sal_False; -} - -void SAL_CALL GrammarChecker::runOptionsDialog() - throw (uno::RuntimeException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); -} - -void SAL_CALL GrammarChecker::dispose( ) throw (uno::RuntimeException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); -} - -void SAL_CALL GrammarChecker::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) - throw (uno::RuntimeException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); - (void) xListener; -} - -void SAL_CALL GrammarChecker::removeEventListener( const uno::Reference< lang::XEventListener >& xListener ) - throw (uno::RuntimeException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); - (void) xListener; -} - -sal_Bool SAL_CALL GrammarChecker::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); - - uno::Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); - for( sal_Int32 i = 0; i < aSNL.getLength(); ++i ) - if( pArray[i] == ServiceName ) - return sal_True; - return sal_False; -} - -uno::Sequence< OUString > GrammarChecker::getSupportedServiceNames_Static( ) throw() -{ - //osl::Guard< osl::Mutex > aGuard(GetMutex()); - - uno::Sequence< OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich - aSNS.getArray()[0] = A2OU( "com.sun.star.linguistic2.GrammarChecker" );//SN_LINGU_SERVCICE_MANAGER - return aSNS; -} - -uno::Sequence< OUString > SAL_CALL GrammarChecker::getSupportedServiceNames( ) throw(uno::RuntimeException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); - return getSupportedServiceNames_Static(); -} - -OUString SAL_CALL GrammarChecker::getImplementationName( ) throw(uno::RuntimeException) -{ - osl::Guard< osl::Mutex > aGuard(GetMutex()); - return getImplementationName_Static(); -} - -uno::Reference< uno::XInterface > SAL_CALL GrammarChecker_CreateInstance( - const uno::Reference< lang::XMultiServiceFactory > & /*rSMgr*/ ) - throw(uno::Exception) -{ - uno::Reference< uno::XInterface > xService = (cppu::OWeakObject*) new GrammarChecker; - return xService; -} - -void * SAL_CALL GrammarChecker_getFactory( const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager, void * /*pRegistryKey*/ ) -{ - - void * pRet = 0; - if ( !GrammarChecker::getImplementationName_Static().compareToAscii( pImplName ) ) - { - uno::Reference< lang::XSingleServiceFactory > xFactory = - cppu::createOneInstanceFactory( - pServiceManager, - GrammarChecker::getImplementationName_Static(), - GrammarChecker_CreateInstance, - GrammarChecker::getSupportedServiceNames_Static()); - // acquire, because we return an interface pointer instead of a reference - xFactory->acquire(); - pRet = xFactory.get(); - } - return pRet; -} - diff --git a/linguistic/source/grammarchecker.hxx b/linguistic/source/grammarchecker.hxx deleted file mode 100644 index 8eee8f4c93f9..000000000000 --- a/linguistic/source/grammarchecker.hxx +++ /dev/null @@ -1,108 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _LINGUISTIC_GRAMMARCHECKER_HXX_ -#define _LINGUISTIC_GRAMMARCHECKER_HXX_ - - -#include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/linguistic2/XGrammarChecker.hpp> -#include <com/sun/star/linguistic2/SingleGrammarError.hpp> -#include <com/sun/star/linguistic2/XSupportedLocales.hpp> - -#include <cppuhelper/implbase3.hxx> -#include <cppuhelper/interfacecontainer.h> - -#include <map> - - -class GrammarChecker: - public cppu::WeakImplHelper3 - < - ::com::sun::star::linguistic2::XGrammarChecker, - ::com::sun::star::lang::XComponent, - ::com::sun::star::lang::XServiceInfo - > -{ -// com::sun::star::uno::Reference< uno::XComponentContext > m_xContext; - - // disallow use of copy c-tor and assignment operator - GrammarChecker( const GrammarChecker & ); - GrammarChecker & operator = ( const GrammarChecker & ); - -public: - explicit GrammarChecker( /* uno::Reference< uno::XComponentContext > const & rXContext */ ); - virtual ~GrammarChecker(); - - // XSupportedLocales - virtual ::sal_Bool SAL_CALL hasLocale( const ::com::sun::star::lang::Locale & aLocale) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > SAL_CALL getLocales( ) throw ( ::com::sun::star::uno::RuntimeException ); - - // XGrammarChecker - virtual ::sal_Bool SAL_CALL isSpellChecker( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL startDocument( ::sal_Int32 nDocId ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL startParagraph( ::sal_Int32 nDocId ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL endParagraph( ::sal_Int32 nDocId ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL endDocument( ::sal_Int32 nDocId ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::linguistic2::GrammarCheckingResult SAL_CALL doGrammarChecking( ::sal_Int32 nDocId, const ::rtl::OUString& aText, const ::com::sun::star::lang::Locale& aLocale, ::sal_Int32 nStartOfSentencePos, ::sal_Int32 nSuggestedEndOfSentencePos, const ::com::sun::star::uno::Sequence< ::sal_Int32 >& aLanguagePortions, const ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale >& aLanguagePortionsLocales ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL hasOptionsDialog( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL runOptionsDialog( ) throw (::com::sun::star::uno::RuntimeException); - - // XComponent - virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); - - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); - - static inline ::rtl::OUString getImplementationName_Static(); - static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw(); - - ::com::sun::star::uno::Sequence< ::com::sun::star::linguistic2::SingleGrammarError > GrammarCheckingInDummy( - ::sal_Int32 nDocId, const ::rtl::OUString &rFlatParaText, const ::com::sun::star::lang::Locale & rLocale, - ::sal_Int32 nStartOfSentencePos, ::sal_Int32 nSuggestedSentenceEndPos ); - - - inline ::osl::Mutex & GetMutex() - { - static osl::Mutex aMutex; - return aMutex; - } -}; - -inline ::rtl::OUString GrammarChecker::getImplementationName_Static() -{ - return A2OU( "com.sun.star.lingu2.GrammarChecker" ); -} - - -#endif - diff --git a/linguistic/source/hyphdta.cxx b/linguistic/source/hyphdta.cxx index 32c755ad7758..b27238c9218e 100644 --- a/linguistic/source/hyphdta.cxx +++ b/linguistic/source/hyphdta.cxx @@ -183,6 +183,22 @@ Sequence< sal_Int16 > SAL_CALL PossibleHyphens::getHyphenationPositions() return aOrigHyphenPos; } +com::sun::star::uno::Reference <com::sun::star::linguistic2::XHyphenatedWord> HyphenatedWord::CreateHyphenatedWord( + const ::rtl::OUString &rWord, sal_Int16 nLang, sal_Int16 nHyphenationPos, + const ::rtl::OUString &rHyphenatedWord, sal_Int16 nHyphenPos ) +{ + return new HyphenatedWord( rWord, nLang, nHyphenationPos, rHyphenatedWord, nHyphenPos ); +} + +com::sun::star::uno::Reference < com::sun::star::linguistic2::XPossibleHyphens > PossibleHyphens::CreatePossibleHyphens + (const ::rtl::OUString &rWord, sal_Int16 nLang, + const ::rtl::OUString &rHyphWord, + const ::com::sun::star::uno::Sequence< sal_Int16 > &rPositions) +{ + return new PossibleHyphens( rWord, nLang, rHyphWord, rPositions ); +} + + /////////////////////////////////////////////////////////////////////////// } // namespace linguistic diff --git a/linguistic/source/lngprophelp.cxx b/linguistic/source/lngprophelp.cxx index 88c5c7829cee..2854a74ae335 100644 --- a/linguistic/source/lngprophelp.cxx +++ b/linguistic/source/lngprophelp.cxx @@ -711,6 +711,161 @@ void PropertyHelper_Hyphen::SetTmpPropVals( const PropertyValues &rPropVals ) } } +PropertyHelper_Thesaurus::PropertyHelper_Thesaurus( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > &rxSource, + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > &rxPropSet ) +{ + pInst = new PropertyHelper_Thes( rxSource, rxPropSet ); + xPropHelper = pInst; +} + +PropertyHelper_Thesaurus::~PropertyHelper_Thesaurus() +{ +} + +void PropertyHelper_Thesaurus::AddAsPropListener() +{ + pInst->AddAsPropListener(); +} + +void PropertyHelper_Thesaurus::RemoveAsPropListener() +{ + pInst->RemoveAsPropListener(); +} + +void PropertyHelper_Thesaurus::SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ) +{ + pInst->SetTmpPropVals( rPropVals ); +} + +PropertyHelper_Hyphenation::PropertyHelper_Hyphenation( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > &rxSource, + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > &rxPropSet) +{ + pInst = new PropertyHelper_Hyphen( rxSource, rxPropSet ); + xPropHelper = pInst; +} + +PropertyHelper_Hyphenation::~PropertyHelper_Hyphenation() +{ +} + +void PropertyHelper_Hyphenation::AddAsPropListener() +{ + pInst->AddAsPropListener(); +} + +void PropertyHelper_Hyphenation::RemoveAsPropListener() +{ + pInst->RemoveAsPropListener(); +} + +void PropertyHelper_Hyphenation::SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ) +{ + pInst->SetTmpPropVals( rPropVals ); +} + +sal_Int16 PropertyHelper_Hyphenation::GetMinLeading() const +{ + return pInst->GetMinLeading(); +} + +sal_Int16 PropertyHelper_Hyphenation::GetMinTrailing() const +{ + return pInst->GetMinTrailing(); +} + +sal_Int16 PropertyHelper_Hyphenation::GetMinWordLength() const +{ + return pInst->GetMinWordLength(); +} + +sal_Bool PropertyHelper_Hyphenation::addLinguServiceEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) + throw(::com::sun::star::uno::RuntimeException) +{ + return pInst->addLinguServiceEventListener( rxListener ); +} + +sal_Bool PropertyHelper_Hyphenation::removeLinguServiceEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) + throw(::com::sun::star::uno::RuntimeException) +{ + return pInst->removeLinguServiceEventListener( rxListener ); +} + +PropertyHelper_Spelling::PropertyHelper_Spelling( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > &rxSource, + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > &rxPropSet ) +{ + pInst = new PropertyHelper_Spell( rxSource, rxPropSet ); + xPropHelper = pInst; +} + +PropertyHelper_Spelling::~PropertyHelper_Spelling() +{ +} + +void PropertyHelper_Spelling::AddAsPropListener() +{ + pInst->AddAsPropListener(); +} + +void PropertyHelper_Spelling::RemoveAsPropListener() +{ + pInst->RemoveAsPropListener(); +} + +void PropertyHelper_Spelling::SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ) +{ + pInst->SetTmpPropVals( rPropVals ); +} + +sal_Int16 PropertyHelper_Spelling::GetMaxNumberOfSuggestions() const +{ + return pInst->GetMaxNumberOfSuggestions(); +} + +sal_Bool PropertyHelper_Spelling::IsSpellUpperCase() const +{ + return pInst->IsSpellUpperCase(); +} + +sal_Bool PropertyHelper_Spelling::IsSpellWithDigits() const +{ + return pInst->IsSpellWithDigits(); +} + +sal_Bool PropertyHelper_Spelling::IsSpellCapitalization() const +{ + return pInst->IsSpellCapitalization(); +} + +sal_Bool PropertyHelper_Spelling::addLinguServiceEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) + throw(::com::sun::star::uno::RuntimeException) +{ + return pInst->addLinguServiceEventListener( rxListener ); +} + +sal_Bool PropertyHelper_Spelling::removeLinguServiceEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) + throw(::com::sun::star::uno::RuntimeException) +{ + return pInst->removeLinguServiceEventListener( rxListener ); +} + + /////////////////////////////////////////////////////////////////////////// } // namespace linguistic diff --git a/linguistic/source/lngreg.cxx b/linguistic/source/lngreg.cxx index 0f6add07b466..1f2ed71824b6 100644 --- a/linguistic/source/lngreg.cxx +++ b/linguistic/source/lngreg.cxx @@ -87,13 +87,13 @@ extern void * SAL_CALL GrammarCheckingIterator_getFactory extern "C" { -void SAL_CALL component_getImplementationEnvironment( +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -void * SAL_CALL component_getFactory( +SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) { void * pRet = diff --git a/linguistic/source/makefile.mk b/linguistic/source/makefile.mk deleted file mode 100644 index 49dedeec3e82..000000000000 --- a/linguistic/source/makefile.mk +++ /dev/null @@ -1,118 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=.. - -PRJNAME=linguistic -TARGET=lng -ENABLE_EXCEPTIONS=sal_True - -#----- Settings --------------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Files -------------------------------------------------------- - -SLOFILES = \ - $(SLO)$/convdiclist.obj\ - $(SLO)$/convdic.obj\ - $(SLO)$/convdicxml.obj\ - $(SLO)$/dicimp.obj\ - $(SLO)$/dlistimp.obj\ - $(SLO)$/hhconvdic.obj\ - $(SLO)$/hyphdsp.obj\ - $(SLO)$/hyphdta.obj\ - $(SLO)$/iprcache.obj\ - $(SLO)$/lngopt.obj\ - $(SLO)$/lngprophelp.obj\ - $(SLO)$/lngreg.obj\ - $(SLO)$/lngsvcmgr.obj\ - $(SLO)$/misc.obj\ - $(SLO)$/misc2.obj\ - $(SLO)$/spelldsp.obj\ - $(SLO)$/spelldta.obj\ - $(SLO)$/thesdsp.obj\ - $(SLO)$/thesdta.obj\ - $(SLO)$/gciterator.obj - -SHL1TARGET= $(TARGET)$(DLLPOSTFIX) - -SHL1STDLIBS= \ - $(CPPULIB) \ - $(CPPUHELPERLIB) \ - $(COMPHELPERLIB) \ - $(VOSLIB) \ - $(TOOLSLIB) \ - $(I18NISOLANGLIB) \ - $(SVLLIB) \ - $(SALLIB) \ - $(XMLOFFLIB) \ - $(UCBHELPERLIB) \ - $(UNOTOOLSLIB) \ - $(ICUUCLIB) - -# build DLL -SHL1LIBS= $(SLB)$/$(TARGET).lib -SHL1DEPN= $(SLB)$/$(TARGET).lib -SHL1DEF= $(MISC)$/$(SHL1TARGET).def -#SHL1VERSIONMAP= $(TARGET).map -SHL1IMPLIB= ilng - -# build DEF file -DEF1NAME =$(SHL1TARGET) -DEF1DEPN =$(MISC)$/$(SHL1TARGET).flt -DEFLIB1NAME =$(TARGET) -DEF1DES =Linguistic main DLL -#DEF1EXPORTFILE= exports.dxp - - -.IF "$(GUI)"=="WNT" -DEF1EXPORT1 = component_getFactory -DEF1EXPORT2 = component_getImplementationEnvironment -.ENDIF - -# --- Targets ------------------------------------------------------ - - -.INCLUDE : target.mk - - -$(MISC)$/$(SHL1TARGET).flt: makefile.mk - @echo ------------------------------ - @echo Making: $@ - @echo lcl > $@ - @echo component >> $@ - @echo __CT >> $@ - - -ALLTAR : $(MISC)/lng.component - -$(MISC)/lng.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ - lng.component - $(XSLTPROC) --nonet --stringparam uri \ - '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ - $(SOLARENV)/bin/createcomponent.xslt lng.component diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx index 158ff9073d56..8bfdd1e609f6 100644 --- a/linguistic/source/spelldta.cxx +++ b/linguistic/source/spelldta.cxx @@ -360,6 +360,16 @@ void SpellAlternatives::SetAlternatives( const Sequence< OUString > &rAlt ) } +com::sun::star::uno::Reference < com::sun::star::linguistic2::XSpellAlternatives > SpellAlternatives::CreateSpellAlternatives( + const ::rtl::OUString &rWord, sal_Int16 nLang, sal_Int16 nTypeP, const ::com::sun::star::uno::Sequence< ::rtl::OUString > &rAlt ) +{ + SpellAlternatives* pAlt = new SpellAlternatives; + pAlt->SetWordLanguage( rWord, nLang ); + pAlt->SetFailureType( nTypeP ); + pAlt->SetAlternatives( rAlt ); + return Reference < XSpellAlternatives >(pAlt); +} + /////////////////////////////////////////////////////////////////////////// } // namespace linguistic |