From 0944bd42777b0657fb64ecc09265e802f0747ff9 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 20 Apr 2010 08:28:42 +0200 Subject: CWS gnumake2: move all delivered linguistic headers to inc/linguistic --- linguistic/inc/hyphdta.hxx | 146 --------------- linguistic/inc/linguistic/hyphdta.hxx | 146 +++++++++++++++ linguistic/inc/linguistic/lngprophelp.hxx | 288 ++++++++++++++++++++++++++++++ linguistic/inc/linguistic/lngprops.hxx | 62 +++++++ linguistic/inc/linguistic/misc.hxx | 269 ++++++++++++++++++++++++++++ linguistic/inc/linguistic/spelldta.hxx | 134 ++++++++++++++ linguistic/inc/lngprophelp.hxx | 288 ------------------------------ linguistic/inc/lngprops.hxx | 62 ------- linguistic/inc/misc.hxx | 269 ---------------------------- linguistic/inc/spelldta.hxx | 134 -------------- linguistic/prj/d.lst | 2 +- linguistic/source/convdic.cxx | 2 +- linguistic/source/convdic.hxx | 2 +- linguistic/source/convdiclist.cxx | 2 +- linguistic/source/convdiclist.hxx | 2 +- linguistic/source/convdicxml.cxx | 2 +- linguistic/source/convdicxml.hxx | 2 +- linguistic/source/dicimp.hxx | 2 +- linguistic/source/dlistimp.hxx | 2 +- linguistic/source/gciterator.cxx | 2 +- linguistic/source/grammarchecker.cxx | 2 +- linguistic/source/hhconvdic.cxx | 2 +- linguistic/source/hhconvdic.hxx | 2 +- linguistic/source/hyphdsp.cxx | 4 +- linguistic/source/hyphdsp.hxx | 2 +- linguistic/source/hyphdta.cxx | 6 +- linguistic/source/iprcache.cxx | 4 +- linguistic/source/lngopt.cxx | 4 +- linguistic/source/lngopt.hxx | 2 +- linguistic/source/lngprophelp.cxx | 6 +- linguistic/source/lngsvcmgr.cxx | 2 +- linguistic/source/lngsvcmgr.hxx | 2 +- linguistic/source/misc.cxx | 6 +- linguistic/source/misc2.cxx | 2 +- linguistic/source/spelldsp.cxx | 4 +- linguistic/source/spelldsp.hxx | 2 +- linguistic/source/spelldta.cxx | 2 +- linguistic/source/thesdsp.cxx | 2 +- linguistic/source/thesdta.cxx | 2 +- linguistic/workben/sprophelp.cxx | 4 +- linguistic/workben/sspellimp.cxx | 4 +- linguistic/workben/sspellimp.hxx | 2 +- 42 files changed, 943 insertions(+), 943 deletions(-) delete mode 100644 linguistic/inc/hyphdta.hxx create mode 100644 linguistic/inc/linguistic/hyphdta.hxx create mode 100644 linguistic/inc/linguistic/lngprophelp.hxx create mode 100644 linguistic/inc/linguistic/lngprops.hxx create mode 100644 linguistic/inc/linguistic/misc.hxx create mode 100644 linguistic/inc/linguistic/spelldta.hxx delete mode 100644 linguistic/inc/lngprophelp.hxx delete mode 100644 linguistic/inc/lngprops.hxx delete mode 100644 linguistic/inc/misc.hxx delete mode 100644 linguistic/inc/spelldta.hxx (limited to 'linguistic') diff --git a/linguistic/inc/hyphdta.hxx b/linguistic/inc/hyphdta.hxx deleted file mode 100644 index 167c11dcc65d..000000000000 --- a/linguistic/inc/hyphdta.hxx +++ /dev/null @@ -1,146 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _LINGUISTIC_HYPHDTA_HXX_ -#define _LINGUISTIC_HYPHDTA_HXX_ - - -#include -#include - -#include - -#include // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include // helper for implementations - - -namespace linguistic -{ - -/////////////////////////////////////////////////////////////////////////// - -class HyphenatedWord : - public cppu::WeakImplHelper1 - < - ::com::sun::star::linguistic2::XHyphenatedWord - > -{ - ::rtl::OUString aWord; - ::rtl::OUString aHyphenatedWord; - INT16 nHyphPos; - INT16 nHyphenationPos; - INT16 nLanguage; - BOOL bIsAltSpelling; - - // disallow copy-constructor and assignment-operator for now - HyphenatedWord(const HyphenatedWord &); - HyphenatedWord & operator = (const HyphenatedWord &); - -public: - HyphenatedWord(const ::rtl::OUString &rWord, INT16 nLang, INT16 nHyphenationPos, - const ::rtl::OUString &rHyphenatedWord, INT16 nHyphenPos ); - virtual ~HyphenatedWord(); - - // XHyphenatedWord - virtual ::rtl::OUString SAL_CALL - getWord() - throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::lang::Locale SAL_CALL - getLocale() - throw(::com::sun::star::uno::RuntimeException); - virtual sal_Int16 SAL_CALL - getHyphenationPos() - throw(::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL - getHyphenatedWord() - throw(::com::sun::star::uno::RuntimeException); - virtual sal_Int16 SAL_CALL - getHyphenPos() - throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL - isAlternativeSpelling() - throw(::com::sun::star::uno::RuntimeException); - - ::rtl::OUString GetWord() { return aWord; } - ::rtl::OUString GetHyphenatedWord() { return aHyphenatedWord; } - INT16 GetLanguage() { return nLanguage; } - void SetWord( ::rtl::OUString &rTxt ) { aWord = rTxt; } - void SetHyphenatedWord( ::rtl::OUString &rTxt ) { aHyphenatedWord = rTxt; } - void SetLanguage( INT16 nLang ) { nLanguage = nLang; } -}; - - -/////////////////////////////////////////////////////////////////////////// - -class PossibleHyphens : - public cppu::WeakImplHelper1 - < - ::com::sun::star::linguistic2::XPossibleHyphens - > -{ - ::rtl::OUString aWord; - ::rtl::OUString aWordWithHyphens; - ::com::sun::star::uno::Sequence< INT16 > aOrigHyphenPos; - INT16 nLanguage; - - // disallow copy-constructor and assignment-operator for now - PossibleHyphens(const PossibleHyphens &); - PossibleHyphens & operator = (const PossibleHyphens &); - -public: - PossibleHyphens(const ::rtl::OUString &rWord, INT16 nLang, - const ::rtl::OUString &rHyphWord, - const ::com::sun::star::uno::Sequence< INT16 > &rPositions); - virtual ~PossibleHyphens(); - - // XPossibleHyphens - virtual ::rtl::OUString SAL_CALL - getWord() - throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::lang::Locale SAL_CALL - getLocale() - throw(::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL - getPossibleHyphens() - throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL - getHyphenationPositions() - throw(::com::sun::star::uno::RuntimeException); - - ::rtl::OUString GetWord() { return aWord; } - INT16 GetLanguage() { return nLanguage; } - void SetWord( ::rtl::OUString &rTxt ) { aWord = rTxt; } - void SetLanguage( INT16 nLang ) { nLanguage = nLang; } -}; - - -/////////////////////////////////////////////////////////////////////////// - -} // namespace linguistic - -#endif - diff --git a/linguistic/inc/linguistic/hyphdta.hxx b/linguistic/inc/linguistic/hyphdta.hxx new file mode 100644 index 000000000000..167c11dcc65d --- /dev/null +++ b/linguistic/inc/linguistic/hyphdta.hxx @@ -0,0 +1,146 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _LINGUISTIC_HYPHDTA_HXX_ +#define _LINGUISTIC_HYPHDTA_HXX_ + + +#include +#include + +#include + +#include // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include // helper for implementations + + +namespace linguistic +{ + +/////////////////////////////////////////////////////////////////////////// + +class HyphenatedWord : + public cppu::WeakImplHelper1 + < + ::com::sun::star::linguistic2::XHyphenatedWord + > +{ + ::rtl::OUString aWord; + ::rtl::OUString aHyphenatedWord; + INT16 nHyphPos; + INT16 nHyphenationPos; + INT16 nLanguage; + BOOL bIsAltSpelling; + + // disallow copy-constructor and assignment-operator for now + HyphenatedWord(const HyphenatedWord &); + HyphenatedWord & operator = (const HyphenatedWord &); + +public: + HyphenatedWord(const ::rtl::OUString &rWord, INT16 nLang, INT16 nHyphenationPos, + const ::rtl::OUString &rHyphenatedWord, INT16 nHyphenPos ); + virtual ~HyphenatedWord(); + + // XHyphenatedWord + virtual ::rtl::OUString SAL_CALL + getWord() + throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::lang::Locale SAL_CALL + getLocale() + throw(::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL + getHyphenationPos() + throw(::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL + getHyphenatedWord() + throw(::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL + getHyphenPos() + throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL + isAlternativeSpelling() + throw(::com::sun::star::uno::RuntimeException); + + ::rtl::OUString GetWord() { return aWord; } + ::rtl::OUString GetHyphenatedWord() { return aHyphenatedWord; } + INT16 GetLanguage() { return nLanguage; } + void SetWord( ::rtl::OUString &rTxt ) { aWord = rTxt; } + void SetHyphenatedWord( ::rtl::OUString &rTxt ) { aHyphenatedWord = rTxt; } + void SetLanguage( INT16 nLang ) { nLanguage = nLang; } +}; + + +/////////////////////////////////////////////////////////////////////////// + +class PossibleHyphens : + public cppu::WeakImplHelper1 + < + ::com::sun::star::linguistic2::XPossibleHyphens + > +{ + ::rtl::OUString aWord; + ::rtl::OUString aWordWithHyphens; + ::com::sun::star::uno::Sequence< INT16 > aOrigHyphenPos; + INT16 nLanguage; + + // disallow copy-constructor and assignment-operator for now + PossibleHyphens(const PossibleHyphens &); + PossibleHyphens & operator = (const PossibleHyphens &); + +public: + PossibleHyphens(const ::rtl::OUString &rWord, INT16 nLang, + const ::rtl::OUString &rHyphWord, + const ::com::sun::star::uno::Sequence< INT16 > &rPositions); + virtual ~PossibleHyphens(); + + // XPossibleHyphens + virtual ::rtl::OUString SAL_CALL + getWord() + throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::lang::Locale SAL_CALL + getLocale() + throw(::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL + getPossibleHyphens() + throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL + getHyphenationPositions() + throw(::com::sun::star::uno::RuntimeException); + + ::rtl::OUString GetWord() { return aWord; } + INT16 GetLanguage() { return nLanguage; } + void SetWord( ::rtl::OUString &rTxt ) { aWord = rTxt; } + void SetLanguage( INT16 nLang ) { nLanguage = nLang; } +}; + + +/////////////////////////////////////////////////////////////////////////// + +} // namespace linguistic + +#endif + diff --git a/linguistic/inc/linguistic/lngprophelp.hxx b/linguistic/inc/linguistic/lngprophelp.hxx new file mode 100644 index 000000000000..18d125af560e --- /dev/null +++ b/linguistic/inc/linguistic/lngprophelp.hxx @@ -0,0 +1,288 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _LINGUISTIC_LNGPROPHELP_HXX_ +#define _LINGUISTIC_LNGPROPHELP_HXX_ + +#include + +#include +#include +#include +#include +#include + +#include + +namespace com { namespace sun { namespace star { namespace beans { + class XPropertySet; +}}}} + +namespace com { namespace sun { namespace star { namespace linguistic2 { + struct LinguServiceEvent; +}}}} + + +namespace linguistic +{ + +/////////////////////////////////////////////////////////////////////////// +// PropertyChgHelper +// Base class for all XPropertyChangeListener members of the +// various lingu services. + + +// Flags for type of events allowed to be launched +#define AE_SPELLCHECKER 1 +#define AE_HYPHENATOR 2 +//#define AE_THESAURUS 4 + +typedef cppu::WeakImplHelper2 +< + ::com::sun::star::beans::XPropertyChangeListener, + ::com::sun::star::linguistic2::XLinguServiceEventBroadcaster +> PropertyChgHelperBase; + +class PropertyChgHelper : + public PropertyChgHelperBase +{ + ::com::sun::star::uno::Sequence< ::rtl::OUString > aPropNames; + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > xMyEvtObj; + ::cppu::OInterfaceContainerHelper aLngSvcEvtListeners; + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > xPropSet; + + int nEvtFlags; // flags for event types allowed to be launched + + // default values + BOOL bIsIgnoreControlCharacters; + BOOL bIsUseDictionaryList; + + // return values, will be set to default value or current temporary value + BOOL bResIsIgnoreControlCharacters; + BOOL bResIsUseDictionaryList; + + + // disallow use of copy-constructor and assignment-operator + PropertyChgHelper( const PropertyChgHelper & ); + PropertyChgHelper & operator = ( const PropertyChgHelper & ); + +protected: + virtual void SetDefaultValues(); + virtual void GetCurrentValues(); + + ::com::sun::star::uno::Sequence< ::rtl::OUString > & + GetPropNames() { return aPropNames; } + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & + GetPropSet() { return xPropSet; } + + void AddPropNames( const char *pNewNames[], INT32 nCount ); + + virtual BOOL propertyChange_Impl( + const ::com::sun::star::beans::PropertyChangeEvent& rEvt ); + +public: + PropertyChgHelper( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > &rxSource, + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > &rxPropSet, + int nAllowedEvents ); + virtual ~PropertyChgHelper(); + + virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ); + + // XEventListener + virtual void SAL_CALL + disposing( const ::com::sun::star::lang::EventObject& rSource ) + throw(::com::sun::star::uno::RuntimeException); + + // XPropertyChangeListener + virtual void SAL_CALL + propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt ) + throw(::com::sun::star::uno::RuntimeException); + + // XLinguServiceEventBroadcaster + virtual sal_Bool SAL_CALL + addLinguServiceEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) + throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL + removeLinguServiceEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) + throw(::com::sun::star::uno::RuntimeException); + + // non-UNO functions + void AddAsPropListener(); + void RemoveAsPropListener(); + void LaunchEvent( + const ::com::sun::star::linguistic2::LinguServiceEvent& rEvt ); + + const ::com::sun::star::uno::Sequence< ::rtl::OUString > & + GetPropNames() const { return aPropNames; } + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & + GetPropSet() const { return xPropSet; } + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > & + GetEvtObj() const { return xMyEvtObj; } + + BOOL IsIgnoreControlCharacters() const { return bResIsIgnoreControlCharacters; } + BOOL IsUseDictionaryList() const { return bResIsUseDictionaryList; } +}; + + +/////////////////////////////////////////////////////////////////////////// + +class PropertyHelper_Thes : + public PropertyChgHelper +{ + // disallow use of copy-constructor and assignment-operator + PropertyHelper_Thes( const PropertyHelper_Thes & ); + PropertyHelper_Thes & operator = ( const PropertyHelper_Thes & ); + +public: + PropertyHelper_Thes( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > &rxSource, + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > &rxPropSet ); + virtual ~PropertyHelper_Thes(); + + // XPropertyChangeListener + virtual void SAL_CALL + propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt ) + throw(::com::sun::star::uno::RuntimeException); +}; + +/////////////////////////////////////////////////////////////////////////// + +class PropertyHelper_Spell : + public PropertyChgHelper +{ + // default values + BOOL bIsSpellUpperCase; + BOOL bIsSpellWithDigits; + BOOL bIsSpellCapitalization; + + // return values, will be set to default value or current temporary value + INT16 nResMaxNumberOfSuggestions; // special value that is not part of the property set and thus needs to be handled differently + BOOL bResIsSpellUpperCase; + BOOL bResIsSpellWithDigits; + BOOL bResIsSpellCapitalization; + + + // disallow use of copy-constructor and assignment-operator + PropertyHelper_Spell( const PropertyHelper_Spell & ); + PropertyHelper_Spell & operator = ( const PropertyHelper_Spell & ); + +protected: + // PropertyChgHelper + virtual void SetDefaultValues(); + virtual void GetCurrentValues(); + virtual BOOL propertyChange_Impl( + const ::com::sun::star::beans::PropertyChangeEvent& rEvt ); + +public: + PropertyHelper_Spell( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > &rxSource, + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > &rxPropSet ); + virtual ~PropertyHelper_Spell(); + + virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ); + + // XPropertyChangeListener + virtual void SAL_CALL + propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt ) + throw(::com::sun::star::uno::RuntimeException); + + virtual INT16 GetDefaultNumberOfSuggestions() const; + + INT16 GetMaxNumberOfSuggestions() const { return nResMaxNumberOfSuggestions; } + BOOL IsSpellUpperCase() const { return bResIsSpellUpperCase; } + BOOL IsSpellWithDigits() const { return bResIsSpellWithDigits; } + BOOL IsSpellCapitalization() const { return bResIsSpellCapitalization; } +}; + +/////////////////////////////////////////////////////////////////////////// + +class PropertyHelper_Hyphen : + public PropertyChgHelper +{ + // default values + INT16 nHyphMinLeading, + nHyphMinTrailing, + nHyphMinWordLength; + + // return values, will be set to default value or current temporary value + INT16 nResHyphMinLeading, + nResHyphMinTrailing, + nResHyphMinWordLength; + + // disallow use of copy-constructor and assignment-operator + PropertyHelper_Hyphen( const PropertyHelper_Hyphen & ); + PropertyHelper_Hyphen & operator = ( const PropertyHelper_Hyphen & ); + +protected: + // PropertyChgHelper + virtual void SetDefaultValues(); + virtual void GetCurrentValues(); + virtual BOOL propertyChange_Impl( + const ::com::sun::star::beans::PropertyChangeEvent& rEvt ); + +public: + PropertyHelper_Hyphen( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > &rxSource, + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > &rxPropSet); + virtual ~PropertyHelper_Hyphen(); + + virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ); + + // XPropertyChangeListener + virtual void SAL_CALL + propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt ) + throw(::com::sun::star::uno::RuntimeException); + + INT16 GetMinLeading() const { return nResHyphMinLeading; } + INT16 GetMinTrailing() const { return nResHyphMinTrailing; } + INT16 GetMinWordLength() const { return nResHyphMinWordLength; } +}; + +/////////////////////////////////////////////////////////////////////////// + +} // namespace linguistic + +#endif + diff --git a/linguistic/inc/linguistic/lngprops.hxx b/linguistic/inc/linguistic/lngprops.hxx new file mode 100644 index 000000000000..68f599d50a8c --- /dev/null +++ b/linguistic/inc/linguistic/lngprops.hxx @@ -0,0 +1,62 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _LINGUISTIC_LNGPROPS_HHX_ +#define _LINGUISTIC_LNGPROPS_HHX_ + +#include + +// maximal number of suggestions to be returned in spelling context-menu +// (may not include results added by looking up user dictionaries) +#define UPN_MAX_NUMBER_OF_SUGGESTIONS "MaxNumberOfSuggestions" + +// WIDs for property names +//!! Don't change values! They are used as the property handles in +//!! the service description +#define WID_IS_GERMAN_PRE_REFORM UPH_IS_GERMAN_PRE_REFORM /*! deprecated !*/ +#define WID_IS_USE_DICTIONARY_LIST UPH_IS_USE_DICTIONARY_LIST +#define WID_IS_IGNORE_CONTROL_CHARACTERS UPH_IS_IGNORE_CONTROL_CHARACTERS +#define WID_IS_SPELL_UPPER_CASE UPH_IS_SPELL_UPPER_CASE +#define WID_IS_SPELL_WITH_DIGITS UPH_IS_SPELL_WITH_DIGITS +#define WID_IS_SPELL_CAPITALIZATION UPH_IS_SPELL_CAPITALIZATION +#define WID_HYPH_MIN_LEADING UPH_HYPH_MIN_LEADING +#define WID_HYPH_MIN_TRAILING UPH_HYPH_MIN_TRAILING +#define WID_HYPH_MIN_WORD_LENGTH UPH_HYPH_MIN_WORD_LENGTH +#define WID_DEFAULT_LOCALE UPH_DEFAULT_LOCALE +#define WID_IS_SPELL_AUTO UPH_IS_SPELL_AUTO +#define WID_IS_SPELL_HIDE UPH_IS_SPELL_HIDE /*! deprecated !*/ +#define WID_IS_SPELL_IN_ALL_LANGUAGES UPH_IS_SPELL_IN_ALL_LANGUAGES /*! deprecated !*/ +#define WID_IS_SPELL_SPECIAL UPH_IS_SPELL_SPECIAL +#define WID_IS_HYPH_AUTO UPH_IS_HYPH_AUTO +#define WID_IS_HYPH_SPECIAL UPH_IS_HYPH_SPECIAL +#define WID_IS_WRAP_REVERSE UPH_IS_WRAP_REVERSE +#define WID_DEFAULT_LANGUAGE UPH_DEFAULT_LANGUAGE +#define WID_DEFAULT_LOCALE_CJK UPH_DEFAULT_LOCALE_CJK +#define WID_DEFAULT_LOCALE_CTL UPH_DEFAULT_LOCALE_CTL + +#endif + diff --git a/linguistic/inc/linguistic/misc.hxx b/linguistic/inc/linguistic/misc.hxx new file mode 100644 index 000000000000..f40a0ae55803 --- /dev/null +++ b/linguistic/inc/linguistic/misc.hxx @@ -0,0 +1,269 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _LINGUISTIC_MISC_HXX_ +#define _LINGUISTIC_MISC_HXX_ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include // helper for implementations +#include +#include +#include +#include +#include +#include + +namespace com { namespace sun { namespace star { namespace beans { + class XPropertySet; + class XFastPropertySet; +}}}} + +namespace com { namespace sun { namespace star { namespace frame { + class XDesktop; +}}}} + +class LocaleDataWrapper; + +/////////////////////////////////////////////////////////////////////////// +#define SN_GRAMMARCHECKER "com.sun.star.linguistic2.Proofreader" +#define SN_GRAMMARCHECKINGITERATOR "com.sun.star.linguistic2.ProofreadingIterator" +#define SN_SPELLCHECKER "com.sun.star.linguistic2.SpellChecker" +#define SN_HYPHENATOR "com.sun.star.linguistic2.Hyphenator" +#define SN_THESAURUS "com.sun.star.linguistic2.Thesaurus" +#define SN_LINGU_SERVCICE_MANAGER "com.sun.star.linguistic2.LinguServiceManager" +#define SN_LINGU_PROPERTIES "com.sun.star.linguistic2.LinguProperties" +#define SN_DICTIONARY_LIST "com.sun.star.linguistic2.DictionaryList" +#define SN_OTHER_LINGU "com.sun.star.linguistic2.OtherLingu" +#define SN_DESKTOP "com.sun.star.frame.Desktop" + + +namespace linguistic +{ + +// ascii to OUString conversion +#define A2OU(x) ::rtl::OUString::createFromAscii( x ) + +/// Flags to be used with the multi-path related functions +/// @see GetDictionaryPaths, GetLinguisticPaths +#define PATH_FLAG_INTERNAL 0x01 +#define PATH_FLAG_USER 0x02 +#define PATH_FLAG_WRITABLE 0x04 +#define PATH_FLAG_ALL (PATH_FLAG_INTERNAL | PATH_FLAG_USER | PATH_FLAG_WRITABLE) + + +// AddEntryToDic return values +#define DIC_ERR_NONE 0 +#define DIC_ERR_FULL 1 +#define DIC_ERR_READONLY 2 +#define DIC_ERR_UNKNOWN 3 +#define DIC_ERR_NOT_EXISTS 4 + +/////////////////////////////////////////////////////////////////////////// + +::osl::Mutex & GetLinguMutex(); + +LocaleDataWrapper & GetLocaleDataWrapper( INT16 nLang ); + +/////////////////////////////////////////////////////////////////////////// + +rtl_TextEncoding GetTextEncoding( INT16 nLanguage ); + +inline ::rtl::OUString BS2OU(const ByteString &rText, rtl_TextEncoding nEnc) +{ + return ::rtl::OUString( rText.GetBuffer(), rText.Len(), nEnc ); +} + +inline ByteString OU2BS(const ::rtl::OUString &rText, rtl_TextEncoding nEnc) +{ + return ByteString( rText.getStr(), nEnc ); +} + +rtl::OUString StripTrailingChars( rtl::OUString &rTxt, sal_Unicode cChar ); + +/////////////////////////////////////////////////////////////////////////// + +sal_Int32 LevDistance( const rtl::OUString &rTxt1, const rtl::OUString &rTxt2 ); + +/////////////////////////////////////////////////////////////////////////// + +::com::sun::star::lang::Locale + CreateLocale( LanguageType eLang ); + +LanguageType + LocaleToLanguage( const ::com::sun::star::lang::Locale& rLocale ); + +::com::sun::star::lang::Locale& + LanguageToLocale( ::com::sun::star::lang::Locale& rLocale, LanguageType eLang ); + +::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > + LangSeqToLocaleSeq( const ::com::sun::star::uno::Sequence< INT16 > &rLangSeq ); + +::com::sun::star::uno::Sequence< INT16 > + LocaleSeqToLangSeq( ::com::sun::star::uno::Sequence< + ::com::sun::star::lang::Locale > &rLocaleSeq ); + +/////////////////////////////////////////////////////////////////////////// + +// checks if file pointed to by rURL is readonly +// and may also check return if such a file exists or not +BOOL IsReadOnly( const String &rURL, BOOL *pbExist = 0 ); + +// checks if a file with the given URL exists +BOOL FileExists( const String &rURL ); + +#ifdef TL_OUTDATED +// returns complete file URL for given filename that is to be searched in +// the specified path +String GetFileURL( SvtPathOptions::Pathes ePath, const String &rFileName ); + +String GetModulePath( SvtPathOptions::Pathes ePath, BOOL bAddAccessDelim = TRUE ); +#endif + +/////////////////////////////////////////////////////////////////////////// + +::rtl::OUString GetDictionaryWriteablePath(); +::com::sun::star::uno::Sequence< ::rtl::OUString > GetDictionaryPaths( sal_Int16 nPathFlags = PATH_FLAG_ALL ); +::com::sun::star::uno::Sequence< ::rtl::OUString > GetLinguisticPaths( sal_Int16 nPathFlags = PATH_FLAG_ALL ); + +/// @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 ); + +// looks for the specified file in the list of paths. +// In case of multiple occurences only the first found is returned. +String SearchFileInPaths( const String &rFile, const ::com::sun::star::uno::Sequence< ::rtl::OUString > &rPaths ); + + +/////////////////////////////////////////////////////////////////////////// + +INT32 GetPosInWordToCheck( const rtl::OUString &rTxt, INT32 nPos ); + +::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XHyphenatedWord > + RebuildHyphensAndControlChars( const rtl::OUString &rOrigWord, + ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XHyphenatedWord > &rxHyphWord ); + +/////////////////////////////////////////////////////////////////////////// + +BOOL IsUpper( const String &rText, xub_StrLen nPos, xub_StrLen nLen, INT16 nLanguage ); +BOOL IsLower( const String &rText, xub_StrLen nPos, xub_StrLen nLen, INT16 nLanguage ); + +inline BOOL IsUpper( const String &rText, INT16 nLanguage ) { return IsUpper( rText, 0, rText.Len(), nLanguage ); } +inline BOOL IsLower( const String &rText, INT16 nLanguage ) { return IsLower( rText, 0, rText.Len(), nLanguage ); } + +String ToLower( const String &rText, INT16 nLanguage ); +String ToUpper( const String &rText, INT16 nLanguage ); +String ToTitle( const String &rText, INT16 nLanguage ); +sal_Unicode ToLower( const sal_Unicode cChar, INT16 nLanguage ); +sal_Unicode ToUpper( const sal_Unicode cChar, INT16 nLanguage ); +BOOL HasDigits( const ::rtl::OUString &rText ); +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(); +::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(); + +/////////////////////////////////////////////////////////////////////////// + +BOOL IsUseDicList( const ::com::sun::star::beans::PropertyValues &rProperties, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > &rxPropSet ); + +BOOL IsIgnoreControlChars( const ::com::sun::star::beans::PropertyValues &rProperties, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > &rxPropSet ); + +::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XDictionaryEntry > + SearchDicList( + const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryList >& rDicList, + const ::rtl::OUString& rWord, INT16 nLanguage, + BOOL bSearchPosDics, BOOL bSearchSpellEntry ); + +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 ); + +/////////////////////////////////////////////////////////////////////////// +// +// AppExitLstnr: +// virtual base class that calls it AtExit function when the application +// (ie the Desktop) is about to terminate +// + +class AppExitListener : + public cppu::WeakImplHelper1 + < + ::com::sun::star::frame::XTerminateListener + > +{ + ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XDesktop > xDesktop; + +public: + AppExitListener(); + virtual ~AppExitListener(); + + virtual void AtExit() = 0; + + void Activate(); + void Deactivate(); + + // XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); + + // XTerminateListener + virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException); +}; + +/////////////////////////////////////////////////////////////////////////// + +} // namespace linguistic + +#endif + diff --git a/linguistic/inc/linguistic/spelldta.hxx b/linguistic/inc/linguistic/spelldta.hxx new file mode 100644 index 000000000000..f4d0f5c660ce --- /dev/null +++ b/linguistic/inc/linguistic/spelldta.hxx @@ -0,0 +1,134 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _LINGUISTIC_SPELLDTA_HXX_ +#define _LINGUISTIC_SPELLDTA_HXX_ + +#include +#include +#include + +#include + +#include // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include + +namespace com { namespace sun { namespace star { + namespace linguistic2 { + class XDictionaryList; + } +} } } + + +namespace linguistic +{ + +/////////////////////////////////////////////////////////////////////////// + +::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XSpellAlternatives > + MergeProposals( + ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XSpellAlternatives > &rxAlt1, + ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XSpellAlternatives > &rxAlt2 ); + +::com::sun::star::uno::Sequence< ::rtl::OUString > + MergeProposalSeqs( + ::com::sun::star::uno::Sequence< ::rtl::OUString > &rAlt1, + ::com::sun::star::uno::Sequence< ::rtl::OUString > &rAlt2, + BOOL bAllowDuplicates ); + +void SeqRemoveNegEntries( + ::com::sun::star::uno::Sequence< ::rtl::OUString > &rSeq, + ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XDictionaryList > &rxDicList, + INT16 nLanguage ); + +BOOL SeqHasEntry( + const ::com::sun::star::uno::Sequence< ::rtl::OUString > &rSeq, + const ::rtl::OUString &rTxt); + +/////////////////////////////////////////////////////////////////////////// + +void SearchSimilarText( const rtl::OUString &rText, INT16 nLanguage, + ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XDictionaryList > &xDicList, + std::vector< rtl::OUString > & rDicListProps ); + +/////////////////////////////////////////////////////////////////////////// + + +class SpellAlternatives : + public cppu::WeakImplHelper2 + < + ::com::sun::star::linguistic2::XSpellAlternatives, + ::com::sun::star::linguistic2::XSetSpellAlternatives + > +{ + ::com::sun::star::uno::Sequence< ::rtl::OUString > aAlt; // list of alternatives, may be empty. + ::rtl::OUString aWord; + INT16 nType; // type of failure + INT16 nLanguage; + + // disallow copy-constructor and assignment-operator for now + SpellAlternatives(const SpellAlternatives &); + SpellAlternatives & operator = (const SpellAlternatives &); + +public: + SpellAlternatives(); + SpellAlternatives(const ::rtl::OUString &rWord, INT16 nLang, INT16 nFailureType, + const ::rtl::OUString &rRplcWord ); + SpellAlternatives(const ::rtl::OUString &rWord, INT16 nLang, INT16 nFailureType, + const ::com::sun::star::uno::Sequence< ::rtl::OUString > &rAlternatives ); + virtual ~SpellAlternatives(); + + // XSpellAlternatives + virtual ::rtl::OUString SAL_CALL getWord( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int16 SAL_CALL getFailureType( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int16 SAL_CALL getAlternativesCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAlternatives( ) throw (::com::sun::star::uno::RuntimeException); + + // 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); + + // non-interface specific functions + void SetWordLanguage(const ::rtl::OUString &rWord, INT16 nLang); + void SetFailureType(INT16 nTypeP); + void SetAlternatives( + const ::com::sun::star::uno::Sequence< ::rtl::OUString > &rAlt ); +}; + + +/////////////////////////////////////////////////////////////////////////// + +} // namespace linguistic + +#endif + diff --git a/linguistic/inc/lngprophelp.hxx b/linguistic/inc/lngprophelp.hxx deleted file mode 100644 index 18d125af560e..000000000000 --- a/linguistic/inc/lngprophelp.hxx +++ /dev/null @@ -1,288 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _LINGUISTIC_LNGPROPHELP_HXX_ -#define _LINGUISTIC_LNGPROPHELP_HXX_ - -#include - -#include -#include -#include -#include -#include - -#include - -namespace com { namespace sun { namespace star { namespace beans { - class XPropertySet; -}}}} - -namespace com { namespace sun { namespace star { namespace linguistic2 { - struct LinguServiceEvent; -}}}} - - -namespace linguistic -{ - -/////////////////////////////////////////////////////////////////////////// -// PropertyChgHelper -// Base class for all XPropertyChangeListener members of the -// various lingu services. - - -// Flags for type of events allowed to be launched -#define AE_SPELLCHECKER 1 -#define AE_HYPHENATOR 2 -//#define AE_THESAURUS 4 - -typedef cppu::WeakImplHelper2 -< - ::com::sun::star::beans::XPropertyChangeListener, - ::com::sun::star::linguistic2::XLinguServiceEventBroadcaster -> PropertyChgHelperBase; - -class PropertyChgHelper : - public PropertyChgHelperBase -{ - ::com::sun::star::uno::Sequence< ::rtl::OUString > aPropNames; - ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface > xMyEvtObj; - ::cppu::OInterfaceContainerHelper aLngSvcEvtListeners; - ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > xPropSet; - - int nEvtFlags; // flags for event types allowed to be launched - - // default values - BOOL bIsIgnoreControlCharacters; - BOOL bIsUseDictionaryList; - - // return values, will be set to default value or current temporary value - BOOL bResIsIgnoreControlCharacters; - BOOL bResIsUseDictionaryList; - - - // disallow use of copy-constructor and assignment-operator - PropertyChgHelper( const PropertyChgHelper & ); - PropertyChgHelper & operator = ( const PropertyChgHelper & ); - -protected: - virtual void SetDefaultValues(); - virtual void GetCurrentValues(); - - ::com::sun::star::uno::Sequence< ::rtl::OUString > & - GetPropNames() { return aPropNames; } - ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > & - GetPropSet() { return xPropSet; } - - void AddPropNames( const char *pNewNames[], INT32 nCount ); - - virtual BOOL propertyChange_Impl( - const ::com::sun::star::beans::PropertyChangeEvent& rEvt ); - -public: - PropertyChgHelper( - const ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface > &rxSource, - ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > &rxPropSet, - int nAllowedEvents ); - virtual ~PropertyChgHelper(); - - virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ); - - // XEventListener - virtual void SAL_CALL - disposing( const ::com::sun::star::lang::EventObject& rSource ) - throw(::com::sun::star::uno::RuntimeException); - - // XPropertyChangeListener - virtual void SAL_CALL - propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt ) - throw(::com::sun::star::uno::RuntimeException); - - // XLinguServiceEventBroadcaster - virtual sal_Bool SAL_CALL - addLinguServiceEventListener( - const ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) - throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL - removeLinguServiceEventListener( - const ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener ) - throw(::com::sun::star::uno::RuntimeException); - - // non-UNO functions - void AddAsPropListener(); - void RemoveAsPropListener(); - void LaunchEvent( - const ::com::sun::star::linguistic2::LinguServiceEvent& rEvt ); - - const ::com::sun::star::uno::Sequence< ::rtl::OUString > & - GetPropNames() const { return aPropNames; } - const ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > & - GetPropSet() const { return xPropSet; } - const ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface > & - GetEvtObj() const { return xMyEvtObj; } - - BOOL IsIgnoreControlCharacters() const { return bResIsIgnoreControlCharacters; } - BOOL IsUseDictionaryList() const { return bResIsUseDictionaryList; } -}; - - -/////////////////////////////////////////////////////////////////////////// - -class PropertyHelper_Thes : - public PropertyChgHelper -{ - // disallow use of copy-constructor and assignment-operator - PropertyHelper_Thes( const PropertyHelper_Thes & ); - PropertyHelper_Thes & operator = ( const PropertyHelper_Thes & ); - -public: - PropertyHelper_Thes( - const ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface > &rxSource, - ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > &rxPropSet ); - virtual ~PropertyHelper_Thes(); - - // XPropertyChangeListener - virtual void SAL_CALL - propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt ) - throw(::com::sun::star::uno::RuntimeException); -}; - -/////////////////////////////////////////////////////////////////////////// - -class PropertyHelper_Spell : - public PropertyChgHelper -{ - // default values - BOOL bIsSpellUpperCase; - BOOL bIsSpellWithDigits; - BOOL bIsSpellCapitalization; - - // return values, will be set to default value or current temporary value - INT16 nResMaxNumberOfSuggestions; // special value that is not part of the property set and thus needs to be handled differently - BOOL bResIsSpellUpperCase; - BOOL bResIsSpellWithDigits; - BOOL bResIsSpellCapitalization; - - - // disallow use of copy-constructor and assignment-operator - PropertyHelper_Spell( const PropertyHelper_Spell & ); - PropertyHelper_Spell & operator = ( const PropertyHelper_Spell & ); - -protected: - // PropertyChgHelper - virtual void SetDefaultValues(); - virtual void GetCurrentValues(); - virtual BOOL propertyChange_Impl( - const ::com::sun::star::beans::PropertyChangeEvent& rEvt ); - -public: - PropertyHelper_Spell( - const ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface > &rxSource, - ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > &rxPropSet ); - virtual ~PropertyHelper_Spell(); - - virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ); - - // XPropertyChangeListener - virtual void SAL_CALL - propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt ) - throw(::com::sun::star::uno::RuntimeException); - - virtual INT16 GetDefaultNumberOfSuggestions() const; - - INT16 GetMaxNumberOfSuggestions() const { return nResMaxNumberOfSuggestions; } - BOOL IsSpellUpperCase() const { return bResIsSpellUpperCase; } - BOOL IsSpellWithDigits() const { return bResIsSpellWithDigits; } - BOOL IsSpellCapitalization() const { return bResIsSpellCapitalization; } -}; - -/////////////////////////////////////////////////////////////////////////// - -class PropertyHelper_Hyphen : - public PropertyChgHelper -{ - // default values - INT16 nHyphMinLeading, - nHyphMinTrailing, - nHyphMinWordLength; - - // return values, will be set to default value or current temporary value - INT16 nResHyphMinLeading, - nResHyphMinTrailing, - nResHyphMinWordLength; - - // disallow use of copy-constructor and assignment-operator - PropertyHelper_Hyphen( const PropertyHelper_Hyphen & ); - PropertyHelper_Hyphen & operator = ( const PropertyHelper_Hyphen & ); - -protected: - // PropertyChgHelper - virtual void SetDefaultValues(); - virtual void GetCurrentValues(); - virtual BOOL propertyChange_Impl( - const ::com::sun::star::beans::PropertyChangeEvent& rEvt ); - -public: - PropertyHelper_Hyphen( - const ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface > &rxSource, - ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > &rxPropSet); - virtual ~PropertyHelper_Hyphen(); - - virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ); - - // XPropertyChangeListener - virtual void SAL_CALL - propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt ) - throw(::com::sun::star::uno::RuntimeException); - - INT16 GetMinLeading() const { return nResHyphMinLeading; } - INT16 GetMinTrailing() const { return nResHyphMinTrailing; } - INT16 GetMinWordLength() const { return nResHyphMinWordLength; } -}; - -/////////////////////////////////////////////////////////////////////////// - -} // namespace linguistic - -#endif - diff --git a/linguistic/inc/lngprops.hxx b/linguistic/inc/lngprops.hxx deleted file mode 100644 index 68f599d50a8c..000000000000 --- a/linguistic/inc/lngprops.hxx +++ /dev/null @@ -1,62 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _LINGUISTIC_LNGPROPS_HHX_ -#define _LINGUISTIC_LNGPROPS_HHX_ - -#include - -// maximal number of suggestions to be returned in spelling context-menu -// (may not include results added by looking up user dictionaries) -#define UPN_MAX_NUMBER_OF_SUGGESTIONS "MaxNumberOfSuggestions" - -// WIDs for property names -//!! Don't change values! They are used as the property handles in -//!! the service description -#define WID_IS_GERMAN_PRE_REFORM UPH_IS_GERMAN_PRE_REFORM /*! deprecated !*/ -#define WID_IS_USE_DICTIONARY_LIST UPH_IS_USE_DICTIONARY_LIST -#define WID_IS_IGNORE_CONTROL_CHARACTERS UPH_IS_IGNORE_CONTROL_CHARACTERS -#define WID_IS_SPELL_UPPER_CASE UPH_IS_SPELL_UPPER_CASE -#define WID_IS_SPELL_WITH_DIGITS UPH_IS_SPELL_WITH_DIGITS -#define WID_IS_SPELL_CAPITALIZATION UPH_IS_SPELL_CAPITALIZATION -#define WID_HYPH_MIN_LEADING UPH_HYPH_MIN_LEADING -#define WID_HYPH_MIN_TRAILING UPH_HYPH_MIN_TRAILING -#define WID_HYPH_MIN_WORD_LENGTH UPH_HYPH_MIN_WORD_LENGTH -#define WID_DEFAULT_LOCALE UPH_DEFAULT_LOCALE -#define WID_IS_SPELL_AUTO UPH_IS_SPELL_AUTO -#define WID_IS_SPELL_HIDE UPH_IS_SPELL_HIDE /*! deprecated !*/ -#define WID_IS_SPELL_IN_ALL_LANGUAGES UPH_IS_SPELL_IN_ALL_LANGUAGES /*! deprecated !*/ -#define WID_IS_SPELL_SPECIAL UPH_IS_SPELL_SPECIAL -#define WID_IS_HYPH_AUTO UPH_IS_HYPH_AUTO -#define WID_IS_HYPH_SPECIAL UPH_IS_HYPH_SPECIAL -#define WID_IS_WRAP_REVERSE UPH_IS_WRAP_REVERSE -#define WID_DEFAULT_LANGUAGE UPH_DEFAULT_LANGUAGE -#define WID_DEFAULT_LOCALE_CJK UPH_DEFAULT_LOCALE_CJK -#define WID_DEFAULT_LOCALE_CTL UPH_DEFAULT_LOCALE_CTL - -#endif - diff --git a/linguistic/inc/misc.hxx b/linguistic/inc/misc.hxx deleted file mode 100644 index f40a0ae55803..000000000000 --- a/linguistic/inc/misc.hxx +++ /dev/null @@ -1,269 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _LINGUISTIC_MISC_HXX_ -#define _LINGUISTIC_MISC_HXX_ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include // helper for implementations -#include -#include -#include -#include -#include -#include - -namespace com { namespace sun { namespace star { namespace beans { - class XPropertySet; - class XFastPropertySet; -}}}} - -namespace com { namespace sun { namespace star { namespace frame { - class XDesktop; -}}}} - -class LocaleDataWrapper; - -/////////////////////////////////////////////////////////////////////////// -#define SN_GRAMMARCHECKER "com.sun.star.linguistic2.Proofreader" -#define SN_GRAMMARCHECKINGITERATOR "com.sun.star.linguistic2.ProofreadingIterator" -#define SN_SPELLCHECKER "com.sun.star.linguistic2.SpellChecker" -#define SN_HYPHENATOR "com.sun.star.linguistic2.Hyphenator" -#define SN_THESAURUS "com.sun.star.linguistic2.Thesaurus" -#define SN_LINGU_SERVCICE_MANAGER "com.sun.star.linguistic2.LinguServiceManager" -#define SN_LINGU_PROPERTIES "com.sun.star.linguistic2.LinguProperties" -#define SN_DICTIONARY_LIST "com.sun.star.linguistic2.DictionaryList" -#define SN_OTHER_LINGU "com.sun.star.linguistic2.OtherLingu" -#define SN_DESKTOP "com.sun.star.frame.Desktop" - - -namespace linguistic -{ - -// ascii to OUString conversion -#define A2OU(x) ::rtl::OUString::createFromAscii( x ) - -/// Flags to be used with the multi-path related functions -/// @see GetDictionaryPaths, GetLinguisticPaths -#define PATH_FLAG_INTERNAL 0x01 -#define PATH_FLAG_USER 0x02 -#define PATH_FLAG_WRITABLE 0x04 -#define PATH_FLAG_ALL (PATH_FLAG_INTERNAL | PATH_FLAG_USER | PATH_FLAG_WRITABLE) - - -// AddEntryToDic return values -#define DIC_ERR_NONE 0 -#define DIC_ERR_FULL 1 -#define DIC_ERR_READONLY 2 -#define DIC_ERR_UNKNOWN 3 -#define DIC_ERR_NOT_EXISTS 4 - -/////////////////////////////////////////////////////////////////////////// - -::osl::Mutex & GetLinguMutex(); - -LocaleDataWrapper & GetLocaleDataWrapper( INT16 nLang ); - -/////////////////////////////////////////////////////////////////////////// - -rtl_TextEncoding GetTextEncoding( INT16 nLanguage ); - -inline ::rtl::OUString BS2OU(const ByteString &rText, rtl_TextEncoding nEnc) -{ - return ::rtl::OUString( rText.GetBuffer(), rText.Len(), nEnc ); -} - -inline ByteString OU2BS(const ::rtl::OUString &rText, rtl_TextEncoding nEnc) -{ - return ByteString( rText.getStr(), nEnc ); -} - -rtl::OUString StripTrailingChars( rtl::OUString &rTxt, sal_Unicode cChar ); - -/////////////////////////////////////////////////////////////////////////// - -sal_Int32 LevDistance( const rtl::OUString &rTxt1, const rtl::OUString &rTxt2 ); - -/////////////////////////////////////////////////////////////////////////// - -::com::sun::star::lang::Locale - CreateLocale( LanguageType eLang ); - -LanguageType - LocaleToLanguage( const ::com::sun::star::lang::Locale& rLocale ); - -::com::sun::star::lang::Locale& - LanguageToLocale( ::com::sun::star::lang::Locale& rLocale, LanguageType eLang ); - -::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > - LangSeqToLocaleSeq( const ::com::sun::star::uno::Sequence< INT16 > &rLangSeq ); - -::com::sun::star::uno::Sequence< INT16 > - LocaleSeqToLangSeq( ::com::sun::star::uno::Sequence< - ::com::sun::star::lang::Locale > &rLocaleSeq ); - -/////////////////////////////////////////////////////////////////////////// - -// checks if file pointed to by rURL is readonly -// and may also check return if such a file exists or not -BOOL IsReadOnly( const String &rURL, BOOL *pbExist = 0 ); - -// checks if a file with the given URL exists -BOOL FileExists( const String &rURL ); - -#ifdef TL_OUTDATED -// returns complete file URL for given filename that is to be searched in -// the specified path -String GetFileURL( SvtPathOptions::Pathes ePath, const String &rFileName ); - -String GetModulePath( SvtPathOptions::Pathes ePath, BOOL bAddAccessDelim = TRUE ); -#endif - -/////////////////////////////////////////////////////////////////////////// - -::rtl::OUString GetDictionaryWriteablePath(); -::com::sun::star::uno::Sequence< ::rtl::OUString > GetDictionaryPaths( sal_Int16 nPathFlags = PATH_FLAG_ALL ); -::com::sun::star::uno::Sequence< ::rtl::OUString > GetLinguisticPaths( sal_Int16 nPathFlags = PATH_FLAG_ALL ); - -/// @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 ); - -// looks for the specified file in the list of paths. -// In case of multiple occurences only the first found is returned. -String SearchFileInPaths( const String &rFile, const ::com::sun::star::uno::Sequence< ::rtl::OUString > &rPaths ); - - -/////////////////////////////////////////////////////////////////////////// - -INT32 GetPosInWordToCheck( const rtl::OUString &rTxt, INT32 nPos ); - -::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XHyphenatedWord > - RebuildHyphensAndControlChars( const rtl::OUString &rOrigWord, - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XHyphenatedWord > &rxHyphWord ); - -/////////////////////////////////////////////////////////////////////////// - -BOOL IsUpper( const String &rText, xub_StrLen nPos, xub_StrLen nLen, INT16 nLanguage ); -BOOL IsLower( const String &rText, xub_StrLen nPos, xub_StrLen nLen, INT16 nLanguage ); - -inline BOOL IsUpper( const String &rText, INT16 nLanguage ) { return IsUpper( rText, 0, rText.Len(), nLanguage ); } -inline BOOL IsLower( const String &rText, INT16 nLanguage ) { return IsLower( rText, 0, rText.Len(), nLanguage ); } - -String ToLower( const String &rText, INT16 nLanguage ); -String ToUpper( const String &rText, INT16 nLanguage ); -String ToTitle( const String &rText, INT16 nLanguage ); -sal_Unicode ToLower( const sal_Unicode cChar, INT16 nLanguage ); -sal_Unicode ToUpper( const sal_Unicode cChar, INT16 nLanguage ); -BOOL HasDigits( const ::rtl::OUString &rText ); -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(); -::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(); - -/////////////////////////////////////////////////////////////////////////// - -BOOL IsUseDicList( const ::com::sun::star::beans::PropertyValues &rProperties, - const ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > &rxPropSet ); - -BOOL IsIgnoreControlChars( const ::com::sun::star::beans::PropertyValues &rProperties, - const ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > &rxPropSet ); - -::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XDictionaryEntry > - SearchDicList( - const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryList >& rDicList, - const ::rtl::OUString& rWord, INT16 nLanguage, - BOOL bSearchPosDics, BOOL bSearchSpellEntry ); - -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 ); - -/////////////////////////////////////////////////////////////////////////// -// -// AppExitLstnr: -// virtual base class that calls it AtExit function when the application -// (ie the Desktop) is about to terminate -// - -class AppExitListener : - public cppu::WeakImplHelper1 - < - ::com::sun::star::frame::XTerminateListener - > -{ - ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XDesktop > xDesktop; - -public: - AppExitListener(); - virtual ~AppExitListener(); - - virtual void AtExit() = 0; - - void Activate(); - void Deactivate(); - - // XEventListener - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); - - // XTerminateListener - virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException); -}; - -/////////////////////////////////////////////////////////////////////////// - -} // namespace linguistic - -#endif - diff --git a/linguistic/inc/spelldta.hxx b/linguistic/inc/spelldta.hxx deleted file mode 100644 index f4d0f5c660ce..000000000000 --- a/linguistic/inc/spelldta.hxx +++ /dev/null @@ -1,134 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _LINGUISTIC_SPELLDTA_HXX_ -#define _LINGUISTIC_SPELLDTA_HXX_ - -#include -#include -#include - -#include - -#include // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include - -namespace com { namespace sun { namespace star { - namespace linguistic2 { - class XDictionaryList; - } -} } } - - -namespace linguistic -{ - -/////////////////////////////////////////////////////////////////////////// - -::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XSpellAlternatives > - MergeProposals( - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XSpellAlternatives > &rxAlt1, - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XSpellAlternatives > &rxAlt2 ); - -::com::sun::star::uno::Sequence< ::rtl::OUString > - MergeProposalSeqs( - ::com::sun::star::uno::Sequence< ::rtl::OUString > &rAlt1, - ::com::sun::star::uno::Sequence< ::rtl::OUString > &rAlt2, - BOOL bAllowDuplicates ); - -void SeqRemoveNegEntries( - ::com::sun::star::uno::Sequence< ::rtl::OUString > &rSeq, - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XDictionaryList > &rxDicList, - INT16 nLanguage ); - -BOOL SeqHasEntry( - const ::com::sun::star::uno::Sequence< ::rtl::OUString > &rSeq, - const ::rtl::OUString &rTxt); - -/////////////////////////////////////////////////////////////////////////// - -void SearchSimilarText( const rtl::OUString &rText, INT16 nLanguage, - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XDictionaryList > &xDicList, - std::vector< rtl::OUString > & rDicListProps ); - -/////////////////////////////////////////////////////////////////////////// - - -class SpellAlternatives : - public cppu::WeakImplHelper2 - < - ::com::sun::star::linguistic2::XSpellAlternatives, - ::com::sun::star::linguistic2::XSetSpellAlternatives - > -{ - ::com::sun::star::uno::Sequence< ::rtl::OUString > aAlt; // list of alternatives, may be empty. - ::rtl::OUString aWord; - INT16 nType; // type of failure - INT16 nLanguage; - - // disallow copy-constructor and assignment-operator for now - SpellAlternatives(const SpellAlternatives &); - SpellAlternatives & operator = (const SpellAlternatives &); - -public: - SpellAlternatives(); - SpellAlternatives(const ::rtl::OUString &rWord, INT16 nLang, INT16 nFailureType, - const ::rtl::OUString &rRplcWord ); - SpellAlternatives(const ::rtl::OUString &rWord, INT16 nLang, INT16 nFailureType, - const ::com::sun::star::uno::Sequence< ::rtl::OUString > &rAlternatives ); - virtual ~SpellAlternatives(); - - // XSpellAlternatives - virtual ::rtl::OUString SAL_CALL getWord( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int16 SAL_CALL getFailureType( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int16 SAL_CALL getAlternativesCount( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAlternatives( ) throw (::com::sun::star::uno::RuntimeException); - - // 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); - - // non-interface specific functions - void SetWordLanguage(const ::rtl::OUString &rWord, INT16 nLang); - void SetFailureType(INT16 nTypeP); - void SetAlternatives( - const ::com::sun::star::uno::Sequence< ::rtl::OUString > &rAlt ); -}; - - -/////////////////////////////////////////////////////////////////////////// - -} // namespace linguistic - -#endif - diff --git a/linguistic/prj/d.lst b/linguistic/prj/d.lst index 01a755e53cc6..c0641294a333 100644 --- a/linguistic/prj/d.lst +++ b/linguistic/prj/d.lst @@ -7,4 +7,4 @@ ..\xml\*.xml %_DEST%\xml%_EXT%\*.xml mkdir: %_DEST%\inc%_EXT%\linguistic -..\inc\*.hxx %_DEST%\inc%_EXT%\linguistic\*.hxx +..\inc\linguistic\*.hxx %_DEST%\inc%_EXT%\linguistic\*.hxx diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index 0b7245eb3019..e7c52b500817 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -66,7 +66,7 @@ #include "convdic.hxx" #include "convdicxml.hxx" -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "defs.hxx" using namespace std; diff --git a/linguistic/source/convdic.hxx b/linguistic/source/convdic.hxx index c0a22da8a1f1..983b06704653 100644 --- a/linguistic/source/convdic.hxx +++ b/linguistic/source/convdic.hxx @@ -38,7 +38,7 @@ #include #include #include -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "defs.hxx" // text conversion dictionary extension diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index c1280fc799b0..86c8e25b787c 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -52,7 +52,7 @@ #include "convdiclist.hxx" #include "convdic.hxx" #include "hhconvdic.hxx" -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "defs.hxx" //using namespace utl; diff --git a/linguistic/source/convdiclist.hxx b/linguistic/source/convdiclist.hxx index d1c0740d991f..dec9103d1d51 100644 --- a/linguistic/source/convdiclist.hxx +++ b/linguistic/source/convdiclist.hxx @@ -36,7 +36,7 @@ #include #include -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "lngopt.hxx" diff --git a/linguistic/source/convdicxml.cxx b/linguistic/source/convdicxml.cxx index f3d56f7024a9..30ced3ca02cb 100644 --- a/linguistic/source/convdicxml.cxx +++ b/linguistic/source/convdicxml.cxx @@ -58,7 +58,7 @@ #include "convdic.hxx" #include "convdicxml.hxx" -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "defs.hxx" using namespace std; diff --git a/linguistic/source/convdicxml.hxx b/linguistic/source/convdicxml.hxx index eca7e9e48ce6..d005d51a4b28 100644 --- a/linguistic/source/convdicxml.hxx +++ b/linguistic/source/convdicxml.hxx @@ -38,7 +38,7 @@ #include #include #include -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "defs.hxx" diff --git a/linguistic/source/dicimp.hxx b/linguistic/source/dicimp.hxx index eca18c2166d3..5952c6ca0247 100644 --- a/linguistic/source/dicimp.hxx +++ b/linguistic/source/dicimp.hxx @@ -40,7 +40,7 @@ #include #include "defs.hxx" -#include "misc.hxx" +#include "linguistic/misc.hxx" /////////////////////////////////////////////////////////////////////////// diff --git a/linguistic/source/dlistimp.hxx b/linguistic/source/dlistimp.hxx index c93cd6b907c6..0674210d8494 100644 --- a/linguistic/source/dlistimp.hxx +++ b/linguistic/source/dlistimp.hxx @@ -41,7 +41,7 @@ #include #include -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "lngopt.hxx" class DicEvtListenerHelper; diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index 6485e6e841b7..7fbeecad0622 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -67,7 +67,7 @@ #include #include -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "defs.hxx" #include "lngopt.hxx" diff --git a/linguistic/source/grammarchecker.cxx b/linguistic/source/grammarchecker.cxx index 21e1b7a58a3c..5dc23d6f2a0f 100644 --- a/linguistic/source/grammarchecker.cxx +++ b/linguistic/source/grammarchecker.cxx @@ -34,7 +34,7 @@ #include #include #include -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "defs.hxx" #include #include diff --git a/linguistic/source/hhconvdic.cxx b/linguistic/source/hhconvdic.cxx index 207284230b4c..8f0e1f8736b8 100644 --- a/linguistic/source/hhconvdic.cxx +++ b/linguistic/source/hhconvdic.cxx @@ -48,7 +48,7 @@ #include #include "hhconvdic.hxx" -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "defs.hxx" using namespace utl; diff --git a/linguistic/source/hhconvdic.hxx b/linguistic/source/hhconvdic.hxx index 9bdecf0903fc..8d30ea2fd812 100644 --- a/linguistic/source/hhconvdic.hxx +++ b/linguistic/source/hhconvdic.hxx @@ -35,7 +35,7 @@ #include #include -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "defs.hxx" #include "convdic.hxx" diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx index 441d3ff449e9..2d234fdc15fa 100644 --- a/linguistic/source/hyphdsp.cxx +++ b/linguistic/source/hyphdsp.cxx @@ -42,8 +42,8 @@ #include #include "hyphdsp.hxx" -#include "hyphdta.hxx" -#include "lngprops.hxx" +#include "linguistic/hyphdta.hxx" +#include "linguistic/lngprops.hxx" #include "lngsvcmgr.hxx" diff --git a/linguistic/source/hyphdsp.hxx b/linguistic/source/hyphdsp.hxx index a722e9046c3c..416715943c9e 100644 --- a/linguistic/source/hyphdsp.hxx +++ b/linguistic/source/hyphdsp.hxx @@ -45,7 +45,7 @@ #include #include "lngopt.hxx" -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "defs.hxx" class LngSvcMgr; diff --git a/linguistic/source/hyphdta.cxx b/linguistic/source/hyphdta.cxx index 66c3ca3f7775..503d646de117 100644 --- a/linguistic/source/hyphdta.cxx +++ b/linguistic/source/hyphdta.cxx @@ -28,9 +28,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_linguistic.hxx" -#include "hyphdta.hxx" -#include "lngprops.hxx" -#include "misc.hxx" +#include "linguistic/hyphdta.hxx" +#include "linguistic/lngprops.hxx" +#include "linguistic/misc.hxx" #include diff --git a/linguistic/source/iprcache.cxx b/linguistic/source/iprcache.cxx index e4c50686afcf..6556fc71d052 100644 --- a/linguistic/source/iprcache.cxx +++ b/linguistic/source/iprcache.cxx @@ -31,7 +31,7 @@ #include #include "iprcache.hxx" -#include "misc.hxx" +#include "linguistic/misc.hxx" #include #include @@ -57,7 +57,7 @@ #endif #include -#include +#include using namespace utl; using namespace osl; diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index 77a1fcbd57b0..cc4f60e3b16f 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.cxx @@ -29,8 +29,8 @@ #include "precompiled_linguistic.hxx" #include "lngopt.hxx" -#include "lngprops.hxx" -#include "misc.hxx" +#include "linguistic/lngprops.hxx" +#include "linguistic/misc.hxx" #include #include diff --git a/linguistic/source/lngopt.hxx b/linguistic/source/lngopt.hxx index 7e86f31fc437..7f14142a4519 100644 --- a/linguistic/source/lngopt.hxx +++ b/linguistic/source/lngopt.hxx @@ -45,7 +45,7 @@ #include #include -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "defs.hxx" #include diff --git a/linguistic/source/lngprophelp.cxx b/linguistic/source/lngprophelp.cxx index 91b1a7ff8ebc..0efcf94a0b13 100644 --- a/linguistic/source/lngprophelp.cxx +++ b/linguistic/source/lngprophelp.cxx @@ -36,10 +36,10 @@ #include #include -#include -#include +#include +#include -#include +#include //using namespace utl; diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 90e433f50f07..db423e5725ec 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -47,7 +47,7 @@ #include "lngsvcmgr.hxx" #include "lngopt.hxx" -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "spelldsp.hxx" #include "hyphdsp.hxx" #include "thesdsp.hxx" diff --git a/linguistic/source/lngsvcmgr.hxx b/linguistic/source/lngsvcmgr.hxx index 953e531960bf..b8e0427ae328 100644 --- a/linguistic/source/lngsvcmgr.hxx +++ b/linguistic/source/lngsvcmgr.hxx @@ -42,7 +42,7 @@ //#include -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "defs.hxx" class SpellCheckerDispatcher; diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 7fb35b26a908..25c2a7f6b374 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -53,10 +53,10 @@ #include -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "defs.hxx" -#include "lngprops.hxx" -#include "hyphdta.hxx" +#include "linguistic/lngprops.hxx" +#include "linguistic/hyphdta.hxx" #include using namespace utl; diff --git a/linguistic/source/misc2.cxx b/linguistic/source/misc2.cxx index df7bc2f9f636..16874c4ff830 100644 --- a/linguistic/source/misc2.cxx +++ b/linguistic/source/misc2.cxx @@ -44,7 +44,7 @@ #include #include -#include "misc.hxx" +#include "linguistic/misc.hxx" using namespace com::sun::star; diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx index 2c9c99296ad7..9f1f969f7237 100644 --- a/linguistic/source/spelldsp.cxx +++ b/linguistic/source/spelldsp.cxx @@ -43,9 +43,9 @@ #include #include "spelldsp.hxx" -#include "spelldta.hxx" +#include "linguistic/spelldta.hxx" #include "lngsvcmgr.hxx" -#include "lngprops.hxx" +#include "linguistic/lngprops.hxx" using namespace utl; diff --git a/linguistic/source/spelldsp.hxx b/linguistic/source/spelldsp.hxx index 28807ac7a800..7ae83d3dbc6f 100644 --- a/linguistic/source/spelldsp.hxx +++ b/linguistic/source/spelldsp.hxx @@ -29,7 +29,7 @@ #define _LINGUISTIC_SPELLDSP_HXX_ #include "lngopt.hxx" -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "iprcache.hxx" #include // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx index cb7578f54852..fb4c11c892c6 100644 --- a/linguistic/source/spelldta.cxx +++ b/linguistic/source/spelldta.cxx @@ -37,7 +37,7 @@ #include -#include "spelldta.hxx" +#include "linguistic/spelldta.hxx" #include "lngsvcmgr.hxx" diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx index 6bd61ef408dd..91aab5c0997e 100644 --- a/linguistic/source/thesdsp.cxx +++ b/linguistic/source/thesdsp.cxx @@ -38,7 +38,7 @@ #include #include "thesdsp.hxx" -#include "lngprops.hxx" +#include "linguistic/lngprops.hxx" using namespace utl; using namespace osl; diff --git a/linguistic/source/thesdta.cxx b/linguistic/source/thesdta.cxx index 85a57e000f3e..e7aa3bf310f8 100644 --- a/linguistic/source/thesdta.cxx +++ b/linguistic/source/thesdta.cxx @@ -30,7 +30,7 @@ #include #include -#include +#include #include "thesdta.hxx" diff --git a/linguistic/workben/sprophelp.cxx b/linguistic/workben/sprophelp.cxx index 0a02bc22bb58..dcfa1d240cde 100644 --- a/linguistic/workben/sprophelp.cxx +++ b/linguistic/workben/sprophelp.cxx @@ -28,10 +28,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_linguistic.hxx" -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "sprophelp.hxx" -#include "lngprops.hxx" +#include "linguistic/lngprops.hxx" #include #include diff --git a/linguistic/workben/sspellimp.cxx b/linguistic/workben/sspellimp.cxx index 81981093e2f8..38123a144655 100644 --- a/linguistic/workben/sspellimp.cxx +++ b/linguistic/workben/sspellimp.cxx @@ -41,8 +41,8 @@ #include #endif -#include "lngprops.hxx" -#include "spelldta.hxx" +#include "linguistic/lngprops.hxx" +#include "linguistic/spelldta.hxx" using namespace utl; using namespace osl; diff --git a/linguistic/workben/sspellimp.hxx b/linguistic/workben/sspellimp.hxx index df37c403572f..e6796afc6356 100644 --- a/linguistic/workben/sspellimp.hxx +++ b/linguistic/workben/sspellimp.hxx @@ -42,7 +42,7 @@ #include #include -#include "misc.hxx" +#include "linguistic/misc.hxx" #include "sprophelp.hxx" using namespace ::rtl; -- cgit From 4cb6e6ea581178f7876538ec715b81623636df5d Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Mon, 14 Jun 2010 14:05:25 +0200 Subject: sb123:#i111449# cleanups in linguistic qa/complex tests --- linguistic/prj/build.lst | 4 + .../complex/linguistic/HangulHanjaConversion.java | 122 ++++++++++++--------- linguistic/qa/complex/linguistic/TestDocument.java | 41 +++++++ linguistic/qa/complex/linguistic/makefile.mk | 62 +++++------ 4 files changed, 142 insertions(+), 87 deletions(-) create mode 100644 linguistic/qa/complex/linguistic/TestDocument.java (limited to 'linguistic') diff --git a/linguistic/prj/build.lst b/linguistic/prj/build.lst index 57c332f6f3ea..d36b5d11cfcc 100644 --- a/linguistic/prj/build.lst +++ b/linguistic/prj/build.lst @@ -3,4 +3,8 @@ 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 diff --git a/linguistic/qa/complex/linguistic/HangulHanjaConversion.java b/linguistic/qa/complex/linguistic/HangulHanjaConversion.java index 160a1b42fd78..63412254c29f 100644 --- a/linguistic/qa/complex/linguistic/HangulHanjaConversion.java +++ b/linguistic/qa/complex/linguistic/HangulHanjaConversion.java @@ -43,56 +43,57 @@ import com.sun.star.linguistic2.XConversionDictionaryList; import com.sun.star.sheet.XSpreadsheet; import com.sun.star.sheet.XSpreadsheetDocument; import com.sun.star.table.XCell; -import com.sun.star.text.XTextCursor; -import com.sun.star.text.XTextDocument; -import com.sun.star.text.XWordCursor; + import com.sun.star.uno.UnoRuntime; -import complexlib.ComplexTestCase; -import java.io.PrintWriter; import util.DesktopTools; +// import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; -public class HangulHanjaConversion extends ComplexTestCase { +public class HangulHanjaConversion { XMultiServiceFactory xMSF = null; boolean disposed = false; Locale aLocale = new Locale("ko", "KR", ""); short dictType = ConversionDictionaryType.HANGUL_HANJA; - public String[] getTestMethodNames() { - return new String[] { "ConversionDictionaryList" }; - } +// public String[] getTestMethodNames() { +// return new String[] { "ConversionDictionaryList" }; +// } - public void before() { - xMSF = (XMultiServiceFactory) param.getMSF(); + @Before public void before() { + xMSF = getMSF(); } - public void ConversionDictionaryList() { + @Test public void ConversionDictionaryList() { Object ConversionDictionaryList = null; try { ConversionDictionaryList = xMSF.createInstance( "com.sun.star.linguistic2.ConversionDictionaryList"); } catch (com.sun.star.uno.Exception e) { - assure("Couldn't create ConversionDictionaryList", false); + fail("Couldn't create ConversionDictionaryList"); } if (ConversionDictionaryList == null) { - assure("Couldn't create ConversionDictionaryList", false); + fail("Couldn't create ConversionDictionaryList"); } boolean bList = checkXConversionDictionaryList( ConversionDictionaryList); - assure("XConversionDictionaryList doesnt work as expected", bList); + assertTrue("XConversionDictionaryList doesnt work as expected", bList); } private boolean checkXConversionDictionaryList(Object list) { boolean res = true; - XConversionDictionaryList xCList = (XConversionDictionaryList) UnoRuntime.queryInterface( - XConversionDictionaryList.class, - list); + XConversionDictionaryList xCList = UnoRuntime.queryInterface(XConversionDictionaryList.class, list); XConversionDictionary xDict = null; try { @@ -100,28 +101,30 @@ public class HangulHanjaConversion extends ComplexTestCase { dictType); } catch (com.sun.star.lang.NoSupportException e) { res = false; - assure("Couldn't add Dictionary", false); + fail("Couldn't add Dictionary"); } catch (com.sun.star.container.ElementExistException e) { res = false; - assure("Couldn't add Dictionary", false); + fail("Couldn't add Dictionary"); } try { xCList.addNewDictionary("addNewDictionary", aLocale, dictType); res = false; - assure("wrong exception while adding Dictionary again", false); + fail("wrong exception while adding Dictionary again"); } catch (com.sun.star.lang.NoSupportException e) { res = false; - assure("wrong exception while adding Dictionary again", false); + fail("wrong exception while adding Dictionary again"); } catch (com.sun.star.container.ElementExistException e) { } boolean localRes = checkNameContainer(xCList.getDictionaryContainer()); res &= localRes; - assure("getDictionaryContainer didn't work as expected", localRes); + assertTrue("getDictionaryContainer didn't work as expected", localRes); - String FileToLoad = util.utils.getFullTestURL("hangulhanja.sxc"); - XComponent xDoc = DesktopTools.loadDoc(xMSF, FileToLoad, + String FileToLoad = TestDocument.getUrl("hangulhanja.sxc"); + // String FileToLoad = util.utils.getFullTestURL(); + +XComponent xDoc = DesktopTools.loadDoc(xMSF, FileToLoad, new PropertyValue[] { }); XSpreadsheet xSheet = getSheet(xDoc); boolean done = false; @@ -145,7 +148,7 @@ public class HangulHanjaConversion extends ComplexTestCase { } catch (com.sun.star.lang.IllegalArgumentException e) { e.printStackTrace(); res = false; - assure("Exception while checking adding entry", false); + fail("Exception while checking adding entry"); } catch (com.sun.star.container.ElementExistException e) { //ignored } @@ -157,7 +160,7 @@ public class HangulHanjaConversion extends ComplexTestCase { } catch (com.sun.star.lang.IllegalArgumentException e) { e.printStackTrace(); res = false; - assure("Exception while checking adding entry", false); + fail("Exception while checking adding entry"); } catch (com.sun.star.container.ElementExistException e) { //ignored } @@ -165,7 +168,7 @@ public class HangulHanjaConversion extends ComplexTestCase { localRes = xCList.queryMaxCharCount(aLocale, dictType, ConversionDirection.FROM_LEFT) == 42; res &= localRes; - assure("queryMaxCharCount returned the wrong value", localRes); + assertTrue("queryMaxCharCount returned the wrong value", localRes); String[] conversion = null; @@ -177,37 +180,36 @@ public class HangulHanjaConversion extends ComplexTestCase { TextConversionOption.NONE); } catch (com.sun.star.lang.IllegalArgumentException e) { res = false; - assure("Exception while calling queryConversions", false); + fail("Exception while calling queryConversions"); } catch (com.sun.star.lang.NoSupportException e) { res = false; - assure("Exception while calling queryConversions", false); + fail("Exception while calling queryConversions"); } localRes = conversion[0].equals(expectedConversion); res &= localRes; - assure("queryConversions didn't work as expected", localRes); + assertTrue("queryConversions didn't work as expected", localRes); try { xCList.getDictionaryContainer().removeByName("addNewDictionary"); } catch (com.sun.star.container.NoSuchElementException e) { res = false; - assure("exception while removing Dictionary again", false); + fail("exception while removing Dictionary again"); } catch (com.sun.star.lang.WrappedTargetException e) { res = false; - assure("exception while removing Dictionary again", false); + fail("exception while removing Dictionary again"); } localRes = !xCList.getDictionaryContainer() .hasByName("addNewDictionary"); res &= localRes; - assure("Dictionary hasn't been removed properly", localRes); + assertTrue("Dictionary hasn't been removed properly", localRes); - XComponent dicList = (XComponent) UnoRuntime.queryInterface( - XComponent.class, xCList); + XComponent dicList = UnoRuntime.queryInterface(XComponent.class, xCList); XEventListener listen = new EventListener(); dicList.addEventListener(listen); dicList.dispose(); - assure("dispose didn't work", disposed); + assertTrue("dispose didn't work", disposed); dicList.removeEventListener(listen); DesktopTools.closeDoc(xDoc); @@ -244,23 +246,17 @@ public class HangulHanjaConversion extends ComplexTestCase { } private XSpreadsheet getSheet(XComponent xDoc) { - XSpreadsheetDocument xSheetDoc = (XSpreadsheetDocument) UnoRuntime.queryInterface( - XSpreadsheetDocument.class, - xDoc); + XSpreadsheetDocument xSheetDoc = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xDoc); XSpreadsheet xSheet = null; try { - xSheet = (XSpreadsheet) UnoRuntime.queryInterface( - XSpreadsheet.class, - xSheetDoc.getSheets() - .getByName(xSheetDoc.getSheets() - .getElementNames()[0])); + xSheet = UnoRuntime.queryInterface(XSpreadsheet.class, xSheetDoc.getSheets().getByName(xSheetDoc.getSheets().getElementNames()[0])); } catch (com.sun.star.container.NoSuchElementException e) { - log.println("Couldn't get sheet"); - e.printStackTrace((PrintWriter) log); + System.out.println("Couldn't get sheet"); + e.printStackTrace(); } catch (com.sun.star.lang.WrappedTargetException e) { - log.println("Couldn't get sheet"); - e.printStackTrace((PrintWriter) log); + System.out.println("Couldn't get sheet"); + e.printStackTrace(); } return xSheet; @@ -280,8 +276,8 @@ public class HangulHanjaConversion extends ComplexTestCase { try { re = xSpreadsheet.getCellByPosition(x, y); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - log.println("Couldn't get word"); - e.printStackTrace((PrintWriter) log); + System.out.println("Couldn't get word"); + e.printStackTrace(); } return re; @@ -342,4 +338,26 @@ public class HangulHanjaConversion extends ComplexTestCase { disposed = true; } } -} \ No newline at end of file + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + +} diff --git a/linguistic/qa/complex/linguistic/TestDocument.java b/linguistic/qa/complex/linguistic/TestDocument.java new file mode 100644 index 000000000000..575640662e5f --- /dev/null +++ b/linguistic/qa/complex/linguistic/TestDocument.java @@ -0,0 +1,41 @@ +/************************************************************************* +* +* 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 +* +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +package complex.linguistic; + +import java.io.File; +import org.openoffice.test.OfficeFileUrl; + +final class TestDocument +{ + public static String getUrl(String name) + { + return OfficeFileUrl.getAbsolute(new File("testdocuments", name)); + } + + private TestDocument() {} +} diff --git a/linguistic/qa/complex/linguistic/makefile.mk b/linguistic/qa/complex/linguistic/makefile.mk index 75330e3c5de0..b0d274167b98 100644 --- a/linguistic/qa/complex/linguistic/makefile.mk +++ b/linguistic/qa/complex/linguistic/makefile.mk @@ -25,49 +25,41 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = HangulHanjaConversion -PRJNAME = linguistic -PACKAGE = complex$/linguistic +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: + @echo "OOO_SUBSEQUENT_TESTS not set, do nothing." +.ELSE -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar \ - OOoRunner.jar mysql.jar -JAVAFILES = HangulHanjaConversion.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -#----- make a jar from compiled files ------------------------------ +PRJ = ../../.. +PRJNAME = sc +TARGET = qa_complex_linguistic -MAXLINELENGTH = 100000 +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/linguistic -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +# here store only Files which contain a @Test +JAVATESTFILES = \ + HangulHanjaConversion.java -# --- Parameters for the test -------------------------------------- +# put here all other files +JAVAFILES = $(JAVATESTFILES) \ + TestDocument.java -# test base is java complex -CT_TESTBASE = -tb java_complex +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +# subdirectories +# SUBDIRS = helper -# start the runner application -CT_APP = org.openoffice.Runner +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - -RUN: run - -run: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_TEST) -tdoc $(PWD)$/testdocuments +.END +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk +ALLTAR : javatest +.END -- cgit From 305193791e7143970687ea4c0dc47dca02022b2c Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Tue, 29 Jun 2010 13:43:23 +0200 Subject: sb123:#i111449# makefile cleanups for qa/complex tests --- linguistic/qa/complex/linguistic/makefile.mk | 1 - 1 file changed, 1 deletion(-) (limited to 'linguistic') diff --git a/linguistic/qa/complex/linguistic/makefile.mk b/linguistic/qa/complex/linguistic/makefile.mk index b0d274167b98..2d10ec4c832d 100644 --- a/linguistic/qa/complex/linguistic/makefile.mk +++ b/linguistic/qa/complex/linguistic/makefile.mk @@ -27,7 +27,6 @@ .IF "$(OOO_SUBSEQUENT_TESTS)" == "" nothing .PHONY: - @echo "OOO_SUBSEQUENT_TESTS not set, do nothing." .ELSE PRJ = ../../.. -- cgit From b7c1a7a78bcf1c1824e893e2b4f4620def043c9c Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Fri, 23 Jul 2010 12:20:26 +0200 Subject: sb123:#i111449# fix all run through problems for qa/complex tests --- linguistic/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linguistic') diff --git a/linguistic/prj/build.lst b/linguistic/prj/build.lst index d36b5d11cfcc..b85d4cfd9d73 100644 --- a/linguistic/prj/build.lst +++ b/linguistic/prj/build.lst @@ -7,4 +7,4 @@ 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\qa\complex\linguistic nmake - all lg_qa_complex NULL -- cgit From b5ff94fde0cc506d9c3c17c2762101a0c7a657e4 Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Mon, 23 Aug 2010 10:38:44 +0200 Subject: sb123:#i111449# remove all subdirs in complex tests --- linguistic/qa/complex/linguistic/makefile.mk | 3 --- 1 file changed, 3 deletions(-) (limited to 'linguistic') diff --git a/linguistic/qa/complex/linguistic/makefile.mk b/linguistic/qa/complex/linguistic/makefile.mk index 2d10ec4c832d..43a88ee0a198 100644 --- a/linguistic/qa/complex/linguistic/makefile.mk +++ b/linguistic/qa/complex/linguistic/makefile.mk @@ -47,9 +47,6 @@ JAVAFILES = $(JAVATESTFILES) \ JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) -# subdirectories -# SUBDIRS = helper - # Sample how to debug # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -- cgit From 460e23cc97d0fe644ceb77d8a8935017b9e71283 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Mon, 5 Jul 2010 08:06:21 +0200 Subject: cws tl82: #i112898# memory leak fixed --- linguistic/source/lngsvcmgr.cxx | 34 ++++++++++++++++++++++------------ linguistic/source/lngsvcmgr.hxx | 2 ++ 2 files changed, 24 insertions(+), 12 deletions(-) (limited to 'linguistic') diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 90e433f50f07..3f53b0a391fb 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -45,6 +45,8 @@ #include #include +#include + #include "lngsvcmgr.hxx" #include "lngopt.hxx" #include "misc.hxx" @@ -605,6 +607,14 @@ LngSvcMgr::LngSvcMgr() : EnableNotification( aNames ); } +void LngSvcMgr::clearSvcInfoArray(SvcInfoArray* pInfo) +{ + if (pInfo) + { + std::for_each(pInfo->begin(), pInfo->end(), boost::checked_deleter()); + delete pInfo; + } +} LngSvcMgr::~LngSvcMgr() { @@ -612,10 +622,10 @@ LngSvcMgr::~LngSvcMgr() // will be freed in the destructor of the respective Reference's // xSpellDsp, xGrammarDsp, xHyphDsp, xThesDsp - delete pAvailSpellSvcs; - delete pAvailGrammarSvcs; - delete pAvailHyphSvcs; - delete pAvailThesSvcs; + clearSvcInfoArray(pAvailSpellSvcs); + clearSvcInfoArray(pAvailGrammarSvcs); + clearSvcInfoArray(pAvailHyphSvcs); + clearSvcInfoArray(pAvailThesSvcs); } @@ -652,7 +662,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) if (0 == rName.compareTo( aSpellCheckerList, aSpellCheckerList.getLength() )) { // delete old cached data, needs to be acquired new on demand - delete pAvailSpellSvcs; pAvailSpellSvcs = 0; + clearSvcInfoArray(pAvailSpellSvcs); pAvailSpellSvcs = 0; OUString aNode( aSpellCheckerList ); if (lcl_SeqHasString( aSpellCheckerListEntries, aKeyText )) @@ -677,7 +687,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) else if (0 == rName.compareTo( aGrammarCheckerList, aGrammarCheckerList.getLength() )) { // delete old cached data, needs to be acquired new on demand - delete pAvailGrammarSvcs; pAvailGrammarSvcs = 0; + clearSvcInfoArray(pAvailGrammarSvcs); pAvailGrammarSvcs = 0; OUString aNode( aGrammarCheckerList ); if (lcl_SeqHasString( aGrammarCheckerListEntries, aKeyText )) @@ -705,7 +715,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) else if (0 == rName.compareTo( aHyphenatorList, aHyphenatorList.getLength() )) { // delete old cached data, needs to be acquired new on demand - delete pAvailHyphSvcs; pAvailHyphSvcs = 0; + clearSvcInfoArray(pAvailHyphSvcs); pAvailHyphSvcs = 0; OUString aNode( aHyphenatorList ); if (lcl_SeqHasString( aHyphenatorListEntries, aKeyText )) @@ -730,7 +740,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) else if (0 == rName.compareTo( aThesaurusList, aThesaurusList.getLength() )) { // delete old cached data, needs to be acquired new on demand - delete pAvailThesSvcs; pAvailThesSvcs = 0; + clearSvcInfoArray(pAvailThesSvcs); pAvailThesSvcs = 0; OUString aNode( aThesaurusList ); if (lcl_SeqHasString( aThesaurusListEntries, aKeyText )) @@ -1402,7 +1412,7 @@ uno::Sequence< OUString > SAL_CALL { // don't used cached data here (force re-evaluation in order to have downloaded dictionaries // already found without the need to restart the office - delete pAvailSpellSvcs; pAvailSpellSvcs = 0; + clearSvcInfoArray(pAvailSpellSvcs); pAvailSpellSvcs = 0; GetAvailableSpellSvcs_Impl(); pInfoArray = pAvailSpellSvcs; } @@ -1410,7 +1420,7 @@ uno::Sequence< OUString > SAL_CALL { // don't used cached data here (force re-evaluation in order to have downloaded dictionaries // already found without the need to restart the office - delete pAvailGrammarSvcs; pAvailGrammarSvcs = 0; + clearSvcInfoArray(pAvailGrammarSvcs); pAvailGrammarSvcs = 0; GetAvailableGrammarSvcs_Impl(); pInfoArray = pAvailGrammarSvcs; } @@ -1418,7 +1428,7 @@ uno::Sequence< OUString > SAL_CALL { // don't used cached data here (force re-evaluation in order to have downloaded dictionaries // already found without the need to restart the office - delete pAvailHyphSvcs; pAvailHyphSvcs = 0; + clearSvcInfoArray(pAvailHyphSvcs); pAvailHyphSvcs = 0; GetAvailableHyphSvcs_Impl(); pInfoArray = pAvailHyphSvcs; } @@ -1426,7 +1436,7 @@ uno::Sequence< OUString > SAL_CALL { // don't used cached data here (force re-evaluation in order to have downloaded dictionaries // already found without the need to restart the office - delete pAvailThesSvcs; pAvailThesSvcs = 0; + clearSvcInfoArray(pAvailThesSvcs); pAvailThesSvcs = 0; GetAvailableThesSvcs_Impl(); pInfoArray = pAvailThesSvcs; } diff --git a/linguistic/source/lngsvcmgr.hxx b/linguistic/source/lngsvcmgr.hxx index 953e531960bf..bb6f6cf93732 100644 --- a/linguistic/source/lngsvcmgr.hxx +++ b/linguistic/source/lngsvcmgr.hxx @@ -143,6 +143,8 @@ class LngSvcMgr : void SetAvailableCfgServiceLists( LinguDispatcher &rDispatcher, const SvcInfoArray &rAvailSvcs ); + static void clearSvcInfoArray(SvcInfoArray *pInfo); + // utl::ConfigItem (to allow for listening of changes of relevant properties) virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString > &rPropertyNames ); virtual void Commit(); -- cgit From 3ad81df579c34873878d09b8a45a59717d44b614 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Wed, 7 Jul 2010 08:44:22 +0200 Subject: cws tl82: automatic and silent conversion of user dictionaries to human readable UTF-8 format (DIC_VERSION_7) --- linguistic/source/dicimp.cxx | 115 ++++++++++++------------------------------- 1 file changed, 31 insertions(+), 84 deletions(-) (limited to 'linguistic') diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index fe53bf344ac3..01c6838a4d3d 100755 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -438,101 +438,48 @@ ULONG DictionaryNeo::saveEntries(const OUString &rURL) return static_cast< ULONG >(-1); SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) ); - ULONG nErr = sal::static_int_cast< ULONG >(-1); - rtl_TextEncoding eEnc = osl_getThreadTextEncoding(); - if (nDicVersion >= DIC_VERSION_6) - eEnc = RTL_TEXTENCODING_UTF8; - - if (nDicVersion == DIC_VERSION_7) + // + // Always write as the latest version, i.e. DIC_VERSION_7 + // + rtl_TextEncoding eEnc = RTL_TEXTENCODING_UTF8; + pStream->WriteLine(ByteString (pVerOOo7)); + if (0 != (nErr = pStream->GetError())) + return nErr; + if (nLanguage == LANGUAGE_NONE) + pStream->WriteLine(ByteString("lang: ")); + else { - pStream->WriteLine(ByteString (pVerOOo7)); - if (0 != (nErr = pStream->GetError())) - return nErr; - - if (nLanguage == LANGUAGE_NONE) - pStream->WriteLine(ByteString("lang: ")); - else - { - ByteString aLine("lang: "); - aLine += ByteString( String( MsLangId::convertLanguageToIsoString( nLanguage ) ), eEnc); - pStream->WriteLine( aLine ); - } - if (0 != (nErr = pStream->GetError())) - return nErr; - - if (eDicType == DictionaryType_POSITIVE) - pStream->WriteLine(ByteString("type: positive")); - else - pStream->WriteLine(ByteString("type: negative")); - if (0 != (nErr = pStream->GetError())) - return nErr; - - pStream->WriteLine(ByteString("---")); - if (0 != (nErr = pStream->GetError())) - return nErr; - - const uno::Reference< XDictionaryEntry > *pEntry = aEntries.getConstArray(); - for (INT32 i = 0; i < nCount; i++) - { - ByteString aOutStr = formatForSave(pEntry[i], eEnc); - pStream->WriteLine (aOutStr); - if (0 != (nErr = pStream->GetError())) - return nErr; - } + ByteString aLine("lang: "); + aLine += ByteString( String( MsLangId::convertLanguageToIsoString( nLanguage ) ), eEnc); + pStream->WriteLine( aLine ); } + if (0 != (nErr = pStream->GetError())) + return nErr; + if (eDicType == DictionaryType_POSITIVE) + pStream->WriteLine(ByteString("type: positive")); else + pStream->WriteLine(ByteString("type: negative")); + if (0 != (nErr = pStream->GetError())) + return nErr; + pStream->WriteLine(ByteString("---")); + if (0 != (nErr = pStream->GetError())) + return nErr; + const uno::Reference< XDictionaryEntry > *pEntry = aEntries.getConstArray(); + for (INT32 i = 0; i < nCount; i++) { - sal_Char aWordBuf[BUFSIZE]; - - // write version - const sal_Char *pVerStr = NULL; - if (DIC_VERSION_6 == nDicVersion) - pVerStr = pVerStr6; - else - pVerStr = eDicType == DictionaryType_POSITIVE ? pVerStr2 : pVerStr5; - strcpy( aWordBuf, pVerStr ); // #100211# - checked - USHORT nLen = sal::static_int_cast< USHORT >(strlen( aWordBuf )); - *pStream << nLen; + ByteString aOutStr = formatForSave(pEntry[i], eEnc); + pStream->WriteLine (aOutStr); if (0 != (nErr = pStream->GetError())) return nErr; - pStream->Write(aWordBuf, nLen); - if (0 != (nErr = pStream->GetError())) - return nErr; - - *pStream << nLanguage; - if (0 != (nErr = pStream->GetError())) - return nErr; - *pStream << (sal_Char) (eDicType == DictionaryType_NEGATIVE ? TRUE : FALSE); - if (0 != (nErr = pStream->GetError())) - return nErr; - - const uno::Reference< XDictionaryEntry > *pEntry = aEntries.getConstArray(); - for (INT32 i = 0; i < nCount; i++) - { - ByteString aOutStr = formatForSave(pEntry[i], eEnc); - - // the old format would fail (mis-calculation of nLen) and write - // uninitialized junk for combined len >= BUFSIZE - we truncate - // silently here, but BUFSIZE is large anyway. - nLen = aOutStr.Len(); - if (nLen >= BUFSIZE) - nLen = BUFSIZE - 1; - - *pStream << nLen; - if (0 != (nErr = pStream->GetError())) - return nErr; - pStream->Write(aOutStr.GetBuffer(), nLen); - if (0 != (nErr = pStream->GetError())) - return nErr; - } } - //! get return value before Stream is destroyed - ULONG nError = pStream->GetError(); + //If we are migrating from an older version, then on first successful + //write, we're now converted to the latest version, i.e. DIC_VERSION_7 + nDicVersion = DIC_VERSION_7; - return nError; + return nErr; } void DictionaryNeo::launchEvent(INT16 nEvent, -- cgit From 9551bf5a1ee5c9275a26f8ec4021e0b7f5665176 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 10 Sep 2010 13:10:07 +0200 Subject: sb129: #i113189# change UNO components to use passive registration --- linguistic/prj/d.lst | 1 + linguistic/source/convdiclist.cxx | 25 ---------------- linguistic/source/dlistimp.cxx | 25 ---------------- linguistic/source/gciterator.cxx | 24 --------------- linguistic/source/grammarchecker.cxx | 21 ------------- linguistic/source/lng.component | 46 ++++++++++++++++++++++++++++ linguistic/source/lngopt.cxx | 23 -------------- linguistic/source/lngreg.cxx | 58 ------------------------------------ linguistic/source/lngsvcmgr.cxx | 25 ---------------- linguistic/source/makefile.mk | 13 ++++++-- 10 files changed, 57 insertions(+), 204 deletions(-) create mode 100644 linguistic/source/lng.component (limited to 'linguistic') diff --git a/linguistic/prj/d.lst b/linguistic/prj/d.lst index 01a755e53cc6..0e0534feafd8 100644 --- a/linguistic/prj/d.lst +++ b/linguistic/prj/d.lst @@ -8,3 +8,4 @@ mkdir: %_DEST%\inc%_EXT%\linguistic ..\inc\*.hxx %_DEST%\inc%_EXT%\linguistic\*.hxx +..\%__SRC%\misc\lng.component %_DEST%\xml%_EXT%\lng.component diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index 2916b2ee6eec..c842893d66f1 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -692,31 +692,6 @@ uno::Reference< uno::XInterface > SAL_CALL ConvDicList_CreateInstance( return StaticConvDicList::get(); } - -sal_Bool SAL_CALL ConvDicList_writeInfo( - void * /*pServiceManager*/, registry::XRegistryKey * pRegistryKey ) -{ - try - { - String aImpl( '/' ); - aImpl += ConvDicList::getImplementationName_Static().getStr(); - aImpl.AppendAscii( "/UNO/SERVICES" ); - uno::Reference< registry::XRegistryKey > xNewKey = - pRegistryKey->createKey(aImpl ); - uno::Sequence< OUString > aServices = - ConvDicList::getSupportedServiceNames_Static(); - for( INT32 i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[i]); - - return sal_True; - } - catch(Exception &) - { - return sal_False; - } -} - - void * SAL_CALL ConvDicList_getFactory( const sal_Char * pImplName, XMultiServiceFactory * pServiceManager, void * ) diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index 817dbeb311ca..0e1a045bb98e 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -796,31 +796,6 @@ uno::Sequence< rtl::OUString > DicList::getSupportedServiceNames_Static() throw( return aSNS; } - -sal_Bool SAL_CALL DicList_writeInfo( - void * /*pServiceManager*/, registry::XRegistryKey * pRegistryKey ) -{ - try - { - String aImpl( '/' ); - aImpl += DicList::getImplementationName_Static().getStr(); - aImpl.AppendAscii( "/UNO/SERVICES" ); - uno::Reference< registry::XRegistryKey > xNewKey = - pRegistryKey->createKey(aImpl ); - uno::Sequence< rtl::OUString > aServices = - DicList::getSupportedServiceNames_Static(); - for( INT32 i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[i]); - - return sal_True; - } - catch(Exception &) - { - return sal_False; - } -} - - void * SAL_CALL DicList_getFactory( const sal_Char * pImplName, XMultiServiceFactory * pServiceManager, void * ) { diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index 6485e6e841b7..afcf1503bbe9 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -1333,27 +1333,3 @@ void * SAL_CALL GrammarCheckingIterator_getFactory( } return pRet; } - - -sal_Bool SAL_CALL GrammarCheckingIterator_writeInfo( - void * /*pServiceManager*/, - registry::XRegistryKey * pRegistryKey ) -{ - try - { - OUString aImpl( '/' ); - aImpl += GrammarCheckingIterator_getImplementationName().getStr(); - aImpl += A2OU( "/UNO/SERVICES" ); - uno::Reference< registry::XRegistryKey > xNewKey = pRegistryKey->createKey( aImpl ); - uno::Sequence< OUString > aServices = GrammarCheckingIterator_getSupportedServiceNames(); - for( sal_Int32 i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[i] ); - - return sal_True; - } - catch (uno::Exception &) - { - return sal_False; - } -} - diff --git a/linguistic/source/grammarchecker.cxx b/linguistic/source/grammarchecker.cxx index 21e1b7a58a3c..57041b7c1e4a 100644 --- a/linguistic/source/grammarchecker.cxx +++ b/linguistic/source/grammarchecker.cxx @@ -276,27 +276,6 @@ OUString SAL_CALL GrammarChecker::getImplementationName( ) throw(uno::RuntimeEx return getImplementationName_Static(); } -sal_Bool SAL_CALL GrammarChecker_writeInfo( void * /*pServiceManager*/, registry::XRegistryKey * pRegistryKey ) -{ - try - { - String aImpl( '/' ); - aImpl += GrammarChecker::getImplementationName_Static().getStr(); - aImpl.AppendAscii( "/UNO/SERVICES" ); - uno::Reference< registry::XRegistryKey > xNewKey = - pRegistryKey->createKey( aImpl ); - uno::Sequence< OUString > aServices = GrammarChecker::getSupportedServiceNames_Static(); - for( INT32 i = 0; i < aServices.getLength(); ++i ) - xNewKey->createKey( aServices.getConstArray()[i] ); - - return sal_True; - } - catch(uno::Exception &) - { - return sal_False; - } -} - uno::Reference< uno::XInterface > SAL_CALL GrammarChecker_CreateInstance( const uno::Reference< lang::XMultiServiceFactory > & /*rSMgr*/ ) throw(uno::Exception) diff --git a/linguistic/source/lng.component b/linguistic/source/lng.component new file mode 100644 index 000000000000..f4f3ca603a88 --- /dev/null +++ b/linguistic/source/lng.component @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index 77a1fcbd57b0..9cefa6179316 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.cxx @@ -665,29 +665,6 @@ uno::Sequence< OUString > LinguProps::getSupportedServiceNames_Static() return aSNS; } - -sal_Bool SAL_CALL LinguProps_writeInfo( void * /*pServiceManager*/, - XRegistryKey * pRegistryKey ) -{ - try - { - String aImpl( '/' ); - aImpl += LinguProps::getImplementationName_Static().getStr(); - aImpl.AppendAscii( "/UNO/SERVICES" ); - Reference< XRegistryKey > xNewKey = - pRegistryKey->createKey(aImpl ); - uno::Sequence< OUString > aServices = LinguProps::getSupportedServiceNames_Static(); - for( INT32 i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[i]); - - return sal_True; - } - catch(Exception &) - { - return sal_False; - } -} - void * SAL_CALL LinguProps_getFactory( const sal_Char * pImplName, XMultiServiceFactory *pServiceManager, void * ) { diff --git a/linguistic/source/lngreg.cxx b/linguistic/source/lngreg.cxx index 6ab3db60d268..0f6add07b466 100644 --- a/linguistic/source/lngreg.cxx +++ b/linguistic/source/lngreg.cxx @@ -38,42 +38,6 @@ using namespace com::sun::star::lang; using namespace com::sun::star::registry; -//////////////////////////////////////// -// declaration of external RegEntry-functions defined by the service objects -// - -extern sal_Bool SAL_CALL LngSvcMgr_writeInfo -( - void * /*pServiceManager*/, - XRegistryKey * pRegistryKey -); - -extern sal_Bool SAL_CALL DicList_writeInfo -( - void * /*pServiceManager*/, XRegistryKey * pRegistryKey -); - -extern sal_Bool SAL_CALL LinguProps_writeInfo -( - void * /*pServiceManager*/, - XRegistryKey * pRegistryKey -); - -extern sal_Bool SAL_CALL ConvDicList_writeInfo -( - void * /*pServiceManager*/, XRegistryKey * pRegistryKey -); - -extern sal_Bool SAL_CALL GrammarCheckingIterator_writeInfo -( - void * /*pServiceManager*/, XRegistryKey * pRegistryKey -); - -//extern sal_Bool SAL_CALL GrammarChecker_writeInfo -//( -// void * /*pServiceManager*/, XRegistryKey * pRegistryKey -//); - extern void * SAL_CALL LngSvcMgr_getFactory ( const sal_Char * pImplName, @@ -129,28 +93,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -sal_Bool SAL_CALL component_writeInfo -( - void * pServiceManager, - XRegistryKey * pRegistryKey -) -{ - sal_Bool bRet = LngSvcMgr_writeInfo( pServiceManager, pRegistryKey ); - if(bRet) - bRet = LinguProps_writeInfo( pServiceManager, pRegistryKey ); - if(bRet) - bRet = DicList_writeInfo( pServiceManager, pRegistryKey ); - if(bRet) - bRet = ConvDicList_writeInfo( pServiceManager, pRegistryKey ); - if(bRet) - bRet = GrammarCheckingIterator_writeInfo( pServiceManager, pRegistryKey ); -/* - if(bRet) - bRet = GrammarChecker_writeInfo( pServiceManager, pRegistryKey ); -*/ - return bRet; -} - void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) { diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 90e433f50f07..e7db388a826a 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -1990,31 +1990,6 @@ uno::Reference< uno::XInterface > SAL_CALL LngSvcMgr_CreateInstance( return xService; } - - -sal_Bool SAL_CALL LngSvcMgr_writeInfo( - void * /*pServiceManager*/, - registry::XRegistryKey * pRegistryKey ) -{ - try - { - String aImpl( '/' ); - aImpl += LngSvcMgr::getImplementationName_Static().getStr(); - aImpl.AppendAscii( "/UNO/SERVICES" ); - uno::Reference< registry::XRegistryKey > xNewKey = - pRegistryKey->createKey( aImpl ); - uno::Sequence< OUString > aServices = LngSvcMgr::getSupportedServiceNames_Static(); - for( INT32 i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[i] ); - - return sal_True; - } - catch(uno::Exception &) - { - return sal_False; - } -} - void * SAL_CALL LngSvcMgr_getFactory( const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager, diff --git a/linguistic/source/makefile.mk b/linguistic/source/makefile.mk index 3f68afb30575..9bbd456ce89d 100644 --- a/linguistic/source/makefile.mk +++ b/linguistic/source/makefile.mk @@ -91,9 +91,8 @@ DEF1DES =Linguistic main DLL .IF "$(GUI)"=="WNT" -DEF1EXPORT1 = component_writeInfo -DEF1EXPORT2 = component_getFactory -DEF1EXPORT3 = component_getImplementationEnvironment +DEF1EXPORT1 = component_getFactory +DEF1EXPORT2 = component_getImplementationEnvironment .ENDIF # --- Targets ------------------------------------------------------ @@ -109,3 +108,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk @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 -- cgit From 1885dddbdd2382f95aef15df15d4cd110f8d7854 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 22 Oct 2010 10:37:46 +0200 Subject: sb131: #i115124# $(XSLTPROC) implies LIBXSLT:libxslt --- linguistic/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linguistic') diff --git a/linguistic/prj/build.lst b/linguistic/prj/build.lst index b85d4cfd9d73..0043eaffc6ed 100644 --- a/linguistic/prj/build.lst +++ b/linguistic/prj/build.lst @@ -1,4 +1,4 @@ -lg linguistic : svl xmloff ucbhelper vos comphelper ICU:icu NULL +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 -- cgit From 4f40fd2727a826d5d0b06617e5179829d66df5d2 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 29 Oct 2010 15:36:30 +0200 Subject: CWS gnumake2: resolve conflicts and make sources buildable on Linux --- linguistic/prj/d.lst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'linguistic') diff --git a/linguistic/prj/d.lst b/linguistic/prj/d.lst index 4b2e240ef2ef..03237f925764 100644 --- a/linguistic/prj/d.lst +++ b/linguistic/prj/d.lst @@ -7,9 +7,7 @@ ..\xml\*.xml %_DEST%\xml%_EXT%\*.xml mkdir: %_DEST%\inc%_EXT%\linguistic -<<<<<<< local ..\inc\linguistic\*.hxx %_DEST%\inc%_EXT%\linguistic\*.hxx -======= -..\inc\*.hxx %_DEST%\inc%_EXT%\linguistic\*.hxx + ..\%__SRC%\misc\lng.component %_DEST%\xml%_EXT%\lng.component ->>>>>>> other + -- cgit From ccad553abd004bd82c12d8fbffe384bd31efe419 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Tue, 23 Nov 2010 11:00:54 +0100 Subject: cws tl84: #i96486# --- linguistic/source/misc2.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'linguistic') diff --git a/linguistic/source/misc2.cxx b/linguistic/source/misc2.cxx index df7bc2f9f636..85008d97a7a9 100644 --- a/linguistic/source/misc2.cxx +++ b/linguistic/source/misc2.cxx @@ -249,7 +249,10 @@ String GetWritableDictionaryURL( const String &rDicName ) aURLObj.Append( rDicName, INetURLObject::ENCODE_ALL ); DBG_ASSERT(!aURLObj.HasError(), "lng : invalid URL"); - return aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI ); + // NO_DECODE preserves the escape sequences that might be included in aDirName + // depending on the characters used in the path string. (Needed when comparing + // the dictionary URL with GetDictionaryWriteablePath in DicList::createDictionary.) + return aURLObj.GetMainURL( INetURLObject::NO_DECODE ); } -- cgit From 0cb5080d653910d699238a7920174c2e73a8c801 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Thu, 13 Jan 2011 11:06:43 +0100 Subject: removetooltypes01: #i112600# Exchange misleading sal_uIntPtr with sal_uLong in linguistic --- linguistic/source/convdic.cxx | 2 +- linguistic/source/dicimp.cxx | 12 ++++++------ linguistic/source/dicimp.hxx | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'linguistic') diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index f199c6630908..2f2fa78b8f72 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -110,7 +110,7 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xIn ) ); - sal_uIntPtr nError = sal::static_int_cast< sal_uIntPtr >(-1); + sal_uLong nError = sal::static_int_cast< sal_uLong >(-1); // prepare ParserInputSource xml::sax::InputSource aParserInput; diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index de8fdd7ef6ac..05924609384f 100755 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -261,7 +261,7 @@ DictionaryNeo::~DictionaryNeo() { } -sal_uIntPtr DictionaryNeo::loadEntries(const OUString &rMainURL) +sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL) { MutexGuard aGuard( GetLinguMutex() ); @@ -291,11 +291,11 @@ sal_uIntPtr DictionaryNeo::loadEntries(const OUString &rMainURL) (void) e; } if (!xStream.is()) - return static_cast< sal_uIntPtr >(-1); + return static_cast< sal_uLong >(-1); SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) ); - sal_uIntPtr nErr = sal::static_int_cast< sal_uIntPtr >(-1); + sal_uLong nErr = sal::static_int_cast< sal_uLong >(-1); // Header einlesen sal_Bool bNegativ; @@ -411,7 +411,7 @@ static ByteString formatForSave( } -sal_uIntPtr DictionaryNeo::saveEntries(const OUString &rURL) +sal_uLong DictionaryNeo::saveEntries(const OUString &rURL) { MutexGuard aGuard( GetLinguMutex() ); @@ -435,10 +435,10 @@ sal_uIntPtr DictionaryNeo::saveEntries(const OUString &rURL) (void) e; } if (!xStream.is()) - return static_cast< sal_uIntPtr >(-1); + return static_cast< sal_uLong >(-1); SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) ); - sal_uIntPtr nErr = sal::static_int_cast< sal_uIntPtr >(-1); + sal_uLong nErr = sal::static_int_cast< sal_uLong >(-1); // // Always write as the latest version, i.e. DIC_VERSION_7 diff --git a/linguistic/source/dicimp.hxx b/linguistic/source/dicimp.hxx index 3c186ecf517b..d6b4653db28e 100644 --- a/linguistic/source/dicimp.hxx +++ b/linguistic/source/dicimp.hxx @@ -83,8 +83,8 @@ class DictionaryNeo : ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryEntry > xEntry); - sal_uIntPtr loadEntries(const ::rtl::OUString &rMainURL); - sal_uIntPtr saveEntries(const ::rtl::OUString &rMainURL); + sal_uLong loadEntries(const ::rtl::OUString &rMainURL); + sal_uLong saveEntries(const ::rtl::OUString &rMainURL); int cmpDicEntry(const ::rtl::OUString &rWord1, const ::rtl::OUString &rWord2, sal_Bool bSimilarOnly = sal_False); -- cgit From 51922f86be2f7fa17005ec3b208f6a891bdd70a7 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Fri, 28 Jan 2011 12:49:53 +0100 Subject: gnumake3: remove comphelper version; fix including extract.hxx --- linguistic/source/gciterator.cxx | 2 +- linguistic/source/lngsvcmgr.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'linguistic') diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index e311e54cde88..56e96df65d7b 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -58,10 +58,10 @@ #include #include #include -#include #include #include #include +#include #include #include diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index c6da72bca6c1..00e71628bd70 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include -- cgit From b33eb35f15dea928529b02511d6ff10ddc49ae4a Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 28 Jan 2011 17:45:42 +0100 Subject: CWS gnumake3: extract.hxx cppuhelper->comphelper --- linguistic/source/grammarchecker.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linguistic') diff --git a/linguistic/source/grammarchecker.cxx b/linguistic/source/grammarchecker.cxx index 4647cd7feefe..4de68ab1f9af 100644 --- a/linguistic/source/grammarchecker.cxx +++ b/linguistic/source/grammarchecker.cxx @@ -47,7 +47,7 @@ #include #include #include "lngopt.hxx" -#include +#include #include #include #include -- cgit