diff options
Diffstat (limited to 'linguistic')
50 files changed, 1385 insertions, 1385 deletions
diff --git a/linguistic/inc/hyphdta.hxx b/linguistic/inc/hyphdta.hxx index 1d8b9f2b164d..167c11dcc65d 100644 --- a/linguistic/inc/hyphdta.hxx +++ b/linguistic/inc/hyphdta.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -34,8 +34,8 @@ #include <tools/solar.h> -#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include <cppuhelper/implbase1.hxx> // helper for implementations +#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include <cppuhelper/implbase1.hxx> // helper for implementations namespace linguistic @@ -49,12 +49,12 @@ class HyphenatedWord : ::com::sun::star::linguistic2::XHyphenatedWord > { - ::rtl::OUString aWord; - ::rtl::OUString aHyphenatedWord; - INT16 nHyphPos; - INT16 nHyphenationPos; - INT16 nLanguage; - BOOL bIsAltSpelling; + ::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 &); @@ -102,10 +102,10 @@ class PossibleHyphens : ::com::sun::star::linguistic2::XPossibleHyphens > { - ::rtl::OUString aWord; - ::rtl::OUString aWordWithHyphens; - ::com::sun::star::uno::Sequence< INT16 > aOrigHyphenPos; - INT16 nLanguage; + ::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 &); diff --git a/linguistic/inc/iprcache.hxx b/linguistic/inc/iprcache.hxx index 7d0f028c09b5..842747a723cb 100644 --- a/linguistic/inc/iprcache.hxx +++ b/linguistic/inc/iprcache.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -29,8 +29,8 @@ #define _LINGUISTIC_IPRCACHE_HXX_ -#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include <cppuhelper/implbase2.hxx> // helper for implementations +#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include <cppuhelper/implbase2.hxx> // helper for implementations #include <com/sun/star/uno/Reference.h> #include <com/sun/star/document/XEventListener.hpp> @@ -53,12 +53,12 @@ namespace linguistic class Flushable { public: - virtual void Flush() = 0; + virtual void Flush() = 0; }; /////////////////////////////////////////////////////////////////////////// -class FlushListener : +class FlushListener : public cppu::WeakImplHelper2 < ::com::sun::star::linguistic2::XDictionaryListEventListener, @@ -66,10 +66,10 @@ class FlushListener : > { ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XDictionaryList > xDicList; + ::com::sun::star::linguistic2::XDictionaryList > xDicList; ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > xPropSet; - Flushable *pFlushObj; + ::com::sun::star::beans::XPropertySet > xPropSet; + Flushable *pFlushObj; // don't allow to use copy-constructor and assignment-operator FlushListener(const FlushListener &); @@ -79,11 +79,11 @@ public: FlushListener( Flushable *pFO ); virtual ~FlushListener(); - inline void SetFlushObj( Flushable *pFO) { pFlushObj = pFO; } - + inline void SetFlushObj( Flushable *pFO) { pFlushObj = pFO; } + void SetDicList( ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryList > &rDL ); void SetPropSet( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &rPS ); - + //XEventListener virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& rSource ) throw(::com::sun::star::uno::RuntimeException); @@ -102,7 +102,7 @@ class SpellCache : ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryListEventListener > xFlushLstnr; - FlushListener *pFlushLstnr; + FlushListener *pFlushLstnr; typedef std::set< ::rtl::OUString > WordList_t; typedef std::map< LanguageType, WordList_t > LangWordList_t; @@ -117,7 +117,7 @@ public: virtual ~SpellCache(); // Flushable - virtual void Flush(); + virtual void Flush(); void AddWord( const ::rtl::OUString& rWord, LanguageType nLang ); bool CheckWord( const ::rtl::OUString& rWord, LanguageType nLang ); @@ -125,7 +125,7 @@ public: /////////////////////////////////////////////////////////////////////////// -} // namespace linguistic +} // namespace linguistic #endif diff --git a/linguistic/inc/lngprophelp.hxx b/linguistic/inc/lngprophelp.hxx index 323d40bc72fb..18d125af560e 100644 --- a/linguistic/inc/lngprophelp.hxx +++ b/linguistic/inc/lngprophelp.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -39,11 +39,11 @@ #include <com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp> namespace com { namespace sun { namespace star { namespace beans { - class XPropertySet; + class XPropertySet; }}}} namespace com { namespace sun { namespace star { namespace linguistic2 { - struct LinguServiceEvent; + struct LinguServiceEvent; }}}} @@ -57,9 +57,9 @@ namespace linguistic // Flags for type of events allowed to be launched -#define AE_SPELLCHECKER 1 -#define AE_HYPHENATOR 2 -//#define AE_THESAURUS 4 +#define AE_SPELLCHECKER 1 +#define AE_HYPHENATOR 2 +//#define AE_THESAURUS 4 typedef cppu::WeakImplHelper2 < @@ -72,39 +72,39 @@ class PropertyChgHelper : { ::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::XInterface > xMyEvtObj; + ::cppu::OInterfaceContainerHelper aLngSvcEvtListeners; ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > xPropSet; + ::com::sun::star::beans::XPropertySet > xPropSet; - int nEvtFlags; // flags for event types allowed to be launched + int nEvtFlags; // flags for event types allowed to be launched // default values - BOOL bIsIgnoreControlCharacters; - BOOL bIsUseDictionaryList; - + BOOL bIsIgnoreControlCharacters; + BOOL bIsUseDictionaryList; + // return values, will be set to default value or current temporary value - BOOL bResIsIgnoreControlCharacters; - BOOL bResIsUseDictionaryList; - - + 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(); - + virtual void SetDefaultValues(); + virtual void GetCurrentValues(); + ::com::sun::star::uno::Sequence< ::rtl::OUString > & - GetPropNames() { return aPropNames; } + GetPropNames() { return aPropNames; } ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & - GetPropSet() { return xPropSet; } + GetPropSet() { return xPropSet; } - void AddPropNames( const char *pNewNames[], INT32 nCount ); - - virtual BOOL propertyChange_Impl( + void AddPropNames( const char *pNewNames[], INT32 nCount ); + + virtual BOOL propertyChange_Impl( const ::com::sun::star::beans::PropertyChangeEvent& rEvt ); public: @@ -116,8 +116,8 @@ public: int nAllowedEvents ); virtual ~PropertyChgHelper(); - virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ); - + virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ); + // XEventListener virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& rSource ) @@ -141,22 +141,22 @@ public: throw(::com::sun::star::uno::RuntimeException); // non-UNO functions - void AddAsPropListener(); - void RemoveAsPropListener(); - void LaunchEvent( + 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; } + GetPropNames() const { return aPropNames; } const ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > & - GetPropSet() const { return xPropSet; } + ::com::sun::star::beans::XPropertySet > & + GetPropSet() const { return xPropSet; } const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & - GetEvtObj() const { return xMyEvtObj; } + GetEvtObj() const { return xMyEvtObj; } - BOOL IsIgnoreControlCharacters() const { return bResIsIgnoreControlCharacters; } - BOOL IsUseDictionaryList() const { return bResIsUseDictionaryList; } + BOOL IsIgnoreControlCharacters() const { return bResIsIgnoreControlCharacters; } + BOOL IsUseDictionaryList() const { return bResIsUseDictionaryList; } }; @@ -176,7 +176,7 @@ public: ::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 ) @@ -189,15 +189,15 @@ class PropertyHelper_Spell : public PropertyChgHelper { // default values - BOOL bIsSpellUpperCase; - BOOL bIsSpellWithDigits; - BOOL bIsSpellCapitalization; + 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; + BOOL bResIsSpellUpperCase; + BOOL bResIsSpellWithDigits; + BOOL bResIsSpellCapitalization; // disallow use of copy-constructor and assignment-operator @@ -206,9 +206,9 @@ class PropertyHelper_Spell : protected: // PropertyChgHelper - virtual void SetDefaultValues(); - virtual void GetCurrentValues(); - virtual BOOL propertyChange_Impl( + virtual void SetDefaultValues(); + virtual void GetCurrentValues(); + virtual BOOL propertyChange_Impl( const ::com::sun::star::beans::PropertyChangeEvent& rEvt ); public: @@ -219,7 +219,7 @@ public: ::com::sun::star::beans::XPropertySet > &rxPropSet ); virtual ~PropertyHelper_Spell(); - virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ); + virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ); // XPropertyChangeListener virtual void SAL_CALL @@ -229,9 +229,9 @@ public: virtual INT16 GetDefaultNumberOfSuggestions() const; INT16 GetMaxNumberOfSuggestions() const { return nResMaxNumberOfSuggestions; } - BOOL IsSpellUpperCase() const { return bResIsSpellUpperCase; } - BOOL IsSpellWithDigits() const { return bResIsSpellWithDigits; } - BOOL IsSpellCapitalization() const { return bResIsSpellCapitalization; } + BOOL IsSpellUpperCase() const { return bResIsSpellUpperCase; } + BOOL IsSpellWithDigits() const { return bResIsSpellWithDigits; } + BOOL IsSpellCapitalization() const { return bResIsSpellCapitalization; } }; /////////////////////////////////////////////////////////////////////////// @@ -240,12 +240,12 @@ class PropertyHelper_Hyphen : public PropertyChgHelper { // default values - INT16 nHyphMinLeading, + INT16 nHyphMinLeading, nHyphMinTrailing, nHyphMinWordLength; // return values, will be set to default value or current temporary value - INT16 nResHyphMinLeading, + INT16 nResHyphMinLeading, nResHyphMinTrailing, nResHyphMinWordLength; @@ -255,9 +255,9 @@ class PropertyHelper_Hyphen : protected: // PropertyChgHelper - virtual void SetDefaultValues(); - virtual void GetCurrentValues(); - virtual BOOL propertyChange_Impl( + virtual void SetDefaultValues(); + virtual void GetCurrentValues(); + virtual BOOL propertyChange_Impl( const ::com::sun::star::beans::PropertyChangeEvent& rEvt ); public: @@ -268,16 +268,16 @@ public: ::com::sun::star::beans::XPropertySet > &rxPropSet); virtual ~PropertyHelper_Hyphen(); - virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals ); + 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; } + INT16 GetMinLeading() const { return nResHyphMinLeading; } + INT16 GetMinTrailing() const { return nResHyphMinTrailing; } + INT16 GetMinWordLength() const { return nResHyphMinWordLength; } }; /////////////////////////////////////////////////////////////////////////// diff --git a/linguistic/inc/lngprops.hxx b/linguistic/inc/lngprops.hxx index c13bdd487466..68f599d50a8c 100644 --- a/linguistic/inc/lngprops.hxx +++ b/linguistic/inc/lngprops.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -38,25 +38,25 @@ //!! 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_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 +#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 index c85981fabe72..f40a0ae55803 100644 --- a/linguistic/inc/misc.hxx +++ b/linguistic/inc/misc.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -39,8 +39,8 @@ #include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp> #include <com/sun/star/linguistic2/XHyphenatedWord.hpp> -#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include <cppuhelper/implbase1.hxx> // helper for implementations +#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include <cppuhelper/implbase1.hxx> // helper for implementations #include <unotools/pathoptions.hxx> #include <i18npool/lang.h> #include <tools/string.hxx> @@ -62,14 +62,14 @@ 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" +#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 @@ -95,7 +95,7 @@ namespace linguistic /////////////////////////////////////////////////////////////////////////// -::osl::Mutex & GetLinguMutex(); +::osl::Mutex & GetLinguMutex(); LocaleDataWrapper & GetLocaleDataWrapper( INT16 nLang ); @@ -171,7 +171,7 @@ String SearchFileInPaths( const String &rFile, const ::com::sun::star::uno:: /////////////////////////////////////////////////////////////////////////// -INT32 GetPosInWordToCheck( const rtl::OUString &rTxt, INT32 nPos ); +INT32 GetPosInWordToCheck( const rtl::OUString &rTxt, INT32 nPos ); ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenatedWord > @@ -190,10 +190,10 @@ inline BOOL IsLower( const String &rText, INT16 nLanguage ) { return 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 ); +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 ); /////////////////////////////////////////////////////////////////////////// @@ -242,16 +242,16 @@ class AppExitListener : > { ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XDesktop > xDesktop; + ::com::sun::star::frame::XDesktop > xDesktop; public: AppExitListener(); virtual ~AppExitListener(); - virtual void AtExit() = 0; + virtual void AtExit() = 0; - void Activate(); - void Deactivate(); + void Activate(); + void Deactivate(); // XEventListener virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); @@ -263,7 +263,7 @@ public: /////////////////////////////////////////////////////////////////////////// -} // namespace linguistic +} // namespace linguistic #endif diff --git a/linguistic/inc/pch/precompiled_linguistic.cxx b/linguistic/inc/pch/precompiled_linguistic.cxx index e0de1795572b..bc06ba5df311 100644 --- a/linguistic/inc/pch/precompiled_linguistic.cxx +++ b/linguistic/inc/pch/precompiled_linguistic.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 diff --git a/linguistic/inc/pch/precompiled_linguistic.hxx b/linguistic/inc/pch/precompiled_linguistic.hxx index 54f93806c509..8f0a3f8c0291 100644 --- a/linguistic/inc/pch/precompiled_linguistic.hxx +++ b/linguistic/inc/pch/precompiled_linguistic.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 diff --git a/linguistic/inc/spelldta.hxx b/linguistic/inc/spelldta.hxx index a7dc79037ffb..f4d0f5c660ce 100644 --- a/linguistic/inc/spelldta.hxx +++ b/linguistic/inc/spelldta.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -34,7 +34,7 @@ #include <tools/solar.h> -#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type #include <cppuhelper/implbase2.hxx> namespace com { namespace sun { namespace star { @@ -49,34 +49,34 @@ namespace linguistic /////////////////////////////////////////////////////////////////////////// -::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XSpellAlternatives > +::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XSpellAlternatives > MergeProposals( - ::com::sun::star::uno::Reference< + ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellAlternatives > &rxAlt1, - ::com::sun::star::uno::Reference< + ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellAlternatives > &rxAlt2 ); -::com::sun::star::uno::Sequence< ::rtl::OUString > +::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( +void SeqRemoveNegEntries( ::com::sun::star::uno::Sequence< ::rtl::OUString > &rSeq, - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XDictionaryList > &rxDicList, + ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XDictionaryList > &rxDicList, INT16 nLanguage ); -BOOL SeqHasEntry( - const ::com::sun::star::uno::Sequence< ::rtl::OUString > &rSeq, +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< +void SearchSimilarText( const rtl::OUString &rText, INT16 nLanguage, + ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryList > &xDicList, std::vector< rtl::OUString > & rDicListProps ); @@ -90,10 +90,10 @@ class SpellAlternatives : ::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; + ::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 &); @@ -119,16 +119,16 @@ public: 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( + 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 +} // namespace linguistic #endif diff --git a/linguistic/inc/thesdta.hxx b/linguistic/inc/thesdta.hxx index 9c5848287027..1b262ab73da7 100644 --- a/linguistic/inc/thesdta.hxx +++ b/linguistic/inc/thesdta.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -31,8 +31,8 @@ #include <com/sun/star/linguistic2/XMeaning.hpp> -#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include <cppuhelper/implbase1.hxx> // helper for implementations +#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include <cppuhelper/implbase1.hxx> // helper for implementations namespace linguistic @@ -71,8 +71,8 @@ public: throw(::com::sun::star::uno::RuntimeException) = 0; // non-interface specific functions - const ::rtl::OUString & getLookUpText() const { return aLookUpText; } - short getLookUpLanguage() const { return nLookUpLanguage; } + const ::rtl::OUString & getLookUpText() const { return aLookUpText; } + short getLookUpLanguage() const { return nLookUpLanguage; } }; diff --git a/linguistic/qa/complex/linguistic/HangulHanjaConversion.java b/linguistic/qa/complex/linguistic/HangulHanjaConversion.java index 42b8e9fe8e7b..160a1b42fd78 100644 --- a/linguistic/qa/complex/linguistic/HangulHanjaConversion.java +++ b/linguistic/qa/complex/linguistic/HangulHanjaConversion.java @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -91,12 +91,12 @@ public class HangulHanjaConversion extends ComplexTestCase { private boolean checkXConversionDictionaryList(Object list) { boolean res = true; XConversionDictionaryList xCList = (XConversionDictionaryList) UnoRuntime.queryInterface( - XConversionDictionaryList.class, + XConversionDictionaryList.class, list); XConversionDictionary xDict = null; try { - xDict = xCList.addNewDictionary("addNewDictionary", aLocale, + xDict = xCList.addNewDictionary("addNewDictionary", aLocale, dictType); } catch (com.sun.star.lang.NoSupportException e) { res = false; @@ -121,7 +121,7 @@ public class HangulHanjaConversion extends ComplexTestCase { assure("getDictionaryContainer didn't work as expected", localRes); String FileToLoad = util.utils.getFullTestURL("hangulhanja.sxc"); - XComponent xDoc = DesktopTools.loadDoc(xMSF, FileToLoad, + XComponent xDoc = DesktopTools.loadDoc(xMSF, FileToLoad, new PropertyValue[] { }); XSpreadsheet xSheet = getSheet(xDoc); boolean done = false; @@ -162,7 +162,7 @@ public class HangulHanjaConversion extends ComplexTestCase { //ignored } - localRes = xCList.queryMaxCharCount(aLocale, dictType, + localRes = xCList.queryMaxCharCount(aLocale, dictType, ConversionDirection.FROM_LEFT) == 42; res &= localRes; assure("queryMaxCharCount returned the wrong value", localRes); @@ -170,10 +170,10 @@ public class HangulHanjaConversion extends ComplexTestCase { String[] conversion = null; try { - conversion = xCList.queryConversions(wordToCheck, 0, - wordToCheck.length(), aLocale, - dictType, - ConversionDirection.FROM_LEFT, + conversion = xCList.queryConversions(wordToCheck, 0, + wordToCheck.length(), aLocale, + dictType, + ConversionDirection.FROM_LEFT, TextConversionOption.NONE); } catch (com.sun.star.lang.IllegalArgumentException e) { res = false; @@ -245,13 +245,13 @@ public class HangulHanjaConversion extends ComplexTestCase { private XSpreadsheet getSheet(XComponent xDoc) { XSpreadsheetDocument xSheetDoc = (XSpreadsheetDocument) UnoRuntime.queryInterface( - XSpreadsheetDocument.class, + XSpreadsheetDocument.class, xDoc); XSpreadsheet xSheet = null; try { xSheet = (XSpreadsheet) UnoRuntime.queryInterface( - XSpreadsheet.class, + XSpreadsheet.class, xSheetDoc.getSheets() .getByName(xSheetDoc.getSheets() .getElementNames()[0])); @@ -305,8 +305,8 @@ public class HangulHanjaConversion extends ComplexTestCase { return ConversionDictionaryType.HANGUL_HANJA; } - public String[] getConversions(String str, int param, int param2, - ConversionDirection conversionDirection, + public String[] getConversions(String str, int param, int param2, + ConversionDirection conversionDirection, int param4) throws IllegalArgumentException { return new String[] { "getConversion" }; diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index 7d37935f0b13..0b7245eb3019 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -91,12 +91,12 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) DBG_ASSERT(!INetURLObject( rMainURL ).HasError(), "invalid URL"); uno::Reference< lang::XMultiServiceFactory > xServiceFactory( utl::getProcessServiceFactory() ); - + // get xInputStream stream uno::Reference< io::XInputStream > xIn; try { - uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( + uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW ); xIn = xAccess->openFileRead( rMainURL ); } @@ -120,7 +120,7 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) uno::Reference< xml::sax::XParser > xParser; try { - xParser = uno::Reference< xml::sax::XParser >( xServiceFactory->createInstance( + xParser = uno::Reference< xml::sax::XParser >( xServiceFactory->createInstance( A2OU( "com.sun.star.xml.sax.Parser" ) ), UNO_QUERY ); } catch (uno::Exception &) @@ -134,7 +134,7 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) //ConvDicXMLImport *pImport = new ConvDicXMLImport( this, rMainURL ); //!! keep a reference until everything is done to //!! ensure the proper lifetime of the object - uno::Reference < xml::sax::XDocumentHandler > xFilter( + uno::Reference < xml::sax::XDocumentHandler > xFilter( (xml::sax::XExtendedDocumentHandler *) &rImport, UNO_QUERY ); // connect parser and filter @@ -182,15 +182,15 @@ BOOL IsConvDic( const String &rFileURL, INT16 &nLang, sal_Int16 &nConvType ) // up to the end (reading all entries) when the required // data (language, conversion type) is found. ConvDicXMLImport *pImport = new ConvDicXMLImport( 0, rFileURL ); - + //!! keep a first reference to ensure the lifetime of the object !! uno::Reference< XInterface > xRef( (document::XFilter *) pImport, UNO_QUERY ); - + ReadThroughDic( rFileURL, *pImport ); // will implicitly add the entries - bRes = pImport->GetLanguage() != LANGUAGE_NONE && + bRes = pImport->GetLanguage() != LANGUAGE_NONE && pImport->GetConversionType() != -1; DBG_ASSERT( bRes, "conversion dictionary corrupted?" ); - + if (bRes) { nLang = pImport->GetLanguage(); @@ -203,8 +203,8 @@ BOOL IsConvDic( const String &rFileURL, INT16 &nLang, sal_Int16 &nConvType ) /////////////////////////////////////////////////////////////////////////// -ConvDic::ConvDic( - const String &rName, +ConvDic::ConvDic( + const String &rName, INT16 nLang, sal_Int16 nConvType, BOOL bBiDirectional, @@ -227,7 +227,7 @@ ConvDic::ConvDic( bNeedEntries = TRUE; bIsModified = bIsActive = FALSE; bIsReadonly = FALSE; - + if( rMainURL.Len() > 0 ) { BOOL bExists = FALSE; @@ -275,14 +275,14 @@ void ConvDic::Save() if (aMainURL.Len() == 0 || bNeedEntries) return; DBG_ASSERT(!INetURLObject( aMainURL ).HasError(), "invalid URL"); - + uno::Reference< lang::XMultiServiceFactory > xServiceFactory( utl::getProcessServiceFactory() ); - + // get XOutputStream stream uno::Reference< io::XStream > xStream; try { - uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( + uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW ); xStream = xAccess->openFileReadWrite( aMainURL ); } @@ -302,7 +302,7 @@ void ConvDic::Save() { try { - xSaxWriter = uno::Reference< io::XActiveDataSource >( + xSaxWriter = uno::Reference< io::XActiveDataSource >( xServiceFactory->createInstance( OUString::createFromAscii( "com.sun.star.xml.sax.Writer" ) ), UNO_QUERY ); } @@ -311,7 +311,7 @@ void ConvDic::Save() } } DBG_ASSERT( xSaxWriter.is(), "can't instantiate XML writer" ); - + if (xSaxWriter.is() && xStream.is()) { // connect XML writer to output stream @@ -334,11 +334,11 @@ void ConvDic::Save() ConvMap::iterator ConvDic::GetEntry( ConvMap &rMap, const rtl::OUString &rFirstText, const rtl::OUString &rSecondText ) { - pair< ConvMap::iterator, ConvMap::iterator > aRange = + pair< ConvMap::iterator, ConvMap::iterator > aRange = rMap.equal_range( rFirstText ); ConvMap::iterator aPos = rMap.end(); - for (ConvMap::iterator aIt = aRange.first; - aIt != aRange.second && aPos == rMap.end(); + for (ConvMap::iterator aIt = aRange.first; + aIt != aRange.second && aPos == rMap.end(); ++aIt) { if ((*aIt).second == rSecondText) @@ -374,7 +374,7 @@ void ConvDic::AddEntry( const OUString &rLeftText, const OUString &rRightText ) if (pFromRight.get() && rRightText.getLength() > nMaxRightCharCount) nMaxRightCharCount = (sal_Int16) rRightText.getLength(); } - + bIsModified = TRUE; } @@ -398,9 +398,9 @@ void ConvDic::RemoveEntry( const OUString &rLeftText, const OUString &rRightText bIsModified = TRUE; bMaxCharCountIsValid = FALSE; } - -OUString SAL_CALL ConvDic::getName( ) + +OUString SAL_CALL ConvDic::getName( ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -408,7 +408,7 @@ OUString SAL_CALL ConvDic::getName( ) } -Locale SAL_CALL ConvDic::getLocale( ) +Locale SAL_CALL ConvDic::getLocale( ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -416,7 +416,7 @@ Locale SAL_CALL ConvDic::getLocale( ) } -sal_Int16 SAL_CALL ConvDic::getConversionType( ) +sal_Int16 SAL_CALL ConvDic::getConversionType( ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -424,7 +424,7 @@ sal_Int16 SAL_CALL ConvDic::getConversionType( ) } -void SAL_CALL ConvDic::setActive( sal_Bool bActivate ) +void SAL_CALL ConvDic::setActive( sal_Bool bActivate ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -432,7 +432,7 @@ void SAL_CALL ConvDic::setActive( sal_Bool bActivate ) } -sal_Bool SAL_CALL ConvDic::isActive( ) +sal_Bool SAL_CALL ConvDic::isActive( ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -440,7 +440,7 @@ sal_Bool SAL_CALL ConvDic::isActive( ) } -void SAL_CALL ConvDic::clear( ) +void SAL_CALL ConvDic::clear( ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -455,12 +455,12 @@ void SAL_CALL ConvDic::clear( ) } -uno::Sequence< OUString > SAL_CALL ConvDic::getConversions( - const OUString& aText, - sal_Int32 nStartPos, - sal_Int32 nLength, - ConversionDirection eDirection, - sal_Int32 /*nTextConversionOptions*/ ) +uno::Sequence< OUString > SAL_CALL ConvDic::getConversions( + const OUString& aText, + sal_Int32 nStartPos, + sal_Int32 nLength, + ConversionDirection eDirection, + sal_Int32 /*nTextConversionOptions*/ ) throw (IllegalArgumentException, RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -472,22 +472,22 @@ uno::Sequence< OUString > SAL_CALL ConvDic::getConversions( Load(); OUString aLookUpText( aText.copy(nStartPos, nLength) ); - ConvMap &rConvMap = eDirection == ConversionDirection_FROM_LEFT ? + ConvMap &rConvMap = eDirection == ConversionDirection_FROM_LEFT ? aFromLeft : *pFromRight; pair< ConvMap::iterator, ConvMap::iterator > aRange = rConvMap.equal_range( aLookUpText ); - + INT32 nCount = 0; ConvMap::iterator aIt; for (aIt = aRange.first; aIt != aRange.second; ++aIt) ++nCount; - + uno::Sequence< OUString > aRes( nCount ); OUString *pRes = aRes.getArray(); INT32 i = 0; for (aIt = aRange.first; aIt != aRange.second; ++aIt) pRes[i++] = (*aIt).second; - + return aRes; } @@ -505,13 +505,13 @@ static BOOL lcl_SeqHasEntry( { if (*pSeqStart++ == rText) bRes = TRUE; - } + } } return bRes; } -uno::Sequence< OUString > SAL_CALL ConvDic::getConversionEntries( - ConversionDirection eDirection ) +uno::Sequence< OUString > SAL_CALL ConvDic::getConversionEntries( + ConversionDirection eDirection ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -522,7 +522,7 @@ uno::Sequence< OUString > SAL_CALL ConvDic::getConversionEntries( if (bNeedEntries) Load(); - ConvMap &rConvMap = eDirection == ConversionDirection_FROM_LEFT ? + ConvMap &rConvMap = eDirection == ConversionDirection_FROM_LEFT ? aFromLeft : *pFromRight; uno::Sequence< OUString > aRes( rConvMap.size() ); OUString *pRes = aRes.getArray(); @@ -545,9 +545,9 @@ uno::Sequence< OUString > SAL_CALL ConvDic::getConversionEntries( } -void SAL_CALL ConvDic::addEntry( - const OUString& aLeftText, - const OUString& aRightText ) +void SAL_CALL ConvDic::addEntry( + const OUString& aLeftText, + const OUString& aRightText ) throw (IllegalArgumentException, container::ElementExistException, RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -559,9 +559,9 @@ void SAL_CALL ConvDic::addEntry( } -void SAL_CALL ConvDic::removeEntry( - const OUString& aLeftText, - const OUString& aRightText ) +void SAL_CALL ConvDic::removeEntry( + const OUString& aLeftText, + const OUString& aRightText ) throw (container::NoSuchElementException, RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -573,7 +573,7 @@ void SAL_CALL ConvDic::removeEntry( } -sal_Int16 SAL_CALL ConvDic::getMaxCharCount( ConversionDirection eDirection ) +sal_Int16 SAL_CALL ConvDic::getMaxCharCount( ConversionDirection eDirection ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -598,7 +598,7 @@ sal_Int16 SAL_CALL ConvDic::getMaxCharCount( ConversionDirection eDirection ) nMaxLeftCharCount = nTmp; ++aIt; } - + nMaxRightCharCount = 0; if (pFromRight.get()) { @@ -621,17 +621,17 @@ sal_Int16 SAL_CALL ConvDic::getMaxCharCount( ConversionDirection eDirection ) } -void SAL_CALL ConvDic::setPropertyType( - const OUString& rLeftText, - const OUString& rRightText, - sal_Int16 nPropertyType ) +void SAL_CALL ConvDic::setPropertyType( + const OUString& rLeftText, + const OUString& rRightText, + sal_Int16 nPropertyType ) throw (container::NoSuchElementException, IllegalArgumentException, RuntimeException) { sal_Bool bHasElement = HasEntry( rLeftText, rRightText); if (!bHasElement) throw container::NoSuchElementException(); - - // currently we assume that entries with the same left text have the + + // currently we assume that entries with the same left text have the // same PropertyType even if the right text is different... if (pConvPropType.get()) pConvPropType->insert( PropTypeMap::value_type( rLeftText, nPropertyType ) ); @@ -639,9 +639,9 @@ void SAL_CALL ConvDic::setPropertyType( } -sal_Int16 SAL_CALL ConvDic::getPropertyType( - const OUString& rLeftText, - const OUString& rRightText ) +sal_Int16 SAL_CALL ConvDic::getPropertyType( + const OUString& rLeftText, + const OUString& rRightText ) throw (container::NoSuchElementException, RuntimeException) { sal_Bool bHasElement = HasEntry( rLeftText, rRightText); @@ -661,7 +661,7 @@ sal_Int16 SAL_CALL ConvDic::getPropertyType( } -void SAL_CALL ConvDic::flush( ) +void SAL_CALL ConvDic::flush( ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -684,8 +684,8 @@ void SAL_CALL ConvDic::flush( ) } -void SAL_CALL ConvDic::addFlushListener( - const uno::Reference< util::XFlushListener >& rxListener ) +void SAL_CALL ConvDic::addFlushListener( + const uno::Reference< util::XFlushListener >& rxListener ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -694,8 +694,8 @@ void SAL_CALL ConvDic::addFlushListener( } -void SAL_CALL ConvDic::removeFlushListener( - const uno::Reference< util::XFlushListener >& rxListener ) +void SAL_CALL ConvDic::removeFlushListener( + const uno::Reference< util::XFlushListener >& rxListener ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -704,7 +704,7 @@ void SAL_CALL ConvDic::removeFlushListener( } -OUString SAL_CALL ConvDic::getImplementationName( ) +OUString SAL_CALL ConvDic::getImplementationName( ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -712,7 +712,7 @@ OUString SAL_CALL ConvDic::getImplementationName( ) } -sal_Bool SAL_CALL ConvDic::supportsService( const OUString& rServiceName ) +sal_Bool SAL_CALL ConvDic::supportsService( const OUString& rServiceName ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -723,7 +723,7 @@ sal_Bool SAL_CALL ConvDic::supportsService( const OUString& rServiceName ) } -uno::Sequence< OUString > SAL_CALL ConvDic::getSupportedServiceNames( ) +uno::Sequence< OUString > SAL_CALL ConvDic::getSupportedServiceNames( ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -731,7 +731,7 @@ uno::Sequence< OUString > SAL_CALL ConvDic::getSupportedServiceNames( ) } -uno::Sequence< OUString > ConvDic::getSupportedServiceNames_Static() +uno::Sequence< OUString > ConvDic::getSupportedServiceNames_Static() throw() { uno::Sequence< OUString > aSNS( 1 ); diff --git a/linguistic/source/convdic.hxx b/linguistic/source/convdic.hxx index b7fd8419898e..c0a22da8a1f1 100644 --- a/linguistic/source/convdic.hxx +++ b/linguistic/source/convdic.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index 9199d43ad936..2916b2ee6eec 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -35,7 +35,7 @@ #include <unotools/useroptions.hxx> #include <unotools/lingucfg.hxx> #include <rtl/instance.hxx> -#include <cppuhelper/factory.hxx> // helper for factories +#include <cppuhelper/factory.hxx> // helper for factories #include <unotools/localfilehelper.hxx> #include <com/sun/star/linguistic2/XConversionDictionaryList.hpp> #include <com/sun/star/linguistic2/XConversionDictionary.hpp> @@ -319,7 +319,7 @@ void SAL_CALL ConvDicNameContainer::removeByName( const OUString& rName ) { try { - ::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), + ::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > () ); aCnt.executeCommand( OUString::createFromAscii( "delete" ), makeAny( sal_Bool( sal_True ) ) ); } diff --git a/linguistic/source/convdiclist.hxx b/linguistic/source/convdiclist.hxx index 0c06871a3dae..d1c0740d991f 100644 --- a/linguistic/source/convdiclist.hxx +++ b/linguistic/source/convdiclist.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -64,15 +64,15 @@ class ConvDicList : ::cppu::OInterfaceContainerHelper aEvtListeners; - + ConvDicNameContainer *pNameContainer; - ::com::sun::star::uno::Reference< + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xNameContainer; MyAppExitListener *pExitListener; ::com::sun::star::uno::Reference< ::com::sun::star::frame:: XTerminateListener > xExitListener; - + BOOL bDisposing; // disallow copy-constructor and assignment-operator for now @@ -80,7 +80,7 @@ class ConvDicList : ConvDicList & operator = (const ConvDicList &); ConvDicNameContainer & GetNameContainer(); - + public: ConvDicList(); virtual ~ConvDicList(); diff --git a/linguistic/source/convdicxml.cxx b/linguistic/source/convdicxml.cxx index c06c6f92172e..f3d56f7024a9 100644 --- a/linguistic/source/convdicxml.cxx +++ b/linguistic/source/convdicxml.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -129,7 +129,7 @@ public: class ConvDicXMLDictionaryContext_Impl : public ConvDicXMLImportContext { - INT16 nLanguage; + INT16 nLanguage; sal_Int16 nConversionType; public: @@ -145,8 +145,8 @@ public: virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &rxAttrList ); - INT16 GetLanguage() const { return nLanguage; } - sal_Int16 GetConversionType() const { return nConversionType; } + INT16 GetLanguage() const { return nLanguage; } + sal_Int16 GetConversionType() const { return nConversionType; } }; @@ -155,7 +155,7 @@ class ConvDicXMLEntryTextContext_Impl : { OUString aLeftText; sal_Int16 nPropertyType; // used for Chinese simplified/traditional conversion - ConvDicXMLDictionaryContext_Impl &rDicContext; + ConvDicXMLDictionaryContext_Impl &rDicContext; public: ConvDicXMLEntryTextContext_Impl( @@ -172,7 +172,7 @@ public: virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &rxAttrList ); - const OUString & GetLeftText() const { return aLeftText; } + const OUString & GetLeftText() const { return aLeftText; } sal_Int16 GetPropertyType() const { return nPropertyType; } void SetPropertyType( sal_Int16 nVal ) { nPropertyType = nVal; } }; @@ -199,9 +199,9 @@ public: virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &rxAttrList ); virtual void Characters( const OUString &rChars ); - const OUString & GetRightText() const { return aRightText; } - const OUString & GetLeftText() const { return rEntryContext.GetLeftText(); } - ConvDic * GetDic() { return GetConvDicImport().GetDic(); } + const OUString & GetRightText() const { return aRightText; } + const OUString & GetLeftText() const { return rEntryContext.GetLeftText(); } + ConvDic * GetDic() { return GetConvDicImport().GetDic(); } }; /////////////////////////////////////////////////////////////////////////// diff --git a/linguistic/source/convdicxml.hxx b/linguistic/source/convdicxml.hxx index 52e99d4be1f0..eca7e9e48ce6 100644 --- a/linguistic/source/convdicxml.hxx +++ b/linguistic/source/convdicxml.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -55,7 +55,7 @@ protected: //void ExportNodes(const SmNode *pIn, int nLevel); public: - ConvDicXMLExport( ConvDic &rConvDic, + ConvDicXMLExport( ConvDic &rConvDic, const rtl::OUString &rFileName, com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler > &rHandler) : SvXMLExport ( utl::getProcessServiceFactory(), rFileName, rHandler ), @@ -66,10 +66,10 @@ public: virtual ~ConvDicXMLExport() { } - + // XServiceInfo (override parent method) ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); - + // SvXMLExport void _ExportAutoStyles() {} void _ExportMasterStyles() {} @@ -104,18 +104,18 @@ public: nConversionType = -1; bSuccess = sal_False; } - + virtual ~ConvDicXMLImport() throw () { } - + // XServiceInfo (override parent method) ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL startDocument(void) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL endDocument(void) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); - virtual SvXMLImportContext * CreateContext( + virtual SvXMLImportContext * CreateContext( sal_uInt16 nPrefix, const rtl::OUString &rLocalName, const com::sun::star::uno::Reference < com::sun::star::xml::sax::XAttributeList > &rxAttrList ); diff --git a/linguistic/source/defs.hxx b/linguistic/source/defs.hxx index 20fbce08e786..b888d86f8720 100644 --- a/linguistic/source/defs.hxx +++ b/linguistic/source/defs.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -40,7 +40,7 @@ class SvStream; /////////////////////////////////////////////////////////////////////////// -#define A2OU(x) ::rtl::OUString::createFromAscii( x ) +#define A2OU(x) ::rtl::OUString::createFromAscii( x ) typedef boost::shared_ptr< SvStream > SvStreamPtr; @@ -57,15 +57,15 @@ struct LangSvcEntries bool bDoWarnAgain; LangSvcEntries() : nLastTriedSvcIndex(-1), bAlreadyWarned(false), bDoWarnAgain(false) {} - + inline LangSvcEntries( const css::uno::Sequence< ::rtl::OUString > &rSvcImplNames ) : aSvcImplNames(rSvcImplNames), - nLastTriedSvcIndex(-1), bAlreadyWarned(false), bDoWarnAgain(false) + nLastTriedSvcIndex(-1), bAlreadyWarned(false), bDoWarnAgain(false) { } - inline LangSvcEntries( const ::rtl::OUString &rSvcImplName ) : - nLastTriedSvcIndex(-1), bAlreadyWarned(false), bDoWarnAgain(false) + inline LangSvcEntries( const ::rtl::OUString &rSvcImplName ) : + nLastTriedSvcIndex(-1), bAlreadyWarned(false), bDoWarnAgain(false) { aSvcImplNames.realloc(1); aSvcImplNames[0] = rSvcImplName; @@ -75,7 +75,7 @@ struct LangSvcEntries void SetAlreadyWarned( bool bVal ) { bAlreadyWarned = 0 != bVal; } bool IsDoWarnAgain() const { return bDoWarnAgain != 0; } void SetDoWarnAgain( bool bVal ) { bDoWarnAgain = 0 != bVal; } - + inline void Clear() { aSvcImplNames.realloc(0); @@ -99,7 +99,7 @@ struct LangSvcEntries_Grammar : public LangSvcEntries LangSvcEntries_Grammar() : LangSvcEntries() {} LangSvcEntries_Grammar( const ::rtl::OUString &rSvcImplName ) : LangSvcEntries( rSvcImplName ) {} -}; +}; struct LangSvcEntries_Hyph : public LangSvcEntries { @@ -107,7 +107,7 @@ struct LangSvcEntries_Hyph : public LangSvcEntries LangSvcEntries_Hyph() : LangSvcEntries() {} LangSvcEntries_Hyph( const ::rtl::OUString &rSvcImplName ) : LangSvcEntries( rSvcImplName ) {} -}; +}; struct LangSvcEntries_Thes : public LangSvcEntries { @@ -115,7 +115,7 @@ struct LangSvcEntries_Thes : public LangSvcEntries LangSvcEntries_Thes() : LangSvcEntries() {} LangSvcEntries_Thes( const css::uno::Sequence< ::rtl::OUString > &rSvcImplNames ) : LangSvcEntries( rSvcImplNames ) {} -}; +}; /////////////////////////////////////////////////////////////////////////// @@ -123,8 +123,8 @@ struct LangSvcEntries_Thes : public LangSvcEntries class LinguDispatcher { public: - enum DspType { DSP_SPELL, DSP_HYPH, DSP_THES, DSP_GRAMMAR }; - + enum DspType { DSP_SPELL, DSP_HYPH, DSP_THES, DSP_GRAMMAR }; + virtual void SetServiceList( const css::lang::Locale &rLocale, const css::uno::Sequence< rtl::OUString > &rSvcImplNames ) = 0; virtual css::uno::Sequence< rtl::OUString > GetServiceList( const css::lang::Locale &rLocale ) const = 0; virtual DspType GetDspType() const = 0; diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index 04fc03b49774..fe53bf344ac3 100755 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -64,14 +64,14 @@ using namespace linguistic; /////////////////////////////////////////////////////////////////////////// #define BUFSIZE 4096 -#define VERS2_NOLANGUAGE 1024 +#define VERS2_NOLANGUAGE 1024 #define MAX_HEADER_LENGTH 16 -static const sal_Char* pDicExt = "dic"; -static const sal_Char* pVerStr2 = "WBSWG2"; -static const sal_Char* pVerStr5 = "WBSWG5"; -static const sal_Char* pVerStr6 = "WBSWG6"; +static const sal_Char* pDicExt = "dic"; +static const sal_Char* pVerStr2 = "WBSWG2"; +static const sal_Char* pVerStr5 = "WBSWG5"; +static const sal_Char* pVerStr6 = "WBSWG6"; static const sal_Char* pVerOOo7 = "OOoUserDict1"; static const INT16 DIC_VERSION_DONTKNOW = -1; @@ -80,7 +80,7 @@ static const INT16 DIC_VERSION_5 = 5; static const INT16 DIC_VERSION_6 = 6; static const INT16 DIC_VERSION_7 = 7; -static sal_Bool getTag(const ByteString &rLine, +static sal_Bool getTag(const ByteString &rLine, const sal_Char *pTagName, ByteString &rTagValue) { xub_StrLen nPos = rLine.Search( pTagName ); @@ -132,7 +132,7 @@ INT16 ReadDicVersion( SvStreamPtr &rpStream, USHORT &nLng, BOOL &bNeg ) if (aTagValue == "<none>") nLng = LANGUAGE_NONE; else - nLng = MsLangId::convertIsoStringToLanguage(OUString(aTagValue.GetBuffer(), + nLng = MsLangId::convertIsoStringToLanguage(OUString(aTagValue.GetBuffer(), aTagValue.Len(), RTL_TEXTENCODING_ASCII_US)); } @@ -150,7 +150,7 @@ INT16 ReadDicVersion( SvStreamPtr &rpStream, USHORT &nLng, BOOL &bNeg ) } if (!bSuccess) return -2; - } + } else { USHORT nLen; @@ -205,14 +205,14 @@ const String GetDicExtension() DictionaryNeo::DictionaryNeo() : aDicEvtListeners( GetLinguMutex() ), - eDicType (DictionaryType_POSITIVE), - nLanguage (LANGUAGE_NONE) + eDicType (DictionaryType_POSITIVE), + nLanguage (LANGUAGE_NONE) { - nCount = 0; - nDicVersion = DIC_VERSION_DONTKNOW; + nCount = 0; + nDicVersion = DIC_VERSION_DONTKNOW; bNeedEntries = FALSE; - bIsModified = bIsActive = FALSE; - bIsReadonly = FALSE; + bIsModified = bIsActive = FALSE; + bIsReadonly = FALSE; } DictionaryNeo::DictionaryNeo(const OUString &rName, @@ -225,10 +225,10 @@ DictionaryNeo::DictionaryNeo(const OUString &rName, eDicType (eType), nLanguage (nLang) { - nCount = 0; - nDicVersion = DIC_VERSION_DONTKNOW; + nCount = 0; + nDicVersion = DIC_VERSION_DONTKNOW; bNeedEntries = TRUE; - bIsModified = bIsActive = FALSE; + bIsModified = bIsActive = FALSE; bIsReadonly = !bWriteable; if( rMainURL.getLength() > 0 ) @@ -237,12 +237,12 @@ DictionaryNeo::DictionaryNeo(const OUString &rName, if( !bExists ) { // save new dictionaries with in Format 7 (UTF8 plain text) - nDicVersion = DIC_VERSION_7; + nDicVersion = DIC_VERSION_7; //! create physical representation of an **empty** dictionary //! that could be found by the dictionary-list implementation // (Note: empty dictionaries are not just empty files!) - DBG_ASSERT( !bIsReadonly, + DBG_ASSERT( !bIsReadonly, "DictionaryNeo: dictionaries should be writeable if they are to be saved" ); if (!bIsReadonly) saveEntries( rMainURL ); @@ -263,7 +263,7 @@ DictionaryNeo::~DictionaryNeo() ULONG DictionaryNeo::loadEntries(const OUString &rMainURL) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); // counter check that it is safe to set bIsModified to FALSE at // the end of the function @@ -276,12 +276,12 @@ ULONG DictionaryNeo::loadEntries(const OUString &rMainURL) return 0; uno::Reference< lang::XMultiServiceFactory > xServiceFactory( utl::getProcessServiceFactory() ); - + // get XInputStream stream uno::Reference< io::XInputStream > xStream; try { - uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( + uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW ); xStream = xAccess->openFileRead( rMainURL ); } @@ -397,7 +397,7 @@ ULONG DictionaryNeo::loadEntries(const OUString &rMainURL) } -static ByteString formatForSave( +static ByteString formatForSave( const uno::Reference< XDictionaryEntry > &xEntry, rtl_TextEncoding eEnc ) { ByteString aStr(xEntry->getDictionaryWord().getStr(), eEnc); @@ -413,19 +413,19 @@ static ByteString formatForSave( ULONG DictionaryNeo::saveEntries(const OUString &rURL) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (rURL.getLength() == 0) return 0; DBG_ASSERT(!INetURLObject( rURL ).HasError(), "lng : invalid URL"); uno::Reference< lang::XMultiServiceFactory > xServiceFactory( utl::getProcessServiceFactory() ); - + // get XOutputStream stream uno::Reference< io::XStream > xStream; try { - uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( + uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW ); xStream = xAccess->openFileReadWrite( rURL ); } @@ -538,9 +538,9 @@ ULONG DictionaryNeo::saveEntries(const OUString &rURL) void DictionaryNeo::launchEvent(INT16 nEvent, uno::Reference< XDictionaryEntry > xEntry) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); - DictionaryEvent aEvt; + DictionaryEvent aEvt; aEvt.Source = uno::Reference< XDictionary >( this ); aEvt.nEvent = nEvent; aEvt.xDictionaryEntry = xEntry; @@ -554,11 +554,11 @@ void DictionaryNeo::launchEvent(INT16 nEvent, } } -int DictionaryNeo::cmpDicEntry(const OUString& rWord1, +int DictionaryNeo::cmpDicEntry(const OUString& rWord1, const OUString &rWord2, BOOL bSimilarOnly) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); // returns 0 if rWord1 is equal to rWord2 // " a value < 0 if rWord1 is less than rWord2 @@ -566,7 +566,7 @@ int DictionaryNeo::cmpDicEntry(const OUString& rWord1, int nRes = 0; - OUString aWord1( rWord1 ), + OUString aWord1( rWord1 ), aWord2( rWord2 ); INT32 nLen1 = aWord1.getLength(), nLen2 = aWord2.getLength(); @@ -616,7 +616,7 @@ int DictionaryNeo::cmpDicEntry(const OUString& rWord1, if (nDiff) nRes = nDiff; else - { // the string with the smallest count of not ignored chars is the + { // the string with the smallest count of not ignored chars is the // shorter one // count remaining IgnChars @@ -646,7 +646,7 @@ BOOL DictionaryNeo::seekEntry(const OUString &rWord, // if that was not found the position where it has to be inserted // to keep the entries sorted - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); const uno::Reference< XDictionaryEntry > *pEntry = aEntries.getConstArray(); INT32 nUpperIdx = getCount(), @@ -704,7 +704,7 @@ BOOL DictionaryNeo::isSorted() BOOL DictionaryNeo::addEntry_Impl(const uno::Reference< XDictionaryEntry > xDicEntry, BOOL bIsLoadEntries) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); BOOL bRes = FALSE; @@ -769,14 +769,14 @@ uno::Reference< XInterface > SAL_CALL DictionaryNeo_CreateInstance( OUString SAL_CALL DictionaryNeo::getName( ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return aDicName; } void SAL_CALL DictionaryNeo::setName( const OUString& aName ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (aDicName != aName) { @@ -788,7 +788,7 @@ void SAL_CALL DictionaryNeo::setName( const OUString& aName ) DictionaryType SAL_CALL DictionaryNeo::getDictionaryType( ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return eDicType; } @@ -796,7 +796,7 @@ DictionaryType SAL_CALL DictionaryNeo::getDictionaryType( ) void SAL_CALL DictionaryNeo::setActive( sal_Bool bActivate ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (bIsActive != bActivate) { @@ -829,14 +829,14 @@ void SAL_CALL DictionaryNeo::setActive( sal_Bool bActivate ) sal_Bool SAL_CALL DictionaryNeo::isActive( ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return bIsActive; } sal_Int32 SAL_CALL DictionaryNeo::getCount( ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (bNeedEntries) loadEntries( aMainURL ); @@ -846,7 +846,7 @@ sal_Int32 SAL_CALL DictionaryNeo::getCount( ) Locale SAL_CALL DictionaryNeo::getLocale( ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); Locale aRes; return LanguageToLocale( aRes, nLanguage ); } @@ -854,12 +854,12 @@ Locale SAL_CALL DictionaryNeo::getLocale( ) void SAL_CALL DictionaryNeo::setLocale( const Locale& aLocale ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); INT16 nLanguageP = LocaleToLanguage( aLocale ); if (!bIsReadonly && nLanguage != nLanguageP) { nLanguage = nLanguageP; - bIsModified = TRUE; // new language needs to be saved with dictionary + bIsModified = TRUE; // new language needs to be saved with dictionary launchEvent( DictionaryEventFlags::CHG_LANGUAGE, NULL ); } @@ -869,7 +869,7 @@ uno::Reference< XDictionaryEntry > SAL_CALL DictionaryNeo::getEntry( const OUString& aWord ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (bNeedEntries) loadEntries( aMainURL ); @@ -887,7 +887,7 @@ sal_Bool SAL_CALL DictionaryNeo::addEntry( const uno::Reference< XDictionaryEntry >& xDicEntry ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); BOOL bRes = FALSE; @@ -906,7 +906,7 @@ sal_Bool SAL_CALL const OUString& rRplcText ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); BOOL bRes = FALSE; @@ -943,7 +943,7 @@ void lcl_SequenceRemoveElementAt( sal_Bool SAL_CALL DictionaryNeo::remove( const OUString& aWord ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); BOOL bRemoved = FALSE; @@ -982,7 +982,7 @@ sal_Bool SAL_CALL DictionaryNeo::remove( const OUString& aWord ) sal_Bool SAL_CALL DictionaryNeo::isFull( ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (bNeedEntries) loadEntries( aMainURL ); @@ -993,7 +993,7 @@ uno::Sequence< uno::Reference< XDictionaryEntry > > SAL_CALL DictionaryNeo::getEntries( ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (bNeedEntries) loadEntries( aMainURL ); @@ -1007,7 +1007,7 @@ uno::Sequence< uno::Reference< XDictionaryEntry > > void SAL_CALL DictionaryNeo::clear( ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (!bIsReadonly && nCount) { @@ -1026,7 +1026,7 @@ sal_Bool SAL_CALL DictionaryNeo::addDictionaryEventListener( const uno::Reference< XDictionaryEventListener >& xListener ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); BOOL bRes = FALSE; if (xListener.is()) @@ -1041,7 +1041,7 @@ sal_Bool SAL_CALL DictionaryNeo::removeDictionaryEventListener( const uno::Reference< XDictionaryEventListener >& xListener ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); BOOL bRes = FALSE; if (xListener.is()) @@ -1056,21 +1056,21 @@ sal_Bool SAL_CALL DictionaryNeo::removeDictionaryEventListener( sal_Bool SAL_CALL DictionaryNeo::hasLocation() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return aMainURL.getLength() > 0; } OUString SAL_CALL DictionaryNeo::getLocation() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return aMainURL; } sal_Bool SAL_CALL DictionaryNeo::isReadonly() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return bIsReadonly; } @@ -1078,7 +1078,7 @@ sal_Bool SAL_CALL DictionaryNeo::isReadonly() void SAL_CALL DictionaryNeo::store() throw(io::IOException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (bIsModified && hasLocation() && !isReadonly()) { @@ -1098,7 +1098,7 @@ void SAL_CALL DictionaryNeo::storeAsURL( const uno::Sequence< beans::PropertyValue >& /*rArgs*/ ) throw(io::IOException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (saveEntries( aURL )) { @@ -1119,7 +1119,7 @@ void SAL_CALL DictionaryNeo::storeToURL( const uno::Sequence< beans::PropertyValue >& /*rArgs*/ ) throw(io::IOException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (saveEntries( aURL )) { @@ -1146,7 +1146,7 @@ DicEntry::DicEntry(const OUString &rDicFileWord, DicEntry::DicEntry(const OUString &rDicWord, BOOL bNegativ, const OUString &rRplcText) : - aDicWord (rDicWord), + aDicWord (rDicWord), aReplacement (rRplcText), bIsNegativ (bNegativ) { @@ -1160,7 +1160,7 @@ void DicEntry::splitDicFileWord(const OUString &rDicFileWord, OUString &rDicWord, OUString &rReplacement) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); static const OUString aDelim( A2OU( "==" ) ); @@ -1168,15 +1168,15 @@ void DicEntry::splitDicFileWord(const OUString &rDicFileWord, if (-1 != nDelimPos) { sal_Int32 nTriplePos = nDelimPos + 2; - if ( nTriplePos < rDicFileWord.getLength() + if ( nTriplePos < rDicFileWord.getLength() && rDicFileWord[ nTriplePos ] == '=' ) ++nDelimPos; - rDicWord = rDicFileWord.copy( 0, nDelimPos ); + rDicWord = rDicFileWord.copy( 0, nDelimPos ); rReplacement = rDicFileWord.copy( nDelimPos + 2 ); } else { - rDicWord = rDicFileWord; + rDicWord = rDicFileWord; rReplacement = OUString(); } } @@ -1184,21 +1184,21 @@ void DicEntry::splitDicFileWord(const OUString &rDicFileWord, OUString SAL_CALL DicEntry::getDictionaryWord( ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return aDicWord; } sal_Bool SAL_CALL DicEntry::isNegative( ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return bIsNegativ; } OUString SAL_CALL DicEntry::getReplacementText( ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return aReplacement; } diff --git a/linguistic/source/dicimp.hxx b/linguistic/source/dicimp.hxx index 7bdda6b6bacf..eca18c2166d3 100644 --- a/linguistic/source/dicimp.hxx +++ b/linguistic/source/dicimp.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -32,9 +32,9 @@ #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include <cppuhelper/implbase2.hxx> // helper for implementations -#include <cppuhelper/implbase1.hxx> // helper for implementations +#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include <cppuhelper/implbase2.hxx> // helper for implementations +#include <cppuhelper/implbase1.hxx> // helper for implementations #include <cppuhelper/interfacecontainer.h> #include <tools/string.hxx> #include <tools/stream.hxx> @@ -60,39 +60,39 @@ class DictionaryNeo : > { - ::cppu::OInterfaceContainerHelper aDicEvtListeners; + ::cppu::OInterfaceContainerHelper aDicEvtListeners; ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XDictionaryEntry > > aEntries; - ::rtl::OUString aDicName; - ::rtl::OUString aMainURL; - ::com::sun::star::linguistic2::DictionaryType eDicType; - INT16 nCount; - INT16 nLanguage; - INT16 nDicVersion; - BOOL bNeedEntries; - BOOL bIsModified; - BOOL bIsActive; - BOOL bIsReadonly; + ::com::sun::star::linguistic2::XDictionaryEntry > > aEntries; + ::rtl::OUString aDicName; + ::rtl::OUString aMainURL; + ::com::sun::star::linguistic2::DictionaryType eDicType; + INT16 nCount; + INT16 nLanguage; + INT16 nDicVersion; + BOOL bNeedEntries; + BOOL bIsModified; + BOOL bIsActive; + BOOL bIsReadonly; // disallow copy-constructor and assignment-operator for now DictionaryNeo(const DictionaryNeo &); DictionaryNeo & operator = (const DictionaryNeo &); - void launchEvent(INT16 nEvent, - ::com::sun::star::uno::Reference< + void launchEvent(INT16 nEvent, + ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryEntry > xEntry); ULONG loadEntries(const ::rtl::OUString &rMainURL); ULONG saveEntries(const ::rtl::OUString &rMainURL); - int cmpDicEntry(const ::rtl::OUString &rWord1, + int cmpDicEntry(const ::rtl::OUString &rWord1, const ::rtl::OUString &rWord2, BOOL bSimilarOnly = FALSE); - BOOL seekEntry(const ::rtl::OUString &rWord, INT32 *pPos, + BOOL seekEntry(const ::rtl::OUString &rWord, INT32 *pPos, BOOL bSimilarOnly = FALSE); - BOOL isSorted(); + BOOL isSorted(); - BOOL addEntry_Impl(const ::com::sun::star::uno::Reference< + BOOL addEntry_Impl(const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryEntry > xDicEntry, BOOL bIsLoadEntries = FALSE); @@ -105,114 +105,114 @@ public: virtual ~DictionaryNeo(); // XNamed - virtual ::rtl::OUString SAL_CALL - getName() + virtual ::rtl::OUString SAL_CALL + getName() throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL - setName( const ::rtl::OUString& aName ) + virtual void SAL_CALL + setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException); // XDictionary - virtual ::com::sun::star::linguistic2::DictionaryType SAL_CALL - getDictionaryType() + virtual ::com::sun::star::linguistic2::DictionaryType SAL_CALL + getDictionaryType() throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL - setActive( sal_Bool bActivate ) + virtual void SAL_CALL + setActive( sal_Bool bActivate ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL - isActive() + virtual sal_Bool SAL_CALL + isActive() throw(::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL - getCount() + virtual sal_Int32 SAL_CALL + getCount() throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::lang::Locale SAL_CALL - getLocale() + virtual ::com::sun::star::lang::Locale SAL_CALL + getLocale() throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL - setLocale( const ::com::sun::star::lang::Locale& aLocale ) + virtual void SAL_CALL + setLocale( const ::com::sun::star::lang::Locale& aLocale ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XDictionaryEntry > SAL_CALL - getEntry( const ::rtl::OUString& aWord ) + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XDictionaryEntry > SAL_CALL + getEntry( const ::rtl::OUString& aWord ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL - addEntry( const ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XDictionaryEntry >& xDicEntry ) + virtual sal_Bool SAL_CALL + addEntry( const ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XDictionaryEntry >& xDicEntry ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL - add( const ::rtl::OUString& aWord, sal_Bool bIsNegative, - const ::rtl::OUString& aRplcText ) + virtual sal_Bool SAL_CALL + add( const ::rtl::OUString& aWord, sal_Bool bIsNegative, + const ::rtl::OUString& aRplcText ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL - remove( const ::rtl::OUString& aWord ) + virtual sal_Bool SAL_CALL + remove( const ::rtl::OUString& aWord ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL - isFull() + virtual sal_Bool SAL_CALL + isFull() throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XDictionaryEntry > > SAL_CALL - getEntries() + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XDictionaryEntry > > SAL_CALL + getEntries() throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL - clear() + virtual void SAL_CALL + clear() throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL - addDictionaryEventListener( const ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XDictionaryEventListener >& xListener ) + virtual sal_Bool SAL_CALL + addDictionaryEventListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XDictionaryEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL - removeDictionaryEventListener( const ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XDictionaryEventListener >& xListener ) + virtual sal_Bool SAL_CALL + removeDictionaryEventListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XDictionaryEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); // XStorable - virtual sal_Bool SAL_CALL - hasLocation() + virtual sal_Bool SAL_CALL + hasLocation() throw(::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL - getLocation() + virtual ::rtl::OUString SAL_CALL + getLocation() throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL - isReadonly() + virtual sal_Bool SAL_CALL + isReadonly() throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL - store() - throw(::com::sun::star::io::IOException, + virtual void SAL_CALL + store() + throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL - storeAsURL( const ::rtl::OUString& aURL, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& aArgs ) - throw(::com::sun::star::io::IOException, + virtual void SAL_CALL + storeAsURL( const ::rtl::OUString& aURL, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& aArgs ) + throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL - storeToURL( const ::rtl::OUString& aURL, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& aArgs ) - throw(::com::sun::star::io::IOException, + virtual void SAL_CALL + storeToURL( const ::rtl::OUString& aURL, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& aArgs ) + throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); }; /////////////////////////////////////////////////////////////////////////// -class DicEntry : +class DicEntry : public cppu::WeakImplHelper1 < ::com::sun::star::linguistic2::XDictionaryEntry > { - ::rtl::OUString aDicWord, // including hyphen positions represented by "=" - aReplacement; // including hyphen positions represented by "=" - BOOL bIsNegativ; + ::rtl::OUString aDicWord, // including hyphen positions represented by "=" + aReplacement; // including hyphen positions represented by "=" + BOOL bIsNegativ; // disallow copy-constructor and assignment-operator for now DicEntry(const DicEntry &); DicEntry & operator = (const DicEntry &); - void splitDicFileWord(const ::rtl::OUString &rDicFileWord, - ::rtl::OUString &rDicWord, + void splitDicFileWord(const ::rtl::OUString &rDicFileWord, + ::rtl::OUString &rDicWord, ::rtl::OUString &rReplacement); public: @@ -223,11 +223,11 @@ public: virtual ~DicEntry(); // XDictionaryEntry - virtual ::rtl::OUString SAL_CALL + virtual ::rtl::OUString SAL_CALL getDictionaryWord() throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL + virtual sal_Bool SAL_CALL isNegative() throw(::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL + virtual ::rtl::OUString SAL_CALL getReplacementText() throw(::com::sun::star::uno::RuntimeException); }; diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index 989d0588e473..817dbeb311ca 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -37,7 +37,7 @@ #include <i18npool/mslangid.hxx> #include <unotools/pathoptions.hxx> #include <unotools/useroptions.hxx> -#include <cppuhelper/factory.hxx> // helper for factories +#include <cppuhelper/factory.hxx> // helper for factories #include <unotools/localfilehelper.hxx> #include <comphelper/processfactory.hxx> #include <unotools/ucbstreamhelper.hxx> @@ -86,10 +86,10 @@ class DicEvtListenerHelper : { cppu::OInterfaceContainerHelper aDicListEvtListeners; uno::Sequence< DictionaryEvent > aCollectDicEvt; - uno::Reference< XDictionaryList > xMyDicList; + uno::Reference< XDictionaryList > xMyDicList; - INT16 nCondensedEvt; - INT16 nNumCollectEvtListeners, + INT16 nCondensedEvt; + INT16 nNumCollectEvtListeners, nNumVerboseListeners; public: @@ -107,27 +107,27 @@ public: throw(RuntimeException); // non-UNO functions - void DisposeAndClear( const EventObject &rEvtObj ); + void DisposeAndClear( const EventObject &rEvtObj ); - BOOL AddDicListEvtListener( + BOOL AddDicListEvtListener( const uno::Reference< XDictionaryListEventListener >& rxListener, BOOL bReceiveVerbose ); - BOOL RemoveDicListEvtListener( + BOOL RemoveDicListEvtListener( const uno::Reference< XDictionaryListEventListener >& rxListener ); - INT16 BeginCollectEvents(); - INT16 EndCollectEvents(); - INT16 FlushEvents(); + INT16 BeginCollectEvents(); + INT16 EndCollectEvents(); + INT16 FlushEvents(); void ClearEvents() { nCondensedEvt = 0; } }; DicEvtListenerHelper::DicEvtListenerHelper( const uno::Reference< XDictionaryList > &rxDicList ) : - aDicListEvtListeners ( GetLinguMutex() ), - xMyDicList ( rxDicList ) + aDicListEvtListeners ( GetLinguMutex() ), + xMyDicList ( rxDicList ) { - nCondensedEvt = 0; - nNumCollectEvtListeners = nNumVerboseListeners = 0; + nCondensedEvt = 0; + nNumCollectEvtListeners = nNumVerboseListeners = 0; } @@ -235,7 +235,7 @@ BOOL DicEvtListenerHelper::AddDicListEvtListener( BOOL /*bReceiveVerbose*/ ) { DBG_ASSERT( xListener.is(), "empty reference" ); - INT32 nCount = aDicListEvtListeners.getLength(); + INT32 nCount = aDicListEvtListeners.getLength(); return aDicListEvtListeners.addInterface( xListener ) != nCount; } @@ -244,7 +244,7 @@ BOOL DicEvtListenerHelper::RemoveDicListEvtListener( const uno::Reference< XDictionaryListEventListener >& xListener ) { DBG_ASSERT( xListener.is(), "empty reference" ); - INT32 nCount = aDicListEvtListeners.getLength(); + INT32 nCount = aDicListEvtListeners.getLength(); return aDicListEvtListeners.removeInterface( xListener ) != nCount; } @@ -308,8 +308,8 @@ void DicList::MyAppExitListener::AtExit() DicList::DicList() : aEvtListeners ( GetLinguMutex() ) { - pDicEvtLstnrHelper = new DicEvtListenerHelper( this ); - xDicEvtLstnrHelper = pDicEvtLstnrHelper; + pDicEvtLstnrHelper = new DicEvtListenerHelper( this ); + xDicEvtLstnrHelper = pDicEvtLstnrHelper; bDisposing = FALSE; bInCreation = FALSE; @@ -341,8 +341,8 @@ void DicList::SearchForDictionaries( for (INT32 i = 0; i < nEntries; ++i) { String aURL( pDirCnt[i] ); - USHORT nLang = LANGUAGE_NONE; - BOOL bNeg = FALSE; + USHORT nLang = LANGUAGE_NONE; + BOOL bNeg = FALSE; if(!::IsVers2OrNewer( aURL, nLang, bNeg )) { @@ -377,7 +377,7 @@ void DicList::SearchForDictionaries( if(aTmp1 == aTmp2) break; } - if(j >= nCount) // dictionary not yet in DicList + if(j >= nCount) // dictionary not yet in DicList { // get decoded dictionary file name INetURLObject aURLObj( aURL ); @@ -533,7 +533,7 @@ sal_Bool SAL_CALL DicList::addDictionaryListEventListener( DBG_ASSERT(!bReceiveVerbose, "lng : not yet supported"); BOOL bRes = FALSE; - if (xListener.is()) //! don't add empty references + if (xListener.is()) //! don't add empty references { bRes = pDicEvtLstnrHelper-> AddDicListEvtListener( xListener, bReceiveVerbose ); @@ -609,7 +609,7 @@ void SAL_CALL if (!bDisposing) { bDisposing = TRUE; - EventObject aEvtObj( (XDictionaryList *) this ); + EventObject aEvtObj( (XDictionaryList *) this ); aEvtListeners.disposeAndClear( aEvtObj ); if (pDicEvtLstnrHelper) @@ -821,7 +821,7 @@ sal_Bool SAL_CALL DicList_writeInfo( } -void * SAL_CALL DicList_getFactory( const sal_Char * pImplName, +void * SAL_CALL DicList_getFactory( const sal_Char * pImplName, XMultiServiceFactory * pServiceManager, void * ) { void * pRet = 0; @@ -857,18 +857,18 @@ xub_StrLen lcl_GetToken( String &rToken, } else { - xub_StrLen i; + xub_StrLen i; for (i = nPos; i < rText.Len(); ++i) { if (STRING_NOTFOUND != rDelim.Search( rText.GetChar(i) )) break; } - if (i >= rText.Len()) // delimeter not found - rToken = rText.Copy( nPos ); + if (i >= rText.Len()) // delimeter not found + rToken = rText.Copy( nPos ); else rToken = rText.Copy( nPos, sal::static_int_cast< xub_StrLen >((INT32) i - nPos) ); - nRes = i + 1; // continue after found delimeter + nRes = i + 1; // continue after found delimeter } return nRes; @@ -888,7 +888,7 @@ static void AddInternal( String aDelim( aDummy, osl_getThreadTextEncoding() ); aDelim.EraseAllChars( '.' ); - String aToken; + String aToken; xub_StrLen nPos = 0; while (STRING_LEN != (nPos = lcl_GetToken( aToken, rNew, nPos, aDelim ))) @@ -943,7 +943,7 @@ static BOOL IsVers2OrNewer( const String& rFileURL, USHORT& nLng, BOOL& bNeg ) uno::Reference< io::XInputStream > xStream; try { - uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( + uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW ); xStream = xAccess->openFileRead( rFileURL ); } @@ -957,7 +957,7 @@ static BOOL IsVers2OrNewer( const String& rFileURL, USHORT& nLng, BOOL& bNeg ) return FALSE; SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) ); - + int nDicVersion = ReadDicVersion(pStream, nLng, bNeg); if (2 == nDicVersion || nDicVersion >= 5) return TRUE; diff --git a/linguistic/source/dlistimp.hxx b/linguistic/source/dlistimp.hxx index 336707ab41f5..c93cd6b907c6 100644 --- a/linguistic/source/dlistimp.hxx +++ b/linguistic/source/dlistimp.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -32,9 +32,9 @@ #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include <cppuhelper/implbase1.hxx> // helper for implementations -#include <cppuhelper/implbase3.hxx> // helper for implementations +#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include <cppuhelper/implbase1.hxx> // helper for implementations +#include <cppuhelper/implbase3.hxx> // helper for implementations #include <cppuhelper/interfacecontainer.h> #include <tools/debug.hxx> @@ -62,25 +62,25 @@ class DicList : public: MyAppExitListener( DicList &rDicList ) : rMyDicList( rDicList ) {} - virtual void AtExit(); + virtual void AtExit(); }; - LinguOptions aOpt; + LinguOptions aOpt; + + ::cppu::OInterfaceContainerHelper aEvtListeners; - ::cppu::OInterfaceContainerHelper aEvtListeners; - typedef std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > > DictionaryVec_t; DictionaryVec_t aDicList; ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2:: - XDictionaryEventListener > xDicEvtLstnrHelper; - DicEvtListenerHelper *pDicEvtLstnrHelper; + XDictionaryEventListener > xDicEvtLstnrHelper; + DicEvtListenerHelper *pDicEvtLstnrHelper; ::com::sun::star::uno::Reference< ::com::sun::star::frame:: - XTerminateListener > xExitListener; - MyAppExitListener *pExitListener; + XTerminateListener > xExitListener; + MyAppExitListener *pExitListener; - BOOL bDisposing; + BOOL bDisposing; BOOL bInCreation; // disallow copy-constructor and assignment-operator for now diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index 101c231db630..6485e6e841b7 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -85,7 +85,7 @@ static uno::Sequence< OUString > GrammarCheckingIterator_getSupportedServiceName ////////////////////////////////////////////////////////////////////// // white space list: obtained from the fonts.config.txt of a Linux system. -static sal_Unicode aWhiteSpaces[] = +static sal_Unicode aWhiteSpaces[] = { 0x0020, /* SPACE */ 0x00a0, /* NO-BREAK SPACE */ @@ -146,9 +146,9 @@ static bool lcl_IsWhiteSpace( sal_Unicode cChar ) { if (cChar == aWhiteSpaces[i]) bFound = true; - } + } return bFound; -} +} static sal_Int32 lcl_SkipWhiteSpaces( const OUString &rText, sal_Int32 nStartPos ) { @@ -183,7 +183,7 @@ static sal_Int32 lcl_SkipWhiteSpaces( const OUString &rText, sal_Int32 nStartPos DBG_ASSERT( 0 <= nRes && nRes <= nLen, "lcl_SkipWhiteSpaces return value out of range" ); return nRes; -} +} static sal_Int32 lcl_BacktraceWhiteSpaces( const OUString &rText, sal_Int32 nStartPos ) { @@ -222,10 +222,10 @@ static sal_Int32 lcl_BacktraceWhiteSpaces( const OUString &rText, sal_Int32 nSta nRes = pText - pStart + 1; } } - + DBG_ASSERT( 0 <= nRes && nRes <= nLen, "lcl_BacktraceWhiteSpaces return value out of range" ); return nRes; -} +} ////////////////////////////////////////////////////////////////////// @@ -302,11 +302,11 @@ sal_Int32 GrammarCheckingIterator::NextDocId() } -OUString GrammarCheckingIterator::GetOrCreateDocId( +OUString GrammarCheckingIterator::GetOrCreateDocId( const uno::Reference< lang::XComponent > &xComponent ) { // internal method; will always be called with locked mutex - + OUString aRes; if (xComponent.is()) { @@ -322,10 +322,10 @@ OUString GrammarCheckingIterator::GetOrCreateDocId( m_aDocIdMap[ xComponent.get() ] = aRes; xComponent->addEventListener( this ); } - } + } return aRes; } - + void GrammarCheckingIterator::AddEntry( uno::WeakReference< text::XFlatParagraphIterator > xFlatParaIterator, @@ -374,14 +374,14 @@ void GrammarCheckingIterator::ProcessResult( // // mark found errors... // - + sal_Int32 nTextLen = rRes.aText.getLength(); bool bBoundariesOk = 0 <= rRes.nStartOfSentencePosition && rRes.nStartOfSentencePosition <= nTextLen && 0 <= rRes.nBehindEndOfSentencePosition && rRes.nBehindEndOfSentencePosition <= nTextLen && 0 <= rRes.nStartOfNextSentencePosition && rRes.nStartOfNextSentencePosition <= nTextLen && - rRes.nStartOfSentencePosition <= rRes.nBehindEndOfSentencePosition && + rRes.nStartOfSentencePosition <= rRes.nBehindEndOfSentencePosition && rRes.nBehindEndOfSentencePosition <= rRes.nStartOfNextSentencePosition; - (void) bBoundariesOk; + (void) bBoundariesOk; DBG_ASSERT( bBoundariesOk, "inconsistent sentence boundaries" ); uno::Sequence< linguistic2::SingleProofreadingError > aErrors = rRes.aErrors; @@ -400,33 +400,33 @@ void GrammarCheckingIterator::ProcessResult( { const linguistic2::SingleProofreadingError &rError = rRes.aErrors[i]; text::TextMarkupDescriptor &rDesc = aDescriptors[i]; - + rDesc.nType = rError.nErrorType; rDesc.nOffset = rError.nErrorStart; rDesc.nLength = rError.nErrorLength; - + // the proofreader may return SPELLING but right now our core // does only handle PROOFREADING if the result is from the proofreader... // (later on we may wish to color spelling errors found by the proofreader // differently for example. But no special handling right now. if (rDesc.nType == text::TextMarkupType::SPELLCHECK) rDesc.nType = text::TextMarkupType::PROOFREADING; - } - + } + // at pos nErrors -> sentence markup // nSentenceLength: includes the white-spaces following the sentence end... const sal_Int32 nSentenceLength = rRes.nStartOfNextSentencePosition - rRes.nStartOfSentencePosition; pDescriptors[ nErrors ].nType = text::TextMarkupType::SENTENCE; pDescriptors[ nErrors ].nOffset = rRes.nStartOfSentencePosition; pDescriptors[ nErrors ].nLength = nSentenceLength; - + xMulti->commitMultiTextMarkup( aDescriptors ) ; } catch (lang::IllegalArgumentException &) { DBG_ERROR( "commitMultiTextMarkup: IllegalArgumentException exception caught" ); - } - } + } + } // other sentences left to be checked in this paragraph? if (rRes.nStartOfNextSentencePosition < rRes.aText.getLength()) @@ -488,9 +488,9 @@ uno::Reference< linguistic2::XProofreader > GrammarCheckingIterator::GetGrammarC { try { - uno::Reference< lang::XMultiServiceFactory > xMgr( + uno::Reference< lang::XMultiServiceFactory > xMgr( utl::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - uno::Reference< linguistic2::XProofreader > xGC( + uno::Reference< linguistic2::XProofreader > xGC( xMgr->createInstance( aSvcImplName ), uno::UNO_QUERY_THROW ); uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xGC, uno::UNO_QUERY_THROW ); @@ -498,7 +498,7 @@ uno::Reference< linguistic2::XProofreader > GrammarCheckingIterator::GetGrammarC { m_aGCReferencesByService[ aSvcImplName ] = xGC; xRes = xGC; - + uno::Reference< linguistic2::XLinguServiceEventBroadcaster > xBC( xGC, uno::UNO_QUERY ); if (xBC.is()) xBC->addLinguServiceEventListener( this ); @@ -512,8 +512,8 @@ uno::Reference< linguistic2::XProofreader > GrammarCheckingIterator::GetGrammarC { DBG_ASSERT( 0, "instantiating grammar checker failed" ); } - } - } + } + } // ---- THREAD SAFE END ---- return xRes; @@ -537,7 +537,7 @@ void GrammarCheckingIterator::DequeueAndCheck() // ---- THREAD SAFE START ---- bool bQueueEmpty = false; { - ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); + ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); bQueueEmpty = m_aFPEntriesQueue.empty(); } // ---- THREAD SAFE END ---- @@ -551,7 +551,7 @@ void GrammarCheckingIterator::DequeueAndCheck() sal_Bool bModified = sal_False; // ---- THREAD SAFE START ---- { - ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); + ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); aFPEntryItem = m_aFPEntriesQueue.front(); xFPIterator = aFPEntryItem.m_xParaIterator; xFlatPara = aFPEntryItem.m_xPara; @@ -575,7 +575,7 @@ void GrammarCheckingIterator::DequeueAndCheck() sal_Int32 nStartPos = aFPEntryItem.m_nStartIndex; sal_Int32 nSuggestedEnd = GetSuggestedEndOfSentence( aCurTxt, nStartPos, aCurLocale ); - DBG_ASSERT( (nSuggestedEnd == 0 && aCurTxt.getLength() == 0) || nSuggestedEnd > nStartPos, + DBG_ASSERT( (nSuggestedEnd == 0 && aCurTxt.getLength() == 0) || nSuggestedEnd > nStartPos, "nSuggestedEndOfSentencePos calculation failed?" ); linguistic2::ProofreadingResult aRes; @@ -586,15 +586,15 @@ void GrammarCheckingIterator::DequeueAndCheck() aGuard.clear(); uno::Sequence< beans::PropertyValue > aEmptyProps; aRes = xGC->doProofreading( aCurDocId, aCurTxt, aCurLocale, nStartPos, nSuggestedEnd, aEmptyProps ); - - //!! work-around to prevent looping if the grammar checker + + //!! work-around to prevent looping if the grammar checker //!! failed to properly identify the sentence end if (aRes.nBehindEndOfSentencePosition <= nStartPos) { DBG_ASSERT( 0, "!! Grammarchecker failed to provide end of sentence !!" ); aRes.nBehindEndOfSentencePosition = nSuggestedEnd; } - + aRes.xFlatParagraph = xFlatPara; aRes.nStartOfSentencePosition = nStartPos; } @@ -606,14 +606,14 @@ void GrammarCheckingIterator::DequeueAndCheck() aRes.xFlatParagraph = xFlatPara; aRes.aText = aCurTxt; aRes.aLocale = aCurLocale; - aRes.nStartOfSentencePosition = nStartPos; + aRes.nStartOfSentencePosition = nStartPos; aRes.nBehindEndOfSentencePosition = nSuggestedEnd; } aRes.nStartOfNextSentencePosition = lcl_SkipWhiteSpaces( aCurTxt, aRes.nBehindEndOfSentencePosition ); aRes.nBehindEndOfSentencePosition = lcl_BacktraceWhiteSpaces( aCurTxt, aRes.nStartOfNextSentencePosition ); - + //guard has to be cleared as ProcessResult calls out of this class - aGuard.clear(); + aGuard.clear(); ProcessResult( aRes, xFPIterator, aFPEntryItem.m_bAutomatic ); // ---- THREAD SAFE END ---- } @@ -721,7 +721,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) sal_Int32 nOldStartOfSentencePos = nStartPos; uno::Reference< linguistic2::XProofreader > xGC; OUString aDocId; - + // ---- THREAD SAFE START ---- { ::osl::ClearableGuard< ::osl::Mutex > aGuard( MyMutex::get() ); @@ -738,7 +738,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) uno::Sequence< beans::PropertyValue > aEmptyProps; aTmpRes = xGC->doProofreading( aDocId, rText, aCurLocale, nStartPos, nSuggestedEndOfSentencePos, aEmptyProps ); - //!! work-around to prevent looping if the grammar checker + //!! work-around to prevent looping if the grammar checker //!! failed to properly identify the sentence end if (aTmpRes.nBehindEndOfSentencePosition <= nStartPos) { @@ -746,10 +746,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) aTmpRes.nBehindEndOfSentencePosition = nSuggestedEndOfSentencePos; } - aTmpRes.xFlatParagraph = xFlatPara; + aTmpRes.xFlatParagraph = xFlatPara; aTmpRes.nStartOfSentencePosition = nStartPos; nEndPos = aTmpRes.nBehindEndOfSentencePosition; - + if ((nErrorPosInPara< 0 || nStartPos <= nErrorPosInPara) && nErrorPosInPara < nEndPos) bFound = true; } @@ -765,10 +765,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) { DBG_ASSERT( 0, "end-of-sentence detection failed?" ); nStartPos = nOldStartOfSentencePos + 1; - } + } } while (!bFound && nStartPos < rText.getLength()); - + if (bFound && !xFlatPara->isModified()) aRes = aTmpRes; } @@ -783,13 +783,13 @@ sal_Int32 GrammarCheckingIterator::GetSuggestedEndOfSentence( const lang::Locale &rLocale ) { // internal method; will always be called with locked mutex - + uno::Reference< i18n::XBreakIterator > xBreakIterator; if (!m_xBreakIterator.is()) { uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); if ( xMSF.is() ) - xBreakIterator = uno::Reference < i18n::XBreakIterator >( xMSF->createInstance( + xBreakIterator = uno::Reference < i18n::XBreakIterator >( xMSF->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.i18n.BreakIterator") ), uno::UNO_QUERY ); } sal_Int32 nTextLen = rText.getLength(); @@ -815,7 +815,7 @@ sal_Int32 GrammarCheckingIterator::GetSuggestedEndOfSentence( } -void SAL_CALL GrammarCheckingIterator::resetIgnoreRules( ) +void SAL_CALL GrammarCheckingIterator::resetIgnoreRules( ) throw (uno::RuntimeException) { GCReferences_t::iterator aIt( m_aGCReferencesByService.begin() ); @@ -825,9 +825,9 @@ throw (uno::RuntimeException) if (xGC.is()) xGC->resetIgnoreRules(); ++aIt; - } + } } - + sal_Bool SAL_CALL GrammarCheckingIterator::isProofreading( const uno::Reference< uno::XInterface >& xDoc ) @@ -859,7 +859,7 @@ throw (uno::RuntimeException) { // we need to check if there is an entry for that document in the queue... // That is the document is going to be checked sooner or later. - + sal_Int32 nSize = m_aFPEntriesQueue.size(); for (sal_Int32 i = 0; i < nSize && !bRes; ++i) { @@ -867,7 +867,7 @@ throw (uno::RuntimeException) bRes = sal_True; } } - } + } } // ---- THREAD SAFE END ---- @@ -875,8 +875,8 @@ throw (uno::RuntimeException) } -void SAL_CALL GrammarCheckingIterator::processLinguServiceEvent( - const linguistic2::LinguServiceEvent& rLngSvcEvent ) +void SAL_CALL GrammarCheckingIterator::processLinguServiceEvent( + const linguistic2::LinguServiceEvent& rLngSvcEvent ) throw (uno::RuntimeException) { if (rLngSvcEvent.nEvent == linguistic2::LinguServiceEventFlags::PROOFREAD_AGAIN) @@ -885,7 +885,7 @@ throw (uno::RuntimeException) { uno::Reference< uno::XInterface > xThis( dynamic_cast< XLinguServiceEventBroadcaster * >(this) ); linguistic2::LinguServiceEvent aEvent( xThis, linguistic2::LinguServiceEventFlags::PROOFREAD_AGAIN ); - m_aNotifyListeners.notifyEach( + m_aNotifyListeners.notifyEach( &linguistic2::XLinguServiceEventListener::processLinguServiceEvent, aEvent); } @@ -904,8 +904,8 @@ throw (uno::RuntimeException) } -sal_Bool SAL_CALL GrammarCheckingIterator::addLinguServiceEventListener( - const uno::Reference< linguistic2::XLinguServiceEventListener >& xListener ) +sal_Bool SAL_CALL GrammarCheckingIterator::addLinguServiceEventListener( + const uno::Reference< linguistic2::XLinguServiceEventListener >& xListener ) throw (uno::RuntimeException) { if (xListener.is()) @@ -917,8 +917,8 @@ throw (uno::RuntimeException) } -sal_Bool SAL_CALL GrammarCheckingIterator::removeLinguServiceEventListener( - const uno::Reference< linguistic2::XLinguServiceEventListener >& xListener ) +sal_Bool SAL_CALL GrammarCheckingIterator::removeLinguServiceEventListener( + const uno::Reference< linguistic2::XLinguServiceEventListener >& xListener ) throw (uno::RuntimeException) { if (xListener.is()) @@ -953,11 +953,11 @@ throw (uno::RuntimeException) // ---- THREAD SAFE START ---- - { + { ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); // releaase all UNO references - + m_xMSF.clear(); m_xBreakIterator.clear(); @@ -997,7 +997,7 @@ throw (uno::RuntimeException) } -void SAL_CALL GrammarCheckingIterator::disposing( const lang::EventObject &rSource ) +void SAL_CALL GrammarCheckingIterator::disposing( const lang::EventObject &rSource ) throw (uno::RuntimeException) { // if the component (document) is disposing release all references @@ -1030,9 +1030,9 @@ uno::Reference< util::XChangesBatch > GrammarCheckingIterator::GetUpdateAccess() uno::Reference< lang::XMultiServiceFactory > xMgr = utl::getProcessServiceFactory(); if (xMgr.is()) { - xConfigurationProvider = uno::Reference< lang::XMultiServiceFactory > ( + xConfigurationProvider = uno::Reference< lang::XMultiServiceFactory > ( xMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.configuration.ConfigurationProvider" ) ) ), + "com.sun.star.configuration.ConfigurationProvider" ) ) ), uno::UNO_QUERY_THROW ) ; } @@ -1042,19 +1042,19 @@ uno::Reference< util::XChangesBatch > GrammarCheckingIterator::GetUpdateAccess() aValue.Value = uno::makeAny( A2OU("org.openoffice.Office.Linguistic/ServiceManager") ); uno::Sequence< uno::Any > aProps(1); aProps[0] <<= aValue; - m_xUpdateAccess = uno::Reference< util::XChangesBatch >( + m_xUpdateAccess = uno::Reference< util::XChangesBatch >( xConfigurationProvider->createInstanceWithArguments( - A2OU( "com.sun.star.configuration.ConfigurationUpdateAccess" ), aProps ), + A2OU( "com.sun.star.configuration.ConfigurationUpdateAccess" ), aProps ), uno::UNO_QUERY_THROW ); } catch (uno::Exception &) { - } + } } - return m_xUpdateAccess; + return m_xUpdateAccess; } - + void GrammarCheckingIterator::GetConfiguredGCSvcs_Impl() { @@ -1067,7 +1067,7 @@ void GrammarCheckingIterator::GetConfiguredGCSvcs_Impl() xNA.set( xNA->getByName( A2OU("GrammarCheckerList") ), uno::UNO_QUERY_THROW ); const uno::Sequence< OUString > aElementNames( xNA->getElementNames() ); const OUString *pElementNames = aElementNames.getConstArray(); - + sal_Int32 nLen = aElementNames.getLength(); for (sal_Int32 i = 0; i < nLen; ++i) { @@ -1081,13 +1081,13 @@ void GrammarCheckingIterator::GetConfiguredGCSvcs_Impl() const OUString aImplName( aImplNames[0] ); const LanguageType nLang = MsLangId::convertIsoStringToLanguage( pElementNames[i] ); aTmpGCImplNamesByLang[ nLang ] = aImplName; - } + } } else { DBG_ASSERT( 0, "failed to get aImplNames. Wrong type?" ); - } - } + } + } } catch (uno::Exception &) { @@ -1114,7 +1114,7 @@ void GrammarCheckingIterator::GetMatchingGCSvcs_Impl() xNA.set( xNA->getByName( A2OU("GrammarCheckers") ), uno::UNO_QUERY_THROW ); const uno::Sequence< OUString > aGCImplNames( xNA->getElementNames() ); const OUString *pGCImplNames = aGCImplNames.getConstArray(); - + sal_Int32 nLen = aGCImplNames.getLength(); for (sal_Int32 i = 0; i < nLen; ++i) { @@ -1130,13 +1130,13 @@ void GrammarCheckingIterator::GetMatchingGCSvcs_Impl() // the last one found here will win... const LanguageType nLang = MsLangId::convertIsoStringToLanguage( pIsoLocaleNames[k] ); aTmpGCImplNamesByLang[ nLang ] = pGCImplNames[i]; - } + } } else { DBG_ASSERT( 0, "failed to get aImplNames. Wrong type?" ); - } - } + } + } } catch (uno::Exception &) { @@ -1149,7 +1149,7 @@ void GrammarCheckingIterator::GetMatchingGCSvcs_Impl() m_aGCImplNamesByLang = aTmpGCImplNamesByLang; // ---- THREAD SAFE END ---- } -} +} */ /* @@ -1175,8 +1175,8 @@ void GrammarCheckingIterator::GetAvailableGCSvcs_Impl() uno::Reference< beans::XPropertySet > xProps( m_xMSF, uno::UNO_QUERY ); xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))) >>= xContext; - if ( xContext.is() && - (cppu::extractInterface( xCompFactory, aCurrent ) || + if ( xContext.is() && + (cppu::extractInterface( xCompFactory, aCurrent ) || cppu::extractInterface( xFactory, aCurrent )) ) { try @@ -1238,9 +1238,9 @@ uno::Sequence< OUString > SAL_CALL GrammarCheckingIterator::getSupportedServiceN return GrammarCheckingIterator_getSupportedServiceNames(); } - -void GrammarCheckingIterator::SetServiceList( - const lang::Locale &rLocale, + +void GrammarCheckingIterator::SetServiceList( + const lang::Locale &rLocale, const uno::Sequence< OUString > &rSvcImplNames ) { ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); @@ -1256,36 +1256,36 @@ void GrammarCheckingIterator::SetServiceList( m_aGCImplNamesByLang[ nLanguage ] = aImplName; else m_aGCImplNamesByLang.erase( nLanguage ); - } -} + } +} -uno::Sequence< OUString > GrammarCheckingIterator::GetServiceList( +uno::Sequence< OUString > GrammarCheckingIterator::GetServiceList( const lang::Locale &rLocale ) const { ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); uno::Sequence< OUString > aRes(1); - + OUString aImplName; // there is only one grammar checker per language LanguageType nLang = LocaleToLanguage( rLocale ); GCImplNames_t::const_iterator aIt( m_aGCImplNamesByLang.find( nLang ) ); if (aIt != m_aGCImplNamesByLang.end()) aImplName = aIt->second; - + if (aImplName.getLength() > 0) aRes[0] = aImplName; else aRes.realloc(0); return aRes; -} +} LinguDispatcher::DspType GrammarCheckingIterator::GetDspType() const { return DSP_GRAMMAR; -} +} /////////////////////////////////////////////////////////////////////////// diff --git a/linguistic/source/gciterator.hxx b/linguistic/source/gciterator.hxx index 1888726704d9..95105c7d29c9 100644 --- a/linguistic/source/gciterator.hxx +++ b/linguistic/source/gciterator.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -61,15 +61,15 @@ struct FPEntry ::com::sun::star::uno::WeakReference< ::com::sun::star::text::XFlatParagraph > m_xPara; // document ID to identify different documents - ::rtl::OUString m_aDocId; + ::rtl::OUString m_aDocId; // the starting position to be checked - sal_Int32 m_nStartIndex; + sal_Int32 m_nStartIndex; // the flag to identify whether the document does automatical grammar checking - sal_Bool m_bAutomatic; + sal_Bool m_bAutomatic; - FPEntry() + FPEntry() : m_aDocId() , m_nStartIndex( 0 ) , m_bAutomatic( 0 ) @@ -117,7 +117,7 @@ class GrammarCheckingIterator: // language -> implname mapping typedef std::map< LanguageType, ::rtl::OUString > GCImplNames_t; GCImplNames_t m_aGCImplNamesByLang; - + // implname -> UNO reference mapping typedef std::map< ::rtl::OUString, ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XProofreader > > GCReferences_t; GCReferences_t m_aGCReferencesByService; @@ -128,13 +128,13 @@ class GrammarCheckingIterator: sal_Int32 m_nLastEndOfSentencePos; osl::Condition m_aWakeUpThread; osl::Condition m_aRequestEndThread; - + //! beware of initilization order ! struct MyMutex : public rtl::Static< osl::Mutex, MyMutex > {}; // cppu::OInterfaceContainerHelper m_aEventListeners; cppu::OInterfaceContainerHelper m_aNotifyListeners; - + ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > m_xBreakIterator; mutable ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesBatch > m_xUpdateAccess; @@ -146,7 +146,7 @@ class GrammarCheckingIterator: ::com::sun::star::uno::WeakReference< ::com::sun::star::text::XFlatParagraph > xFlatPara, const ::rtl::OUString &rDocId, sal_Int32 nStartIndex, sal_Bool bAutomatic ); - void ProcessResult( const ::com::sun::star::linguistic2::ProofreadingResult &rRes, + void ProcessResult( const ::com::sun::star::linguistic2::ProofreadingResult &rRes, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XFlatParagraphIterator > &rxFlatParagraphIterator, bool bIsAutomaticChecking ); @@ -176,10 +176,10 @@ public: virtual void SAL_CALL resetIgnoreRules( ) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Bool SAL_CALL isProofreading( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xDocument ) throw (::com::sun::star::uno::RuntimeException); - // XLinguServiceEventListener + // XLinguServiceEventListener virtual void SAL_CALL processLinguServiceEvent( const ::com::sun::star::linguistic2::LinguServiceEvent& aLngSvcEvent ) throw (::com::sun::star::uno::RuntimeException); - // XLinguServiceEventBroadcaster + // XLinguServiceEventBroadcaster virtual ::sal_Bool SAL_CALL addLinguServiceEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLinguServiceEventListener >& xLstnr ) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Bool SAL_CALL removeLinguServiceEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLinguServiceEventListener >& xLstnr ) throw (::com::sun::star::uno::RuntimeException); diff --git a/linguistic/source/grammarchecker.cxx b/linguistic/source/grammarchecker.cxx index 1f076f0f3943..21e1b7a58a3c 100644 --- a/linguistic/source/grammarchecker.cxx +++ b/linguistic/source/grammarchecker.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -66,7 +66,7 @@ GrammarChecker::GrammarChecker( /*uno::Reference< uno::XComponentContext > const GrammarChecker::~GrammarChecker() { -} +} sal_Bool SAL_CALL GrammarChecker::isSpellChecker() throw (uno::RuntimeException) @@ -90,49 +90,49 @@ uno::Sequence< lang::Locale > SAL_CALL GrammarChecker::getLocales( ) throw (uno } -void SAL_CALL GrammarChecker::startDocument(sal_Int32 nDocId) +void SAL_CALL GrammarChecker::startDocument(sal_Int32 nDocId) throw (uno::RuntimeException, lang::IllegalArgumentException) { osl::Guard< osl::Mutex > aGuard(GetMutex()); (void) nDocId; } -void SAL_CALL GrammarChecker::startParagraph(sal_Int32 nDocId) +void SAL_CALL GrammarChecker::startParagraph(sal_Int32 nDocId) throw (uno::RuntimeException, lang::IllegalArgumentException) { osl::Guard< osl::Mutex > aGuard(GetMutex()); (void) nDocId; } -void SAL_CALL GrammarChecker::endParagraph( sal_Int32 nDocId ) +void SAL_CALL GrammarChecker::endParagraph( sal_Int32 nDocId ) throw (uno::RuntimeException, lang::IllegalArgumentException) { osl::Guard< osl::Mutex > aGuard(GetMutex()); (void) nDocId; } -void SAL_CALL GrammarChecker::endDocument(sal_Int32 nDocId) +void SAL_CALL GrammarChecker::endDocument(sal_Int32 nDocId) throw (uno::RuntimeException, lang::IllegalArgumentException) { osl::Guard< osl::Mutex > aGuard(GetMutex()); (void) nDocId; } -linguistic2::GrammarCheckingResult SAL_CALL GrammarChecker::doGrammarChecking( - sal_Int32 nDocId, - const rtl::OUString& rText, - const lang::Locale& rLocale, - sal_Int32 nStartOfSentencePos, +linguistic2::GrammarCheckingResult SAL_CALL GrammarChecker::doGrammarChecking( + sal_Int32 nDocId, + const rtl::OUString& rText, + const lang::Locale& rLocale, + sal_Int32 nStartOfSentencePos, sal_Int32 nSuggestedSentenceEndPos, - const uno::Sequence< ::sal_Int32 >& rLanguagePortions, - const uno::Sequence< lang::Locale >& rLanguagePortionsLocales ) + const uno::Sequence< ::sal_Int32 >& rLanguagePortions, + const uno::Sequence< lang::Locale >& rLanguagePortionsLocales ) throw (lang::IllegalArgumentException, uno::RuntimeException) { osl::Guard< osl::Mutex > aGuard(GetMutex()); (void) rLanguagePortions; (void) rLanguagePortionsLocales; - + linguistic2::GrammarCheckingResult aRes; aRes.nDocumentId = nDocId; aRes.aText = rText; @@ -140,15 +140,15 @@ linguistic2::GrammarCheckingResult SAL_CALL GrammarChecker::doGrammarChecking( aRes.nEndOfSentencePos = nSuggestedSentenceEndPos; aRes.xGrammarChecker = this; aRes.aGrammarErrors = GrammarCheckingInDummy( nDocId, rText, rLocale, nStartOfSentencePos, nSuggestedSentenceEndPos );; - + return aRes; } uno::Sequence< linguistic2::SingleGrammarError > GrammarChecker::GrammarCheckingInDummy( - sal_Int32 nDocId, - const OUString & rFlatParaText, - const lang::Locale & rLocale, - sal_Int32 nStartOfSentencePos, + sal_Int32 nDocId, + const OUString & rFlatParaText, + const lang::Locale & rLocale, + sal_Int32 nStartOfSentencePos, sal_Int32 nSuggestedSentenceEndPos ) { (void) nDocId; @@ -156,7 +156,7 @@ uno::Sequence< linguistic2::SingleGrammarError > GrammarChecker::GrammarChecking (void) rLocale; (void) nStartOfSentencePos; (void) nSuggestedSentenceEndPos; - + typedef std::map< OUString, uno::Sequence<OUString> > Error_t; Error_t aError; @@ -169,7 +169,7 @@ uno::Sequence< linguistic2::SingleGrammarError > GrammarChecker::GrammarChecking typedef std::vector< linguistic2::SingleGrammarError> ErrorVector_t; ErrorVector_t aErrorVector; - + OUString aText = rFlatParaText.copy( nStartOfSentencePos, nSuggestedSentenceEndPos - nStartOfSentencePos ); sal_Int32 nIndexOf = 0; for(Error_t::const_iterator it = aError.begin(); it != aError.end(); ++it) @@ -191,7 +191,7 @@ uno::Sequence< linguistic2::SingleGrammarError > GrammarChecker::GrammarChecking aErr.aFullComment = OUString(); aErr.aNewLocale = rLocale; aErr.aSuggestions = it->second; - + aErrorVector.push_back( aErr ); } } @@ -218,7 +218,7 @@ sal_Bool SAL_CALL GrammarChecker::hasOptionsDialog( ) throw (uno::RuntimeExcept return sal_False; } -void SAL_CALL GrammarChecker::runOptionsDialog() +void SAL_CALL GrammarChecker::runOptionsDialog() throw (uno::RuntimeException) { osl::Guard< osl::Mutex > aGuard(GetMutex()); @@ -229,14 +229,14 @@ void SAL_CALL GrammarChecker::dispose( ) throw (uno::RuntimeException) osl::Guard< osl::Mutex > aGuard(GetMutex()); } -void SAL_CALL GrammarChecker::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) +void SAL_CALL GrammarChecker::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) throw (uno::RuntimeException) { osl::Guard< osl::Mutex > aGuard(GetMutex()); (void) xListener; } -void SAL_CALL GrammarChecker::removeEventListener( const uno::Reference< lang::XEventListener >& xListener ) +void SAL_CALL GrammarChecker::removeEventListener( const uno::Reference< lang::XEventListener >& xListener ) throw (uno::RuntimeException) { osl::Guard< osl::Mutex > aGuard(GetMutex()); @@ -259,7 +259,7 @@ uno::Sequence< OUString > GrammarChecker::getSupportedServiceNames_Static( ) th { //osl::Guard< osl::Mutex > aGuard(GetMutex()); - uno::Sequence< OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich + uno::Sequence< OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich aSNS.getArray()[0] = A2OU( "com.sun.star.linguistic2.GrammarChecker" );//SN_LINGU_SERVCICE_MANAGER return aSNS; } diff --git a/linguistic/source/grammarchecker.hxx b/linguistic/source/grammarchecker.hxx index 7c7f6cd5aa99..8eee8f4c93f9 100644 --- a/linguistic/source/grammarchecker.hxx +++ b/linguistic/source/grammarchecker.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -54,7 +54,7 @@ class GrammarChecker: // disallow use of copy c-tor and assignment operator GrammarChecker( const GrammarChecker & ); GrammarChecker & operator = ( const GrammarChecker & ); - + public: explicit GrammarChecker( /* uno::Reference< uno::XComponentContext > const & rXContext */ ); virtual ~GrammarChecker(); @@ -86,11 +86,11 @@ public: static inline ::rtl::OUString getImplementationName_Static(); static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw(); - ::com::sun::star::uno::Sequence< ::com::sun::star::linguistic2::SingleGrammarError > GrammarCheckingInDummy( - ::sal_Int32 nDocId, const ::rtl::OUString &rFlatParaText, const ::com::sun::star::lang::Locale & rLocale, + ::com::sun::star::uno::Sequence< ::com::sun::star::linguistic2::SingleGrammarError > GrammarCheckingInDummy( + ::sal_Int32 nDocId, const ::rtl::OUString &rFlatParaText, const ::com::sun::star::lang::Locale & rLocale, ::sal_Int32 nStartOfSentencePos, ::sal_Int32 nSuggestedSentenceEndPos ); - + inline ::osl::Mutex & GetMutex() { static osl::Mutex aMutex; diff --git a/linguistic/source/hhconvdic.cxx b/linguistic/source/hhconvdic.cxx index 1cbdbe3fa2bb..207284230b4c 100644 --- a/linguistic/source/hhconvdic.cxx +++ b/linguistic/source/hhconvdic.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -82,7 +82,7 @@ sal_Int16 SAL_CALL checkScriptType(sal_Unicode c) throw (RuntimeException) if ( !U_SUCCESS(status) ) throw RuntimeException(); - return scriptCode == USCRIPT_HANGUL ? SCRIPT_HANGUL : + return scriptCode == USCRIPT_HANGUL ? SCRIPT_HANGUL : scriptCode == USCRIPT_HAN ? SCRIPT_HANJA : SCRIPT_OTHERS; } @@ -113,13 +113,13 @@ HHConvDic::~HHConvDic() } -void SAL_CALL HHConvDic::addEntry( - const OUString& aLeftText, - const OUString& aRightText ) +void SAL_CALL HHConvDic::addEntry( + const OUString& aLeftText, + const OUString& aRightText ) throw (IllegalArgumentException, container::ElementExistException, RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - + if ((aLeftText.getLength() != aRightText.getLength()) || !TextIsAllScriptType( aLeftText, SCRIPT_HANGUL ) || !TextIsAllScriptType( aRightText, SCRIPT_HANJA )) @@ -128,7 +128,7 @@ void SAL_CALL HHConvDic::addEntry( } -OUString SAL_CALL HHConvDic::getImplementationName( ) +OUString SAL_CALL HHConvDic::getImplementationName( ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -136,7 +136,7 @@ OUString SAL_CALL HHConvDic::getImplementationName( ) } -sal_Bool SAL_CALL HHConvDic::supportsService( const OUString& rServiceName ) +sal_Bool SAL_CALL HHConvDic::supportsService( const OUString& rServiceName ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -148,7 +148,7 @@ sal_Bool SAL_CALL HHConvDic::supportsService( const OUString& rServiceName ) } -uno::Sequence< OUString > SAL_CALL HHConvDic::getSupportedServiceNames( ) +uno::Sequence< OUString > SAL_CALL HHConvDic::getSupportedServiceNames( ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -156,7 +156,7 @@ uno::Sequence< OUString > SAL_CALL HHConvDic::getSupportedServiceNames( ) } -uno::Sequence< OUString > HHConvDic::getSupportedServiceNames_Static() +uno::Sequence< OUString > HHConvDic::getSupportedServiceNames_Static() throw() { uno::Sequence< OUString > aSNS( 2 ); diff --git a/linguistic/source/hhconvdic.hxx b/linguistic/source/hhconvdic.hxx index c66974f26ed5..9bdecf0903fc 100644 --- a/linguistic/source/hhconvdic.hxx +++ b/linguistic/source/hhconvdic.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx index e617231bc55d..441d3ff449e9 100644 --- a/linguistic/source/hyphdsp.cxx +++ b/linguistic/source/hyphdsp.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -29,7 +29,7 @@ #include "precompiled_linguistic.hxx" -#include <cppuhelper/factory.hxx> // helper for factories +#include <cppuhelper/factory.hxx> // helper for factories #include <com/sun/star/registry/XRegistryKey.hpp> #include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp> #include <com/sun/star/linguistic2/XHyphenatedWord.hpp> @@ -60,7 +60,7 @@ using namespace linguistic; /////////////////////////////////////////////////////////////////////////// HyphenatorDispatcher::HyphenatorDispatcher( LngSvcMgr &rLngSvcMgr ) : - rMgr (rLngSvcMgr) + rMgr (rLngSvcMgr) { } @@ -79,12 +79,12 @@ void HyphenatorDispatcher::ClearSvcList() } -Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord( +Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord( const OUString rOrigWord, const Reference<XDictionaryEntry> &xEntry, INT16 nLang, INT16 nMaxLeading ) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); Reference< XHyphenatedWord > xRes; @@ -119,7 +119,7 @@ Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord( if (nLeading <= nMaxLeading) nHyphenationPos = (INT16) nHyphIdx; } - bSkip = TRUE; //! multiple '=' should count as one only + bSkip = TRUE; //! multiple '=' should count as one only } } @@ -171,7 +171,7 @@ Reference<XHyphenatedWord> HyphenatorDispatcher::buildHyphWord( Reference< XPossibleHyphens > HyphenatorDispatcher::buildPossHyphens( const Reference< XDictionaryEntry > &xEntry, INT16 nLanguage ) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); Reference<XPossibleHyphens> xRes; @@ -205,7 +205,7 @@ Reference< XPossibleHyphens > HyphenatorDispatcher::buildPossHyphens( { if (!bSkip && nHyphIdx >= 0) pPos[ nHyphCount++ ] = (INT16) nHyphIdx; - bSkip = TRUE; //! multiple '=' should count as one only + bSkip = TRUE; //! multiple '=' should count as one only } } @@ -232,7 +232,7 @@ Reference< XPossibleHyphens > HyphenatorDispatcher::buildPossHyphens( Sequence< Locale > SAL_CALL HyphenatorDispatcher::getLocales() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); Sequence< Locale > aLocales( static_cast< sal_Int32 >(aSvcMap.size()) ); Locale *pLocales = aLocales.getArray(); @@ -240,7 +240,7 @@ Sequence< Locale > SAL_CALL HyphenatorDispatcher::getLocales() for (aIt = aSvcMap.begin(); aIt != aSvcMap.end(); ++aIt) { *pLocales++ = CreateLocale( aIt->first ); - } + } return aLocales; } @@ -248,7 +248,7 @@ Sequence< Locale > SAL_CALL HyphenatorDispatcher::getLocales() BOOL SAL_CALL HyphenatorDispatcher::hasLocale(const Locale& rLocale) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); HyphSvcByLangMap_t::const_iterator aIt( aSvcMap.find( LocaleToLanguage( rLocale ) ) ); return aIt != aSvcMap.end(); } @@ -260,9 +260,9 @@ Reference< XHyphenatedWord > SAL_CALL const PropertyValues& rProperties ) throw(IllegalArgumentException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); - Reference< XHyphenatedWord > xRes; + Reference< XHyphenatedWord > xRes; INT32 nWordLen = rWord.getLength(); INT16 nLanguage = LocaleToLanguage( rLocale ); @@ -382,7 +382,7 @@ Reference< XHyphenatedWord > SAL_CALL aSvcMap.erase( nLanguage ); } } - } // if (xEntry.is()) + } // if (xEntry.is()) } if (bWordModified && xRes.is()) @@ -405,9 +405,9 @@ Reference< XHyphenatedWord > SAL_CALL const PropertyValues& rProperties ) throw(IllegalArgumentException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); - Reference< XHyphenatedWord > xRes; + Reference< XHyphenatedWord > xRes; INT32 nWordLen = rWord.getLength(); INT16 nLanguage = LocaleToLanguage( rLocale ); @@ -521,7 +521,7 @@ Reference< XHyphenatedWord > SAL_CALL aSvcMap.erase( nLanguage ); } } - } // if (xEntry.is()) + } // if (xEntry.is()) } if (bWordModified && xRes.is()) @@ -544,9 +544,9 @@ Reference< XPossibleHyphens > SAL_CALL const PropertyValues& rProperties ) throw(IllegalArgumentException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); - Reference< XPossibleHyphens > xRes; + Reference< XPossibleHyphens > xRes; INT16 nLanguage = LocaleToLanguage( rLocale ); if (nLanguage == LANGUAGE_NONE || !rWord.getLength()) @@ -655,7 +655,7 @@ Reference< XPossibleHyphens > SAL_CALL aSvcMap.erase( nLanguage ); } } - } // if (xEntry.is()) + } // if (xEntry.is()) } if (xRes.is() && xRes->getWord() != rWord) @@ -672,7 +672,7 @@ Reference< XPossibleHyphens > SAL_CALL void HyphenatorDispatcher::SetServiceList( const Locale &rLocale, const Sequence< OUString > &rSvcImplNames ) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); INT16 nLanguage = LocaleToLanguage( rLocale ); @@ -706,7 +706,7 @@ void HyphenatorDispatcher::SetServiceList( const Locale &rLocale, Sequence< OUString > HyphenatorDispatcher::GetServiceList( const Locale &rLocale ) const { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); Sequence< OUString > aRes; diff --git a/linguistic/source/hyphdsp.hxx b/linguistic/source/hyphdsp.hxx index 564ceb6dc647..a722e9046c3c 100644 --- a/linguistic/source/hyphdsp.hxx +++ b/linguistic/source/hyphdsp.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -38,8 +38,8 @@ #include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp> #include <com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp> -#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include <cppuhelper/implbase1.hxx> // helper for implementations +#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include <cppuhelper/implbase1.hxx> // helper for implementations #include <boost/shared_ptr.hpp> #include <map> @@ -64,11 +64,11 @@ class HyphenatorDispatcher : HyphSvcByLangMap_t aSvcMap; ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > xPropSet; + ::com::sun::star::beans::XPropertySet > xPropSet; ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XSearchableDictionaryList > xDicList; + ::com::sun::star::linguistic2::XSearchableDictionaryList > xDicList; - LngSvcMgr &rMgr; + LngSvcMgr &rMgr; // disallow copy-constructor and assignment-operator for now HyphenatorDispatcher(const HyphenatorDispatcher &); @@ -81,11 +81,11 @@ class HyphenatorDispatcher : ::com::sun::star::linguistic2::XSearchableDictionaryList > GetDicList(); - void ClearSvcList(); + void ClearSvcList(); com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenatedWord> - buildHyphWord( const rtl::OUString rOrigWord, + buildHyphWord( const rtl::OUString rOrigWord, const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryEntry> &xEntry, INT16 nLang, INT16 nMaxLeading ); @@ -151,7 +151,7 @@ inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > HyphenatorDispatcher::GetPropSet() { - return xPropSet.is() ? + return xPropSet.is() ? xPropSet : xPropSet = ::linguistic::GetLinguProperties(); } @@ -160,7 +160,7 @@ inline ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSearchableDictionaryList > HyphenatorDispatcher::GetDicList() { - return xDicList.is() ? + return xDicList.is() ? xDicList : xDicList = ::linguistic::GetSearchableDictionaryList(); } diff --git a/linguistic/source/hyphdta.cxx b/linguistic/source/hyphdta.cxx index e0d26b163e36..66c3ca3f7775 100644 --- a/linguistic/source/hyphdta.cxx +++ b/linguistic/source/hyphdta.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -55,7 +55,7 @@ namespace linguistic HyphenatedWord::HyphenatedWord(const OUString &rWord, INT16 nLang, INT16 nHPos, const OUString &rHyphWord, INT16 nPos ) : - aWord (rWord), + aWord (rWord), aHyphenatedWord (rHyphWord), nHyphPos (nPos), nHyphenationPos (nHPos), @@ -64,7 +64,7 @@ HyphenatedWord::HyphenatedWord(const OUString &rWord, INT16 nLang, INT16 nHPos, String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); DBG_ASSERT( 1 == aSingleQuote.Len(), "unexpectend length of quotation mark" ); if (aSingleQuote.Len()) - { + { // ignore typographical apostrophes (which got replaced in original // word when being checked for hyphenation) in results. OUString aTmpWord( rWord ); @@ -86,7 +86,7 @@ HyphenatedWord::~HyphenatedWord() OUString SAL_CALL HyphenatedWord::getWord() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return aWord; } @@ -94,7 +94,7 @@ OUString SAL_CALL HyphenatedWord::getWord() Locale SAL_CALL HyphenatedWord::getLocale() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); Locale aRes; return LanguageToLocale( aRes, nLanguage ); @@ -104,7 +104,7 @@ Locale SAL_CALL HyphenatedWord::getLocale() sal_Int16 SAL_CALL HyphenatedWord::getHyphenationPos() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return nHyphenationPos; } @@ -112,7 +112,7 @@ sal_Int16 SAL_CALL HyphenatedWord::getHyphenationPos() OUString SAL_CALL HyphenatedWord::getHyphenatedWord() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return aHyphenatedWord; } @@ -120,7 +120,7 @@ OUString SAL_CALL HyphenatedWord::getHyphenatedWord() sal_Int16 SAL_CALL HyphenatedWord::getHyphenPos() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return nHyphPos; } @@ -128,7 +128,7 @@ sal_Int16 SAL_CALL HyphenatedWord::getHyphenPos() sal_Bool SAL_CALL HyphenatedWord::isAlternativeSpelling() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return bIsAltSpelling; } @@ -139,10 +139,10 @@ sal_Bool SAL_CALL HyphenatedWord::isAlternativeSpelling() PossibleHyphens::PossibleHyphens(const OUString &rWord, INT16 nLang, const OUString &rHyphWord, const Sequence< INT16 > &rPositions) : - aWord (rWord), + aWord (rWord), aWordWithHyphens(rHyphWord), - aOrigHyphenPos (rPositions), - nLanguage (nLang) + aOrigHyphenPos (rPositions), + nLanguage (nLang) { } @@ -155,7 +155,7 @@ PossibleHyphens::~PossibleHyphens() OUString SAL_CALL PossibleHyphens::getWord() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return aWord; } @@ -163,7 +163,7 @@ OUString SAL_CALL PossibleHyphens::getWord() Locale SAL_CALL PossibleHyphens::getLocale() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return CreateLocale( nLanguage ); } @@ -171,7 +171,7 @@ Locale SAL_CALL PossibleHyphens::getLocale() OUString SAL_CALL PossibleHyphens::getPossibleHyphens() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return aWordWithHyphens; } @@ -179,11 +179,11 @@ OUString SAL_CALL PossibleHyphens::getPossibleHyphens() Sequence< sal_Int16 > SAL_CALL PossibleHyphens::getHyphenationPositions() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return aOrigHyphenPos; } /////////////////////////////////////////////////////////////////////////// -} // namespace linguistic +} // namespace linguistic diff --git a/linguistic/source/iprcache.cxx b/linguistic/source/iprcache.cxx index bf3be9a28ebc..e4c50686afcf 100644 --- a/linguistic/source/iprcache.cxx +++ b/linguistic/source/iprcache.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -37,22 +37,22 @@ #include <tools/debug.hxx> #include <osl/mutex.hxx> -//#define IPR_DEF_CACHE_SIZE 503 -#define IPR_DEF_CACHE_MAX 375 -#define IPR_DEF_CACHE_MAXINPUT 200 +//#define IPR_DEF_CACHE_SIZE 503 +#define IPR_DEF_CACHE_MAX 375 +#define IPR_DEF_CACHE_MAXINPUT 200 #ifdef DBG_STATISTIC #include <tools/stream.hxx> -//#define IPR_CACHE_SIZE nTblSize -#define IPR_CACHE_MAX nMax -#define IPR_CACHE_MAXINPUT nMaxInput +//#define IPR_CACHE_SIZE nTblSize +#define IPR_CACHE_MAX nMax +#define IPR_CACHE_MAXINPUT nMaxInput #else -//#define IPR_CACHE_SIZE IPR_DEF_CACHE_SIZE -#define IPR_CACHE_MAX IPR_DEF_CACHE_MAX -#define IPR_CACHE_MAXINPUT IPR_DEF_CACHE_MAXINPUT +//#define IPR_CACHE_SIZE IPR_DEF_CACHE_SIZE +#define IPR_CACHE_MAX IPR_DEF_CACHE_MAX +#define IPR_CACHE_MAXINPUT IPR_DEF_CACHE_MAXINPUT #endif #include <unotools/processfactory.hxx> @@ -74,13 +74,13 @@ namespace linguistic /////////////////////////////////////////////////////////////////////////// -#define NUM_FLUSH_PROPS 6 +#define NUM_FLUSH_PROPS 6 static const struct { const char *pPropName; - INT32 nPropHdl; -} aFlushProperties[ NUM_FLUSH_PROPS ] = + INT32 nPropHdl; +} aFlushProperties[ NUM_FLUSH_PROPS ] = { { UPN_IS_USE_DICTIONARY_LIST, UPH_IS_USE_DICTIONARY_LIST }, { UPN_IS_IGNORE_CONTROL_CHARACTERS, UPH_IS_IGNORE_CONTROL_CHARACTERS }, @@ -90,7 +90,7 @@ static const struct }; -static void lcl_AddAsPropertyChangeListener( +static void lcl_AddAsPropertyChangeListener( Reference< XPropertyChangeListener > xListener, Reference< XPropertySet > &rPropSet ) { @@ -98,14 +98,14 @@ static void lcl_AddAsPropertyChangeListener( { for (int i = 0; i < NUM_FLUSH_PROPS; ++i) { - rPropSet->addPropertyChangeListener( + rPropSet->addPropertyChangeListener( A2OU(aFlushProperties[i].pPropName), xListener ); } } } -static void lcl_RemoveAsPropertyChangeListener( +static void lcl_RemoveAsPropertyChangeListener( Reference< XPropertyChangeListener > xListener, Reference< XPropertySet > &rPropSet ) { @@ -113,7 +113,7 @@ static void lcl_RemoveAsPropertyChangeListener( { for (int i = 0; i < NUM_FLUSH_PROPS; ++i) { - rPropSet->removePropertyChangeListener( + rPropSet->removePropertyChangeListener( A2OU(aFlushProperties[i].pPropName), xListener ); } } @@ -143,9 +143,9 @@ FlushListener::~FlushListener() } -void FlushListener::SetDicList( Reference<XDictionaryList> &rDL ) +void FlushListener::SetDicList( Reference<XDictionaryList> &rDL ) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (xDicList != rDL) { @@ -157,11 +157,11 @@ void FlushListener::SetDicList( Reference<XDictionaryList> &rDL ) xDicList->addDictionaryListEventListener( this, FALSE ); } } - + void FlushListener::SetPropSet( Reference< XPropertySet > &rPS ) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (xPropSet != rPS) { @@ -178,17 +178,17 @@ void FlushListener::SetPropSet( Reference< XPropertySet > &rPS ) void SAL_CALL FlushListener::disposing( const EventObject& rSource ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (xDicList.is() && rSource.Source == xDicList) { xDicList->removeDictionaryListEventListener( this ); - xDicList = NULL; //! release reference + xDicList = NULL; //! release reference } if (xPropSet.is() && rSource.Source == xPropSet) { lcl_RemoveAsPropertyChangeListener( this, xPropSet ); - xPropSet = NULL; //! release reference + xPropSet = NULL; //! release reference } } @@ -197,34 +197,34 @@ void SAL_CALL FlushListener::processDictionaryListEvent( const DictionaryListEvent& rDicListEvent ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (rDicListEvent.Source == xDicList) { INT16 nEvt = rDicListEvent.nCondensedEvent; - INT16 nFlushFlags = - DictionaryListEventFlags::ADD_NEG_ENTRY | - DictionaryListEventFlags::DEL_POS_ENTRY | - DictionaryListEventFlags::ACTIVATE_NEG_DIC | + INT16 nFlushFlags = + DictionaryListEventFlags::ADD_NEG_ENTRY | + DictionaryListEventFlags::DEL_POS_ENTRY | + DictionaryListEventFlags::ACTIVATE_NEG_DIC | DictionaryListEventFlags::DEACTIVATE_POS_DIC; - BOOL bFlush = 0 != (nEvt & nFlushFlags); + BOOL bFlush = 0 != (nEvt & nFlushFlags); DBG_ASSERT( pFlushObj, "missing object (NULL pointer)" ); if (bFlush && pFlushObj != NULL) pFlushObj->Flush(); } } - -void SAL_CALL FlushListener::propertyChange( - const PropertyChangeEvent& rEvt ) + +void SAL_CALL FlushListener::propertyChange( + const PropertyChangeEvent& rEvt ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (rEvt.Source == xPropSet) { - BOOL bFlush = lcl_IsFlushProperty( rEvt.PropertyHandle ); + BOOL bFlush = lcl_IsFlushProperty( rEvt.PropertyHandle ); DBG_ASSERT( pFlushObj, "missing object (NULL pointer)" ); if (bFlush && pFlushObj != NULL) @@ -240,9 +240,9 @@ SpellCache::SpellCache() pFlushLstnr = new FlushListener( this ); xFlushLstnr = pFlushLstnr; Reference<XDictionaryList> aDictionaryList(GetDictionaryList()); - pFlushLstnr->SetDicList( aDictionaryList ); //! after reference is established + pFlushLstnr->SetDicList( aDictionaryList ); //! after reference is established Reference<XPropertySet> aPropertySet(GetLinguProperties()); - pFlushLstnr->SetPropSet( aPropertySet ); //! after reference is established + pFlushLstnr->SetPropSet( aPropertySet ); //! after reference is established } SpellCache::~SpellCache() @@ -255,7 +255,7 @@ SpellCache::~SpellCache() void SpellCache::Flush() { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); // clear word list LangWordList_t aEmpty; aWordLists.swap( aEmpty ); @@ -263,7 +263,7 @@ void SpellCache::Flush() bool SpellCache::CheckWord( const OUString& rWord, LanguageType nLang ) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); WordList_t &rList = aWordLists[ nLang ]; const WordList_t::const_iterator aIt = rList.find( rWord ); return aIt != rList.end(); @@ -271,7 +271,7 @@ bool SpellCache::CheckWord( const OUString& rWord, LanguageType nLang ) void SpellCache::AddWord( const OUString& rWord, LanguageType nLang ) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); WordList_t & rList = aWordLists[ nLang ]; // occasional clean-up... if (rList.size() > 500) @@ -280,5 +280,5 @@ void SpellCache::AddWord( const OUString& rWord, LanguageType nLang ) } /////////////////////////////////////////////////////////////////////////// -} // namespace linguistic +} // namespace linguistic diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index d377f856e8ad..77a1fcbd57b0 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -34,10 +34,10 @@ #include <tools/debug.hxx> #include <unotools/lingucfg.hxx> -#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include <cppuhelper/implbase1.hxx> // helper for implementations +#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include <cppuhelper/implbase1.hxx> // helper for implementations -#include <cppuhelper/factory.hxx> // helper for factories +#include <cppuhelper/factory.hxx> // helper for factories #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/registry/XSimpleRegistry.hpp> #include <com/sun/star/registry/XRegistryKey.hpp> @@ -63,8 +63,8 @@ using namespace com::sun::star::registry; // static member intialization -SvtLinguOptions * LinguOptions::pData = NULL; -vos::ORefCount LinguOptions::aRefCount; +SvtLinguOptions * LinguOptions::pData = NULL; +vos::ORefCount LinguOptions::aRefCount; LinguOptions::LinguOptions() @@ -89,11 +89,11 @@ LinguOptions::LinguOptions(const LinguOptions & /*rOpt*/) LinguOptions::~LinguOptions() { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (--aRefCount == 0) { - delete pData; pData = NULL; + delete pData; pData = NULL; } } @@ -102,12 +102,12 @@ BOOL LinguOptions::SetLocale_Impl( INT16 &rLanguage, Any &rOld, const Any &rVal, { BOOL bRes = FALSE; - Locale aNew; + Locale aNew; rVal >>= aNew; INT16 nNew = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aNew), nType); if (nNew != rLanguage) { - Locale aLocale( CreateLocale( rLanguage ) ); + Locale aLocale( CreateLocale( rLanguage ) ); rOld.setValue( &aLocale, ::getCppuType((Locale*)0 )); rLanguage = nNew; bRes = TRUE; @@ -119,7 +119,7 @@ BOOL LinguOptions::SetLocale_Impl( INT16 &rLanguage, Any &rOld, const Any &rVal, BOOL LinguOptions::SetValue( Any &rOld, const Any &rVal, INT32 nWID ) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); BOOL bRes = FALSE; @@ -129,22 +129,22 @@ BOOL LinguOptions::SetValue( Any &rOld, const Any &rVal, INT32 nWID ) switch( nWID ) { case WID_IS_GERMAN_PRE_REFORM : /*! deprecated !*/ break; - case WID_IS_USE_DICTIONARY_LIST : pbVal = &pData->bIsUseDictionaryList; break; - case WID_IS_IGNORE_CONTROL_CHARACTERS : pbVal = &pData->bIsIgnoreControlCharacters; break; - case WID_IS_HYPH_AUTO : pbVal = &pData->bIsHyphAuto; break; - case WID_IS_HYPH_SPECIAL : pbVal = &pData->bIsHyphSpecial; break; - case WID_IS_SPELL_AUTO : pbVal = &pData->bIsSpellAuto; break; + case WID_IS_USE_DICTIONARY_LIST : pbVal = &pData->bIsUseDictionaryList; break; + case WID_IS_IGNORE_CONTROL_CHARACTERS : pbVal = &pData->bIsIgnoreControlCharacters; break; + case WID_IS_HYPH_AUTO : pbVal = &pData->bIsHyphAuto; break; + case WID_IS_HYPH_SPECIAL : pbVal = &pData->bIsHyphSpecial; break; + case WID_IS_SPELL_AUTO : pbVal = &pData->bIsSpellAuto; break; case WID_IS_SPELL_HIDE : /*! deprecated !*/ break; case WID_IS_SPELL_IN_ALL_LANGUAGES :/*! deprecated !*/ break; - case WID_IS_SPELL_SPECIAL : pbVal = &pData->bIsSpellSpecial; break; - case WID_IS_WRAP_REVERSE : pbVal = &pData->bIsSpellReverse; break; - case WID_DEFAULT_LANGUAGE : pnVal = &pData->nDefaultLanguage; break; - case WID_IS_SPELL_CAPITALIZATION : pbVal = &pData->bIsSpellCapitalization; break; - case WID_IS_SPELL_WITH_DIGITS : pbVal = &pData->bIsSpellWithDigits; break; - case WID_IS_SPELL_UPPER_CASE : pbVal = &pData->bIsSpellUpperCase; break; - case WID_HYPH_MIN_LEADING : pnVal = &pData->nHyphMinLeading; break; - case WID_HYPH_MIN_TRAILING : pnVal = &pData->nHyphMinTrailing; break; - case WID_HYPH_MIN_WORD_LENGTH : pnVal = &pData->nHyphMinWordLength; break; + case WID_IS_SPELL_SPECIAL : pbVal = &pData->bIsSpellSpecial; break; + case WID_IS_WRAP_REVERSE : pbVal = &pData->bIsSpellReverse; break; + case WID_DEFAULT_LANGUAGE : pnVal = &pData->nDefaultLanguage; break; + case WID_IS_SPELL_CAPITALIZATION : pbVal = &pData->bIsSpellCapitalization; break; + case WID_IS_SPELL_WITH_DIGITS : pbVal = &pData->bIsSpellWithDigits; break; + case WID_IS_SPELL_UPPER_CASE : pbVal = &pData->bIsSpellUpperCase; break; + case WID_HYPH_MIN_LEADING : pnVal = &pData->nHyphMinLeading; break; + case WID_HYPH_MIN_TRAILING : pnVal = &pData->nHyphMinTrailing; break; + case WID_HYPH_MIN_WORD_LENGTH : pnVal = &pData->nHyphMinWordLength; break; case WID_DEFAULT_LOCALE : { bRes = SetLocale_Impl( pData->nDefaultLanguage, rOld, rVal, ::com::sun::star::i18n::ScriptType::LATIN ); @@ -190,15 +190,15 @@ BOOL LinguOptions::SetValue( Any &rOld, const Any &rVal, INT32 nWID ) } } -// if (bRes) -// pData->SetModified(); +// if (bRes) +// pData->SetModified(); return bRes; } void LinguOptions::GetValue( Any &rVal, INT32 nWID ) const { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); INT16 *pnVal = 0; BOOL *pbVal = 0; @@ -207,22 +207,22 @@ void LinguOptions::GetValue( Any &rVal, INT32 nWID ) const switch( nWID ) { case WID_IS_GERMAN_PRE_REFORM : pbVal = &bDummy; /*! deprecated !*/ break; - case WID_IS_USE_DICTIONARY_LIST : pbVal = &pData->bIsUseDictionaryList; break; - case WID_IS_IGNORE_CONTROL_CHARACTERS : pbVal = &pData->bIsIgnoreControlCharacters; break; - case WID_IS_HYPH_AUTO : pbVal = &pData->bIsHyphAuto; break; - case WID_IS_HYPH_SPECIAL : pbVal = &pData->bIsHyphSpecial; break; - case WID_IS_SPELL_AUTO : pbVal = &pData->bIsSpellAuto; break; + case WID_IS_USE_DICTIONARY_LIST : pbVal = &pData->bIsUseDictionaryList; break; + case WID_IS_IGNORE_CONTROL_CHARACTERS : pbVal = &pData->bIsIgnoreControlCharacters; break; + case WID_IS_HYPH_AUTO : pbVal = &pData->bIsHyphAuto; break; + case WID_IS_HYPH_SPECIAL : pbVal = &pData->bIsHyphSpecial; break; + case WID_IS_SPELL_AUTO : pbVal = &pData->bIsSpellAuto; break; case WID_IS_SPELL_HIDE : pbVal = &bDummy; /*! deprecated !*/ break; case WID_IS_SPELL_IN_ALL_LANGUAGES :pbVal = &bDummy; /*! deprecated !*/ break; - case WID_IS_SPELL_SPECIAL : pbVal = &pData->bIsSpellSpecial; break; - case WID_IS_WRAP_REVERSE : pbVal = &pData->bIsSpellReverse; break; - case WID_DEFAULT_LANGUAGE : pnVal = &pData->nDefaultLanguage; break; - case WID_IS_SPELL_CAPITALIZATION : pbVal = &pData->bIsSpellCapitalization; break; - case WID_IS_SPELL_WITH_DIGITS : pbVal = &pData->bIsSpellWithDigits; break; - case WID_IS_SPELL_UPPER_CASE : pbVal = &pData->bIsSpellUpperCase; break; - case WID_HYPH_MIN_LEADING : pnVal = &pData->nHyphMinLeading; break; - case WID_HYPH_MIN_TRAILING : pnVal = &pData->nHyphMinTrailing; break; - case WID_HYPH_MIN_WORD_LENGTH : pnVal = &pData->nHyphMinWordLength; break; + case WID_IS_SPELL_SPECIAL : pbVal = &pData->bIsSpellSpecial; break; + case WID_IS_WRAP_REVERSE : pbVal = &pData->bIsSpellReverse; break; + case WID_DEFAULT_LANGUAGE : pnVal = &pData->nDefaultLanguage; break; + case WID_IS_SPELL_CAPITALIZATION : pbVal = &pData->bIsSpellCapitalization; break; + case WID_IS_SPELL_WITH_DIGITS : pbVal = &pData->bIsSpellWithDigits; break; + case WID_IS_SPELL_UPPER_CASE : pbVal = &pData->bIsSpellUpperCase; break; + case WID_HYPH_MIN_LEADING : pnVal = &pData->nHyphMinLeading; break; + case WID_HYPH_MIN_TRAILING : pnVal = &pData->nHyphMinTrailing; break; + case WID_HYPH_MIN_WORD_LENGTH : pnVal = &pData->nHyphMinWordLength; break; case WID_DEFAULT_LOCALE : { Locale aLocale( MsLangId::convertLanguageToLocale( pData->nDefaultLanguage ) ); @@ -256,8 +256,8 @@ void LinguOptions::GetValue( Any &rVal, INT32 nWID ) const struct WID_Name { - INT32 nWID; - const char *pPropertyName; + INT32 nWID; + const char *pPropertyName; }; //! order of entries is import (see LinguOptions::GetName) @@ -293,7 +293,7 @@ WID_Name aWID_Name[] = OUString LinguOptions::GetName( INT32 nWID ) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); OUString aRes; @@ -365,8 +365,8 @@ const SfxItemPropertyMapEntry* lcl_GetLinguProps() return aLinguProps; } LinguProps::LinguProps() : - aEvtListeners (GetLinguMutex()), - aPropListeners (GetLinguMutex()), + aEvtListeners (GetLinguMutex()), + aPropListeners (GetLinguMutex()), aPropertyMap(lcl_GetLinguProps()) { bDisposing = FALSE; @@ -399,7 +399,7 @@ Reference< XInterface > SAL_CALL LinguProps_CreateInstance( Reference< XPropertySetInfo > SAL_CALL LinguProps::getPropertySetInfo() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); static Reference< XPropertySetInfo > aRef = new SfxItemPropertySetInfo( &aPropertyMap ); @@ -411,7 +411,7 @@ void SAL_CALL LinguProps::setPropertyValue( throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); const SfxItemPropertySimpleEntry* pCur = aPropertyMap.getByName( rPropertyName ); if (pCur) @@ -435,7 +435,7 @@ void SAL_CALL LinguProps::setPropertyValue( Any SAL_CALL LinguProps::getPropertyValue( const OUString& rPropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); Any aRet; @@ -459,7 +459,7 @@ void SAL_CALL LinguProps::addPropertyChangeListener( const Reference< XPropertyChangeListener >& rxListener ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (!bDisposing && rxListener.is()) { @@ -480,7 +480,7 @@ void SAL_CALL LinguProps::removePropertyChangeListener( const Reference< XPropertyChangeListener >& rxListener ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (!bDisposing && rxListener.is()) { @@ -501,7 +501,7 @@ void SAL_CALL LinguProps::addVetoableChangeListener( const Reference< XVetoableChangeListener >& /*xListener*/ ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { -// MutexGuard aGuard( GetLinguMutex() ); +// MutexGuard aGuard( GetLinguMutex() ); } void SAL_CALL LinguProps::removeVetoableChangeListener( @@ -509,7 +509,7 @@ void SAL_CALL LinguProps::removeVetoableChangeListener( const Reference< XVetoableChangeListener >& /*xListener*/ ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { -// MutexGuard aGuard( GetLinguMutex() ); +// MutexGuard aGuard( GetLinguMutex() ); } @@ -517,7 +517,7 @@ void SAL_CALL LinguProps::setFastPropertyValue( sal_Int32 nHandle, const Any& rV throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); Any aOld( aConfig.GetProperty( nHandle ) ); if (aOld != rValue && aConfig.SetProperty( nHandle, rValue )) @@ -532,7 +532,7 @@ void SAL_CALL LinguProps::setFastPropertyValue( sal_Int32 nHandle, const Any& rV Any SAL_CALL LinguProps::getFastPropertyValue( sal_Int32 nHandle ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); Any aRes( aConfig.GetProperty( nHandle ) ); return aRes; @@ -543,7 +543,7 @@ Sequence< PropertyValue > SAL_CALL LinguProps::getPropertyValues() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); INT32 nLen = aPropertyMap.getSize(); Sequence< PropertyValue > aProps( nLen ); @@ -557,8 +557,8 @@ Sequence< PropertyValue > SAL_CALL rVal.Name = aIt->sName; rVal.Handle = aIt->nWID; - rVal.Value = aAny; - rVal.State = PropertyState_DIRECT_VALUE ; + rVal.Value = aAny; + rVal.State = PropertyState_DIRECT_VALUE ; } return aProps; } @@ -568,7 +568,7 @@ void SAL_CALL throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); INT32 nLen = rProps.getLength(); const PropertyValue *pVal = rProps.getConstArray(); @@ -583,7 +583,7 @@ void SAL_CALL LinguProps::dispose() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (!bDisposing) { @@ -591,9 +591,9 @@ void SAL_CALL //! its too late to save the options here! // (see AppExitListener for saving) - //aOpt.Save(); // save (possible) changes before exiting + //aOpt.Save(); // save (possible) changes before exiting - EventObject aEvtObj( (XPropertySet *) this ); + EventObject aEvtObj( (XPropertySet *) this ); aEvtListeners.disposeAndClear( aEvtObj ); aPropListeners.disposeAndClear( aEvtObj ); } @@ -603,7 +603,7 @@ void SAL_CALL LinguProps::addEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (!bDisposing && rxListener.is()) aEvtListeners.addInterface( rxListener ); @@ -613,7 +613,7 @@ void SAL_CALL LinguProps::removeEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (!bDisposing && rxListener.is()) aEvtListeners.removeInterface( rxListener ); @@ -628,7 +628,7 @@ void SAL_CALL OUString SAL_CALL LinguProps::getImplementationName() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return getImplementationName_Static(); } @@ -636,7 +636,7 @@ OUString SAL_CALL LinguProps::getImplementationName() sal_Bool SAL_CALL LinguProps::supportsService( const OUString& ServiceName ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); uno::Sequence< OUString > aSNL = getSupportedServiceNames(); const OUString * pArray = aSNL.getConstArray(); @@ -650,7 +650,7 @@ sal_Bool SAL_CALL LinguProps::supportsService( const OUString& ServiceName ) uno::Sequence< OUString > SAL_CALL LinguProps::getSupportedServiceNames() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return getSupportedServiceNames_Static(); } @@ -658,9 +658,9 @@ uno::Sequence< OUString > SAL_CALL LinguProps::getSupportedServiceNames() uno::Sequence< OUString > LinguProps::getSupportedServiceNames_Static() throw() { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); - uno::Sequence< OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich + uno::Sequence< OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich aSNS.getArray()[0] = A2OU( SN_LINGU_PROPERTIES ); return aSNS; } diff --git a/linguistic/source/lngopt.hxx b/linguistic/source/lngopt.hxx index 918f8e203e97..7e86f31fc437 100644 --- a/linguistic/source/lngopt.hxx +++ b/linguistic/source/lngopt.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -30,8 +30,8 @@ #include <functional> -#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include <cppuhelper/implbase5.hxx> // helper for implementations +#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include <cppuhelper/implbase5.hxx> // helper for implementations #include <cppuhelper/interfacecontainer.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XFastPropertySet.hpp> @@ -67,8 +67,8 @@ namespace com { namespace sun { namespace star { class LinguOptions { - static SvtLinguOptions *pData; - static vos::ORefCount aRefCount; // number of objects of this class + static SvtLinguOptions *pData; + static vos::ORefCount aRefCount; // number of objects of this class //! uses default assignment-operator @@ -81,14 +81,14 @@ public: LinguOptions(const LinguOptions &rOpt); ~LinguOptions(); - BOOL SetValue( ::com::sun::star::uno::Any &rOld, + BOOL SetValue( ::com::sun::star::uno::Any &rOld, const ::com::sun::star::uno::Any &rVal, INT32 nWID ); - void GetValue( ::com::sun::star::uno::Any &rVal, INT32 nWID ) const; + void GetValue( ::com::sun::star::uno::Any &rVal, INT32 nWID ) const; static ::rtl::OUString GetName( INT32 nWID ); const ::com::sun::star::uno::Sequence< rtl::OUString > - GetActiveDics() const { return pData->aActiveDics; } + GetActiveDics() const { return pData->aActiveDics; } const ::com::sun::star::uno::Sequence< rtl::OUString > GetActiveConvDics() const { return pData->aActiveConvDics; } @@ -103,7 +103,7 @@ public: // helper function call class struct PropHashType_Impl { - size_t operator()(const INT32 &s) const { return s; } + size_t operator()(const INT32 &s) const { return s; } }; typedef cppu::OMultiTypeInterfaceContainerHelperVar @@ -126,19 +126,19 @@ class LinguProps : com::sun::star::lang::XServiceInfo > { - ::cppu::OInterfaceContainerHelper aEvtListeners; - OPropertyListenerContainerHelper aPropListeners; + ::cppu::OInterfaceContainerHelper aEvtListeners; + OPropertyListenerContainerHelper aPropListeners; SfxItemPropertyMap aPropertyMap; SvtLinguConfig aConfig; - BOOL bDisposing; + BOOL bDisposing; // disallow copy-constructor and assignment-operator for now LinguProps(const LinguProps &); LinguProps & operator = (const LinguProps &); - void launchEvent( const ::com::sun::star::beans::PropertyChangeEvent &rEvt ) const; + void launchEvent( const ::com::sun::star::beans::PropertyChangeEvent &rEvt ) const; public: LinguProps(); diff --git a/linguistic/source/lngprophelp.cxx b/linguistic/source/lngprophelp.cxx index c4de697767e8..91b1a7ff8ebc 100644 --- a/linguistic/source/lngprophelp.cxx +++ b/linguistic/source/lngprophelp.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -125,8 +125,8 @@ void PropertyChgHelper::AddPropNames( const char *pNewNames[], INT32 nCount ) void PropertyChgHelper::SetDefaultValues() { - bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = TRUE; - bResIsUseDictionaryList = bIsUseDictionaryList = TRUE; + bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = TRUE; + bResIsUseDictionaryList = bIsUseDictionaryList = TRUE; } @@ -138,17 +138,17 @@ void PropertyChgHelper::GetCurrentValues() const OUString *pPropName = GetPropNames().getConstArray(); for (INT32 i = 0; i < nLen; ++i) { - BOOL *pbVal = NULL, - *pbResVal = NULL; - + BOOL *pbVal = NULL, + *pbResVal = NULL; + if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_IGNORE_CONTROL_CHARACTERS ) )) { - pbVal = &bIsIgnoreControlCharacters; + pbVal = &bIsIgnoreControlCharacters; pbResVal = &bResIsIgnoreControlCharacters; } else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_USE_DICTIONARY_LIST ) )) { - pbVal = &bIsUseDictionaryList; + pbVal = &bIsUseDictionaryList; pbResVal = &bResIsUseDictionaryList; } @@ -166,8 +166,8 @@ void PropertyChgHelper::SetTmpPropVals( const PropertyValues &rPropVals ) { // return value is default value unless there is an explicitly supplied // temporary value - bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters; - bResIsUseDictionaryList = bIsUseDictionaryList; + bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters; + bResIsUseDictionaryList = bIsUseDictionaryList; // INT32 nLen = rPropVals.getLength(); if (nLen) @@ -178,9 +178,9 @@ void PropertyChgHelper::SetTmpPropVals( const PropertyValues &rPropVals ) BOOL *pbResVal = NULL; switch (pVal[i].Handle) { - case UPH_IS_IGNORE_CONTROL_CHARACTERS : + case UPH_IS_IGNORE_CONTROL_CHARACTERS : pbResVal = &bResIsIgnoreControlCharacters; break; - case UPH_IS_USE_DICTIONARY_LIST : + case UPH_IS_USE_DICTIONARY_LIST : pbResVal = &bResIsUseDictionaryList; break; default: ; @@ -201,8 +201,8 @@ BOOL PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt ) { INT16 nLngSvcFlags = (nEvtFlags & AE_HYPHENATOR) ? LinguServiceEventFlags::HYPHENATE_AGAIN : 0; - BOOL bSCWA = FALSE, // SPELL_CORRECT_WORDS_AGAIN ? - bSWWA = FALSE; // SPELL_WRONG_WORDS_AGAIN ? + BOOL bSCWA = FALSE, // SPELL_CORRECT_WORDS_AGAIN ? + bSWWA = FALSE; // SPELL_WRONG_WORDS_AGAIN ? BOOL *pbVal = NULL; switch (rEvt.PropertyHandle) @@ -213,7 +213,7 @@ BOOL PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt ) nLngSvcFlags = 0; break; } - case UPH_IS_USE_DICTIONARY_LIST : + case UPH_IS_USE_DICTIONARY_LIST : { pbVal = &bIsUseDictionaryList; bSCWA = bSWWA = TRUE; @@ -228,7 +228,7 @@ BOOL PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt ) if (pbVal) rEvt.NewValue >>= *pbVal; - bRes = 0 != pbVal; // sth changed? + bRes = 0 != pbVal; // sth changed? if (bRes) { BOOL bSpellEvts = (nEvtFlags & AE_SPELLCHECKER) ? TRUE : FALSE; @@ -252,7 +252,7 @@ void SAL_CALL PropertyChgHelper::propertyChange( const PropertyChangeEvent& rEvt ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); propertyChange_Impl( rEvt ); } @@ -301,7 +301,7 @@ void PropertyChgHelper::LaunchEvent( const LinguServiceEvent &rEvt ) void SAL_CALL PropertyChgHelper::disposing( const EventObject& rSource ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (rSource.Source == xPropSet) { RemoveAsPropListener(); @@ -316,12 +316,12 @@ sal_Bool SAL_CALL const Reference< XLinguServiceEventListener >& rxListener ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); BOOL bRes = FALSE; if (rxListener.is()) { - INT32 nCount = aLngSvcEvtListeners.getLength(); + INT32 nCount = aLngSvcEvtListeners.getLength(); bRes = aLngSvcEvtListeners.addInterface( rxListener ) != nCount; } return bRes; @@ -333,24 +333,24 @@ sal_Bool SAL_CALL const Reference< XLinguServiceEventListener >& rxListener ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); BOOL bRes = FALSE; if (rxListener.is()) { - INT32 nCount = aLngSvcEvtListeners.getLength(); + INT32 nCount = aLngSvcEvtListeners.getLength(); bRes = aLngSvcEvtListeners.removeInterface( rxListener ) != nCount; } return bRes; } /////////////////////////////////////////////////////////////////////////// - + PropertyHelper_Thes::PropertyHelper_Thes( const Reference< XInterface > &rxSource, Reference< XPropertySet > &rxPropSet ) : - PropertyChgHelper ( rxSource, rxPropSet, 0 ) + PropertyChgHelper ( rxSource, rxPropSet, 0 ) { SetDefaultValues(); GetCurrentValues(); @@ -366,7 +366,7 @@ void SAL_CALL PropertyHelper_Thes::propertyChange( const PropertyChangeEvent& rEvt ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); PropertyChgHelper::propertyChange_Impl( rEvt ); } @@ -386,7 +386,7 @@ static const char *aSP[] = PropertyHelper_Spell::PropertyHelper_Spell( const Reference< XInterface > & rxSource, Reference< XPropertySet > &rxPropSet ) : - PropertyChgHelper ( rxSource, rxPropSet, AE_SPELLCHECKER ) + PropertyChgHelper ( rxSource, rxPropSet, AE_SPELLCHECKER ) { AddPropNames( aSP, sizeof(aSP) / sizeof(aSP[0]) ); SetDefaultValues(); @@ -405,9 +405,9 @@ void PropertyHelper_Spell::SetDefaultValues() { PropertyChgHelper::SetDefaultValues(); - bResIsSpellUpperCase = bIsSpellUpperCase = FALSE; - bResIsSpellWithDigits = bIsSpellWithDigits = FALSE; - bResIsSpellCapitalization = bIsSpellCapitalization = TRUE; + bResIsSpellUpperCase = bIsSpellUpperCase = FALSE; + bResIsSpellWithDigits = bIsSpellWithDigits = FALSE; + bResIsSpellCapitalization = bIsSpellCapitalization = TRUE; } @@ -421,22 +421,22 @@ void PropertyHelper_Spell::GetCurrentValues() const OUString *pPropName = GetPropNames().getConstArray(); for (INT32 i = 0; i < nLen; ++i) { - BOOL *pbVal = NULL, - *pbResVal = NULL; - + BOOL *pbVal = NULL, + *pbResVal = NULL; + if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_SPELL_UPPER_CASE ) )) { - pbVal = &bIsSpellUpperCase; + pbVal = &bIsSpellUpperCase; pbResVal = &bResIsSpellUpperCase; } else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_SPELL_WITH_DIGITS ) )) { - pbVal = &bIsSpellWithDigits; + pbVal = &bIsSpellWithDigits; pbResVal = &bResIsSpellWithDigits; } else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_IS_SPELL_CAPITALIZATION ) )) { - pbVal = &bIsSpellCapitalization; + pbVal = &bIsSpellCapitalization; pbResVal = &bResIsSpellCapitalization; } @@ -457,31 +457,31 @@ BOOL PropertyHelper_Spell::propertyChange_Impl( const PropertyChangeEvent& rEvt if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet()) { INT16 nLngSvcFlags = 0; - BOOL bSCWA = FALSE, // SPELL_CORRECT_WORDS_AGAIN ? - bSWWA = FALSE; // SPELL_WRONG_WORDS_AGAIN ? + BOOL bSCWA = FALSE, // SPELL_CORRECT_WORDS_AGAIN ? + bSWWA = FALSE; // SPELL_WRONG_WORDS_AGAIN ? BOOL *pbVal = NULL; switch (rEvt.PropertyHandle) { - case UPH_IS_SPELL_UPPER_CASE : + case UPH_IS_SPELL_UPPER_CASE : { pbVal = &bIsSpellUpperCase; - bSCWA = FALSE == *pbVal; // FALSE->TRUE change? - bSWWA = !bSCWA; // TRUE->FALSE change? + bSCWA = FALSE == *pbVal; // FALSE->TRUE change? + bSWWA = !bSCWA; // TRUE->FALSE change? break; } - case UPH_IS_SPELL_WITH_DIGITS : + case UPH_IS_SPELL_WITH_DIGITS : { pbVal = &bIsSpellWithDigits; - bSCWA = FALSE == *pbVal; // FALSE->TRUE change? - bSWWA = !bSCWA; // TRUE->FALSE change? + bSCWA = FALSE == *pbVal; // FALSE->TRUE change? + bSWWA = !bSCWA; // TRUE->FALSE change? break; } - case UPH_IS_SPELL_CAPITALIZATION : + case UPH_IS_SPELL_CAPITALIZATION : { pbVal = &bIsSpellCapitalization; - bSCWA = FALSE == *pbVal; // FALSE->TRUE change? - bSWWA = !bSCWA; // TRUE->FALSE change? + bSCWA = FALSE == *pbVal; // FALSE->TRUE change? + bSWWA = !bSCWA; // TRUE->FALSE change? break; } default: @@ -513,7 +513,7 @@ void SAL_CALL PropertyHelper_Spell::propertyChange( const PropertyChangeEvent& rEvt ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); propertyChange_Impl( rEvt ); } @@ -525,8 +525,8 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals ) // return value is default value unless there is an explicitly supplied // temporary value nResMaxNumberOfSuggestions = GetDefaultNumberOfSuggestions(); - bResIsSpellWithDigits = bIsSpellWithDigits; - bResIsSpellCapitalization = bIsSpellCapitalization; + bResIsSpellWithDigits = bIsSpellWithDigits; + bResIsSpellCapitalization = bIsSpellCapitalization; // INT32 nLen = rPropVals.getLength(); if (nLen) @@ -574,7 +574,7 @@ static const char *aHP[] = PropertyHelper_Hyphen::PropertyHelper_Hyphen( const Reference< XInterface > & rxSource, Reference< XPropertySet > &rxPropSet ) : - PropertyChgHelper ( rxSource, rxPropSet, AE_HYPHENATOR ) + PropertyChgHelper ( rxSource, rxPropSet, AE_HYPHENATOR ) { AddPropNames( aHP, sizeof(aHP) / sizeof(aHP[0]) ); SetDefaultValues(); @@ -591,9 +591,9 @@ void PropertyHelper_Hyphen::SetDefaultValues() { PropertyChgHelper::SetDefaultValues(); - nResHyphMinLeading = nHyphMinLeading = 2; - nResHyphMinTrailing = nHyphMinTrailing = 2; - nResHyphMinWordLength = nHyphMinWordLength = 0; + nResHyphMinLeading = nHyphMinLeading = 2; + nResHyphMinTrailing = nHyphMinTrailing = 2; + nResHyphMinWordLength = nHyphMinWordLength = 0; } @@ -607,22 +607,22 @@ void PropertyHelper_Hyphen::GetCurrentValues() const OUString *pPropName = GetPropNames().getConstArray(); for (INT32 i = 0; i < nLen; ++i) { - INT16 *pnVal = NULL, + INT16 *pnVal = NULL, *pnResVal = NULL; if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_HYPH_MIN_LEADING ) )) { - pnVal = &nHyphMinLeading; + pnVal = &nHyphMinLeading; pnResVal = &nResHyphMinLeading; } else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_HYPH_MIN_TRAILING ) )) { - pnVal = &nHyphMinTrailing; + pnVal = &nHyphMinTrailing; pnResVal = &nResHyphMinTrailing; } else if (pPropName[i].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_HYPH_MIN_WORD_LENGTH ) )) { - pnVal = &nHyphMinWordLength; + pnVal = &nHyphMinWordLength; pnResVal = &nResHyphMinWordLength; } @@ -644,11 +644,11 @@ BOOL PropertyHelper_Hyphen::propertyChange_Impl( const PropertyChangeEvent& rEvt { INT16 nLngSvcFlags = LinguServiceEventFlags::HYPHENATE_AGAIN; - INT16 *pnVal = NULL; + INT16 *pnVal = NULL; switch (rEvt.PropertyHandle) { - case UPH_HYPH_MIN_LEADING : pnVal = &nHyphMinLeading; break; - case UPH_HYPH_MIN_TRAILING : pnVal = &nHyphMinTrailing; break; + case UPH_HYPH_MIN_LEADING : pnVal = &nHyphMinLeading; break; + case UPH_HYPH_MIN_TRAILING : pnVal = &nHyphMinTrailing; break; case UPH_HYPH_MIN_WORD_LENGTH : pnVal = &nHyphMinWordLength; break; default: DBG_ASSERT( 0, "unknown property" ); @@ -675,7 +675,7 @@ void SAL_CALL PropertyHelper_Hyphen::propertyChange( const PropertyChangeEvent& rEvt ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); propertyChange_Impl( rEvt ); } @@ -683,12 +683,12 @@ void SAL_CALL void PropertyHelper_Hyphen::SetTmpPropVals( const PropertyValues &rPropVals ) { PropertyChgHelper::SetTmpPropVals( rPropVals ); - + // return value is default value unless there is an explicitly supplied // temporary value - nResHyphMinLeading = nHyphMinLeading; - nResHyphMinTrailing = nHyphMinTrailing; - nResHyphMinWordLength = nHyphMinWordLength; + nResHyphMinLeading = nHyphMinLeading; + nResHyphMinTrailing = nHyphMinTrailing; + nResHyphMinWordLength = nHyphMinWordLength; // INT32 nLen = rPropVals.getLength(); if (nLen) @@ -696,11 +696,11 @@ void PropertyHelper_Hyphen::SetTmpPropVals( const PropertyValues &rPropVals ) const PropertyValue *pVal = rPropVals.getConstArray(); for (INT32 i = 0; i < nLen; ++i) { - INT16 *pnResVal = NULL; + INT16 *pnResVal = NULL; switch (pVal[i].Handle) { - case UPH_HYPH_MIN_LEADING : pnResVal = &nResHyphMinLeading; break; - case UPH_HYPH_MIN_TRAILING : pnResVal = &nResHyphMinTrailing; break; + case UPH_HYPH_MIN_LEADING : pnResVal = &nResHyphMinLeading; break; + case UPH_HYPH_MIN_TRAILING : pnResVal = &nResHyphMinTrailing; break; case UPH_HYPH_MIN_WORD_LENGTH : pnResVal = &nResHyphMinWordLength; break; default: DBG_ASSERT( 0, "unknown property" ); diff --git a/linguistic/source/lngreg.cxx b/linguistic/source/lngreg.cxx index 2eaadda56f16..6ab3db60d268 100644 --- a/linguistic/source/lngreg.cxx +++ b/linguistic/source/lngreg.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -29,7 +29,7 @@ #include "precompiled_linguistic.hxx" -#include <cppuhelper/factory.hxx> // helper for factories +#include <cppuhelper/factory.hxx> // helper for factories #include <rtl/string.hxx> #include <com/sun/star/registry/XRegistryKey.hpp> @@ -144,10 +144,10 @@ sal_Bool SAL_CALL component_writeInfo bRet = ConvDicList_writeInfo( pServiceManager, pRegistryKey ); if(bRet) bRet = GrammarCheckingIterator_writeInfo( pServiceManager, pRegistryKey ); -/* +/* if(bRet) bRet = GrammarChecker_writeInfo( pServiceManager, pRegistryKey ); -*/ +*/ return bRet; } @@ -159,7 +159,7 @@ void * SAL_CALL component_getFactory( pImplName, reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), pRegistryKey ); - + if(!pRet) pRet = LinguProps_getFactory( pImplName, @@ -167,7 +167,7 @@ void * SAL_CALL component_getFactory( pRegistryKey ); if(!pRet) - pRet = DicList_getFactory( + pRet = DicList_getFactory( pImplName, reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), pRegistryKey ); diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 82caafe02e3c..90e433f50f07 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -161,8 +161,8 @@ struct SvcInfo SvcInfo( const OUString &rSvcImplName, const uno::Sequence< INT16 > &rSuppLanguages ) : - aSvcImplName (rSvcImplName), - aSuppLanguages (rSuppLanguages) + aSvcImplName (rSvcImplName), + aSuppLanguages (rSuppLanguages) { } @@ -207,7 +207,7 @@ void LngSvcMgr::SetAvailableCfgServiceLists( LinguDispatcher &rDispatcher, default : DBG_ASSERT( 0, "unexpected case" ); } - String aNode( String::CreateFromAscii( pEntryName ) ); + String aNode( String::CreateFromAscii( pEntryName ) ); uno::Sequence < OUString > aNodeNames( /*aCfg.*/GetNodeNames( aNode ) ); @@ -287,21 +287,21 @@ class LngSvcMgrListenerHelper : LngSvcMgr &rMyManager; // Timer aLaunchTimer; - //cppu::OMultiTypeInterfaceContainerHelper aListeners; - ::cppu::OInterfaceContainerHelper aLngSvcMgrListeners; - ::cppu::OInterfaceContainerHelper aLngSvcEvtBroadcasters; + //cppu::OMultiTypeInterfaceContainerHelper aListeners; + ::cppu::OInterfaceContainerHelper aLngSvcMgrListeners; + ::cppu::OInterfaceContainerHelper aLngSvcEvtBroadcasters; uno::Reference< linguistic2::XDictionaryList > xDicList; uno::Reference< uno::XInterface > xMyEvtObj; - INT16 nCombinedLngSvcEvt; + INT16 nCombinedLngSvcEvt; // disallow copy-constructor and assignment-operator for now LngSvcMgrListenerHelper(const LngSvcMgrListenerHelper &); LngSvcMgrListenerHelper & operator = (const LngSvcMgrListenerHelper &); - void LaunchEvent( INT16 nLngSvcEvtFlags ); + void LaunchEvent( INT16 nLngSvcEvtFlags ); -// DECL_LINK( TimeOut, Timer* ); +// DECL_LINK( TimeOut, Timer* ); long Timeout(); public: @@ -325,14 +325,14 @@ public: const linguistic2::DictionaryListEvent& rDicListEvent ) throw(uno::RuntimeException); - inline BOOL AddLngSvcMgrListener( + inline BOOL AddLngSvcMgrListener( const uno::Reference< lang::XEventListener >& rxListener ); - inline BOOL RemoveLngSvcMgrListener( + inline BOOL RemoveLngSvcMgrListener( const uno::Reference< lang::XEventListener >& rxListener ); void DisposeAndClear( const lang::EventObject &rEvtObj ); - BOOL AddLngSvcEvtBroadcaster( + BOOL AddLngSvcEvtBroadcaster( const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster ); - BOOL RemoveLngSvcEvtBroadcaster( + BOOL RemoveLngSvcEvtBroadcaster( const uno::Reference< linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster ); void AddLngSvcEvt( INT16 nLngSvcEvt ); @@ -344,10 +344,10 @@ LngSvcMgrListenerHelper::LngSvcMgrListenerHelper( const uno::Reference< uno::XInterface > &rxSource, const uno::Reference< linguistic2::XDictionaryList > &rxDicList ) : rMyManager ( rLngSvcMgr ), - aLngSvcMgrListeners ( GetLinguMutex() ), - aLngSvcEvtBroadcasters ( GetLinguMutex() ), - xDicList ( rxDicList ), - xMyEvtObj ( rxSource ) + aLngSvcMgrListeners ( GetLinguMutex() ), + aLngSvcEvtBroadcasters ( GetLinguMutex() ), + xDicList ( rxDicList ), + xMyEvtObj ( rxSource ) { if (xDicList.is()) { @@ -361,8 +361,8 @@ LngSvcMgrListenerHelper::LngSvcMgrListenerHelper( //! listeners, and each of them is launching an event of it's own!) //! Thus this behaviour is necessary to avoid unecessary actions of //! this objects listeners! -// aLaunchTimer.SetTimeout( 2000 ); -// aLaunchTimer.SetTimeoutHdl( LINK( this, LngSvcMgrListenerHelper, TimeOut ) ); +// aLaunchTimer.SetTimeout( 2000 ); +// aLaunchTimer.SetTimeoutHdl( LINK( this, LngSvcMgrListenerHelper, TimeOut ) ); nCombinedLngSvcEvt = 0; } @@ -388,7 +388,7 @@ long LngSvcMgrListenerHelper::Timeout() { osl::MutexGuard aGuard( GetLinguMutex() ); -// if (&aLaunchTimer == pTimer) +// if (&aLaunchTimer == pTimer) { // change event source to LinguServiceManager since the listeners // probably do not know (and need not to know) about the specific @@ -415,7 +415,7 @@ long LngSvcMgrListenerHelper::Timeout() void LngSvcMgrListenerHelper::AddLngSvcEvt( INT16 nLngSvcEvt ) { nCombinedLngSvcEvt |= nLngSvcEvt; -// aLaunchTimer.Start(); +// aLaunchTimer.Start(); Timeout(); } @@ -576,18 +576,18 @@ BOOL LngSvcMgrListenerHelper::RemoveLngSvcEvtBroadcaster( LngSvcMgr::LngSvcMgr() : utl::ConfigItem( String::CreateFromAscii( "Office.Linguistic" ) ), - aEvtListeners ( GetLinguMutex() ) + aEvtListeners ( GetLinguMutex() ) { - bHasAvailSpellLocales = + bHasAvailSpellLocales = bHasAvailGrammarLocales = - bHasAvailHyphLocales = - bHasAvailThesLocales = + bHasAvailHyphLocales = + bHasAvailThesLocales = bDisposing = FALSE; - pSpellDsp = 0; + pSpellDsp = 0; pGrammarDsp = 0; - pHyphDsp = 0; - pThesDsp = 0; + pHyphDsp = 0; + pThesDsp = 0; pAvailSpellSvcs = 0; pAvailGrammarSvcs = 0; @@ -652,7 +652,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; + delete pAvailSpellSvcs; pAvailSpellSvcs = 0; OUString aNode( aSpellCheckerList ); if (lcl_SeqHasString( aSpellCheckerListEntries, aKeyText )) @@ -705,7 +705,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; + delete pAvailHyphSvcs; pAvailHyphSvcs = 0; OUString aNode( aHyphenatorList ); if (lcl_SeqHasString( aHyphenatorListEntries, aKeyText )) @@ -730,7 +730,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; + delete pAvailThesSvcs; pAvailThesSvcs = 0; OUString aNode( aThesaurusList ); if (lcl_SeqHasString( aThesaurusListEntries, aKeyText )) @@ -783,8 +783,8 @@ void LngSvcMgr::GetSpellCheckerDsp_Impl( sal_Bool bSetSvcList ) { if (!pSpellDsp) { - pSpellDsp = new SpellCheckerDispatcher( *this ); - xSpellDsp = pSpellDsp; + pSpellDsp = new SpellCheckerDispatcher( *this ); + xSpellDsp = pSpellDsp; if (bSetSvcList) SetCfgServiceLists( *pSpellDsp ); } @@ -826,8 +826,8 @@ void LngSvcMgr::GetHyphenatorDsp_Impl( sal_Bool bSetSvcList ) { if (!pHyphDsp) { - pHyphDsp = new HyphenatorDispatcher( *this ); - xHyphDsp = pHyphDsp; + pHyphDsp = new HyphenatorDispatcher( *this ); + xHyphDsp = pHyphDsp; if (bSetSvcList) SetCfgServiceLists( *pHyphDsp ); } @@ -838,8 +838,8 @@ void LngSvcMgr::GetThesaurusDsp_Impl( sal_Bool bSetSvcList ) { if (!pThesDsp) { - pThesDsp = new ThesaurusDispatcher; - xThesDsp = pThesDsp; + pThesDsp = new ThesaurusDispatcher; + xThesDsp = pThesDsp; if (bSetSvcList) SetCfgServiceLists( *pThesDsp ); } @@ -889,7 +889,7 @@ void LngSvcMgr::GetAvailableSpellSvcs_Impl() if (xSvc.is()) { - OUString aImplName; + OUString aImplName; uno::Sequence< INT16 > aLanguages; uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY ); if (xInfo.is()) @@ -1020,7 +1020,7 @@ void LngSvcMgr::GetAvailableHyphSvcs_Impl() if (xSvc.is()) { - OUString aImplName; + OUString aImplName; uno::Sequence< INT16 > aLanguages; uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY ); if (xInfo.is()) @@ -1087,7 +1087,7 @@ void LngSvcMgr::GetAvailableThesSvcs_Impl() if (xSvc.is()) { - OUString aImplName; + OUString aImplName; uno::Sequence< INT16 > aLanguages; uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY ); if (xInfo.is()) @@ -1469,11 +1469,11 @@ uno::Sequence< lang::Locale > SAL_CALL uno::Sequence< lang::Locale > aRes; uno::Sequence< lang::Locale > *pAvailLocales = NULL; - BOOL *pHasAvailLocales = NULL; + BOOL *pHasAvailLocales = NULL; if (0 == rServiceName.compareToAscii( SN_SPELLCHECKER )) { - pAvailLocales = &aAvailSpellLocales; - pHasAvailLocales = &bHasAvailSpellLocales; + pAvailLocales = &aAvailSpellLocales; + pHasAvailLocales = &bHasAvailSpellLocales; } else if (0 == rServiceName.compareToAscii( SN_GRAMMARCHECKER )) { @@ -1482,13 +1482,13 @@ uno::Sequence< lang::Locale > SAL_CALL } else if (0 == rServiceName.compareToAscii( SN_HYPHENATOR )) { - pAvailLocales = &aAvailHyphLocales; - pHasAvailLocales = &bHasAvailHyphLocales; + pAvailLocales = &aAvailHyphLocales; + pHasAvailLocales = &bHasAvailHyphLocales; } else if (0 == rServiceName.compareToAscii( SN_THESAURUS )) { - pAvailLocales = &aAvailThesLocales; - pHasAvailLocales = &bHasAvailThesLocales; + pAvailLocales = &aAvailThesLocales; + pHasAvailLocales = &bHasAvailThesLocales; } // about pHasAvailLocales: nowadays (with OOo lingu in SO) we want to know immediately about @@ -1496,12 +1496,12 @@ uno::Sequence< lang::Locale > SAL_CALL // is used to activate them. Thus we can not rely anymore on buffered data. if (pAvailLocales /*&& pHasAvailLocales */) { -// if (!*pHasAvailLocales) -// { +// if (!*pHasAvailLocales) +// { *pAvailLocales = GetAvailLocales( getAvailableServices( rServiceName, lang::Locale() ) ); -// *pHasAvailLocales = TRUE; -// } +// *pHasAvailLocales = TRUE; +// } aRes = *pAvailLocales; } @@ -1976,7 +1976,7 @@ uno::Sequence< OUString > LngSvcMgr::getSupportedServiceNames_Static() { osl::MutexGuard aGuard( GetLinguMutex() ); - uno::Sequence< OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich + uno::Sequence< OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich aSNS.getArray()[0] = A2OU( SN_LINGU_SERVCICE_MANAGER ); return aSNS; } diff --git a/linguistic/source/lngsvcmgr.hxx b/linguistic/source/lngsvcmgr.hxx index 5ffb9defdb4d..953e531960bf 100644 --- a/linguistic/source/lngsvcmgr.hxx +++ b/linguistic/source/lngsvcmgr.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -28,9 +28,9 @@ #ifndef _LINGUISTIC_LNGSVCMGR_HXX_ #define _LINGUISTIC_LNGSVCMGR_HXX_ -#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include <cppuhelper/implbase4.hxx> // helper for implementations -#include <cppuhelper/interfacecontainer.h> //OMultiTypeInterfaceContainerHelper +#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include <cppuhelper/implbase4.hxx> // helper for implementations +#include <cppuhelper/interfacecontainer.h> //OMultiTypeInterfaceContainerHelper #include <com/sun/star/uno/Reference.h> @@ -76,42 +76,42 @@ class LngSvcMgr : { friend class LngSvcMgrListenerHelper; - ::cppu::OInterfaceContainerHelper aEvtListeners; + ::cppu::OInterfaceContainerHelper aEvtListeners; com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker > xSpellDsp; com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XProofreadingIterator > xGrammarDsp; + ::com::sun::star::linguistic2::XProofreadingIterator > xGrammarDsp; com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenator > xHyphDsp; com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XThesaurus > xThesDsp; - + com::sun::star::uno::Reference< - ::com::sun::star::lang::XEventListener > xListenerHelper; - + ::com::sun::star::lang::XEventListener > xListenerHelper; + com::sun::star::uno::Sequence< - com::sun::star::lang::Locale > aAvailSpellLocales; + com::sun::star::lang::Locale > aAvailSpellLocales; com::sun::star::uno::Sequence< com::sun::star::lang::Locale > aAvailGrammarLocales; com::sun::star::uno::Sequence< - com::sun::star::lang::Locale > aAvailHyphLocales; + com::sun::star::lang::Locale > aAvailHyphLocales; com::sun::star::uno::Sequence< - com::sun::star::lang::Locale > aAvailThesLocales; + com::sun::star::lang::Locale > aAvailThesLocales; - SpellCheckerDispatcher * pSpellDsp; + SpellCheckerDispatcher * pSpellDsp; GrammarCheckingIterator * pGrammarDsp; - HyphenatorDispatcher * pHyphDsp; - ThesaurusDispatcher * pThesDsp; + HyphenatorDispatcher * pHyphDsp; + ThesaurusDispatcher * pThesDsp; + + LngSvcMgrListenerHelper * pListenerHelper; - LngSvcMgrListenerHelper * pListenerHelper; - typedef std::vector< SvcInfo * > SvcInfoArray; - SvcInfoArray * pAvailSpellSvcs; + SvcInfoArray * pAvailSpellSvcs; SvcInfoArray * pAvailGrammarSvcs; - SvcInfoArray * pAvailHyphSvcs; - SvcInfoArray * pAvailThesSvcs; - + SvcInfoArray * pAvailHyphSvcs; + SvcInfoArray * pAvailThesSvcs; + BOOL bDisposing; BOOL bHasAvailSpellLocales; BOOL bHasAvailGrammarLocales; @@ -121,24 +121,24 @@ class LngSvcMgr : // disallow copy-constructor and assignment-operator for now LngSvcMgr(const LngSvcMgr &); LngSvcMgr & operator = (const LngSvcMgr &); - - void GetAvailableSpellSvcs_Impl(); + + void GetAvailableSpellSvcs_Impl(); void GetAvailableGrammarSvcs_Impl(); - void GetAvailableHyphSvcs_Impl(); - void GetAvailableThesSvcs_Impl(); - void GetListenerHelper_Impl(); - + void GetAvailableHyphSvcs_Impl(); + void GetAvailableThesSvcs_Impl(); + void GetListenerHelper_Impl(); + void GetSpellCheckerDsp_Impl( sal_Bool bSetSvcList = sal_True ); void GetGrammarCheckerDsp_Impl( sal_Bool bSetSvcList = sal_True ); void GetHyphenatorDsp_Impl( sal_Bool bSetSvcList = sal_True ); void GetThesaurusDsp_Impl( sal_Bool bSetSvcList = sal_True ); - void SetCfgServiceLists( SpellCheckerDispatcher &rSpellDsp ); + void SetCfgServiceLists( SpellCheckerDispatcher &rSpellDsp ); void SetCfgServiceLists( GrammarCheckingIterator &rGrammarDsp ); - void SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp ); - void SetCfgServiceLists( ThesaurusDispatcher &rThesDsp ); - - BOOL SaveCfgSvcs( const String &rServiceName ); + void SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp ); + void SetCfgServiceLists( ThesaurusDispatcher &rThesDsp ); + + BOOL SaveCfgSvcs( const String &rServiceName ); void SetAvailableCfgServiceLists( LinguDispatcher &rDispatcher, const SvcInfoArray &rAvailSvcs ); @@ -161,9 +161,9 @@ public: virtual void SAL_CALL setConfiguredServices( const ::rtl::OUString& aServiceName, const ::com::sun::star::lang::Locale& aLocale, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aServiceImplNames ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getConfiguredServices( const ::rtl::OUString& aServiceName, const ::com::sun::star::lang::Locale& aLocale ) throw (::com::sun::star::uno::RuntimeException); - // XAvailableLocales + // XAvailableLocales virtual ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > SAL_CALL getAvailableLocales( const ::rtl::OUString& aServiceName ) throw (::com::sun::star::uno::RuntimeException); - + // XComponent virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); @@ -178,11 +178,11 @@ public: static inline ::rtl::OUString getImplementationName_Static(); static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw(); - BOOL AddLngSvcEvtBroadcaster( - const ::com::sun::star::uno::Reference< + BOOL AddLngSvcEvtBroadcaster( + const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster ); - BOOL RemoveLngSvcEvtBroadcaster( - const ::com::sun::star::uno::Reference< + BOOL RemoveLngSvcEvtBroadcaster( + const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLinguServiceEventBroadcaster > &rxBroadcaster ); }; diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 039ad0dee27b..7fb35b26a908 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -79,7 +79,7 @@ struct LinguMutex : public rtl::Static< osl::Mutex, LinguMutex > { }; -osl::Mutex & GetLinguMutex() +osl::Mutex & GetLinguMutex() { return LinguMutex::get(); } @@ -282,7 +282,7 @@ BOOL IsUseDicList( const PropertyValues &rProperties, break; } } - if (i >= nLen) // no temporary value found in 'rProperties' + if (i >= nLen) // no temporary value found in 'rProperties' { uno::Reference< XFastPropertySet > xFast( rxProp, UNO_QUERY ); if (xFast.is()) @@ -310,7 +310,7 @@ BOOL IsIgnoreControlChars( const PropertyValues &rProperties, break; } } - if (i >= nLen) // no temporary value found in 'rProperties' + if (i >= nLen) // no temporary value found in 'rProperties' { uno::Reference< XFastPropertySet > xFast( rxProp, UNO_QUERY ); if (xFast.is()) @@ -340,7 +340,7 @@ uno::Reference< XDictionaryEntry > SearchDicList( const OUString &rWord, INT16 nLanguage, BOOL bSearchPosDics, BOOL bSearchSpellEntry ) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); uno::Reference< XDictionaryEntry > xEntry; @@ -358,8 +358,8 @@ uno::Reference< XDictionaryEntry > SearchDicList( { uno::Reference< XDictionary > axDic( pDic[i], UNO_QUERY ); - DictionaryType eType = axDic->getDictionaryType(); - INT16 nLang = LocaleToLanguage( axDic->getLocale() ); + DictionaryType eType = axDic->getDictionaryType(); + INT16 nLang = LocaleToLanguage( axDic->getLocale() ); if ( axDic.is() && axDic->isActive() && (nLang == nLanguage || nLang == LANGUAGE_NONE) ) @@ -460,7 +460,7 @@ sal_uInt8 AddEntryToDic( LanguageType LocaleToLanguage( const Locale& rLocale ) { - // empty Locale -> LANGUAGE_NONE + // empty Locale -> LANGUAGE_NONE if ( rLocale.Language.getLength() == 0 ) return LANGUAGE_NONE; @@ -470,7 +470,7 @@ LanguageType LocaleToLanguage( const Locale& rLocale ) Locale& LanguageToLocale( Locale& rLocale, LanguageType eLang ) { - if ( eLang != LANGUAGE_NONE /* && eLang != LANGUAGE_SYSTEM */) + if ( eLang != LANGUAGE_NONE /* && eLang != LANGUAGE_SYSTEM */) MsLangId::convertLanguageToLocale( eLang, rLocale ); return rLocale; @@ -561,7 +561,7 @@ static BOOL GetAltSpelling( INT16 &rnChgPos, INT16 &rnChgLen, OUString &rRplc, aHyphenatedWord( rxHyphWord->getHyphenatedWord() ); INT16 nHyphenationPos = rxHyphWord->getHyphenationPos(); /*INT16 nHyphenPos = rxHyphWord->getHyphenPos()*/; - const sal_Unicode *pWord = aWord.getStr(), + const sal_Unicode *pWord = aWord.getStr(), *pAltWord = aHyphenatedWord.getStr(); // at least char changes directly left or right to the hyphen @@ -572,7 +572,7 @@ static BOOL GetAltSpelling( INT16 &rnChgPos, INT16 &rnChgLen, OUString &rRplc, //! to an extend.) // find first different char from left - sal_Int32 nPosL = 0, + sal_Int32 nPosL = 0, nAltPosL = 0; for (INT16 i = 0 ; pWord[ nPosL ] == pAltWord[ nAltPosL ]; nPosL++, nAltPosL++, i++) { @@ -585,7 +585,7 @@ static BOOL GetAltSpelling( INT16 &rnChgPos, INT16 &rnChgLen, OUString &rRplc, } // find first different char from right - sal_Int32 nPosR = aWord.getLength() - 1, + sal_Int32 nPosR = aWord.getLength() - 1, nAltPosR = aHyphenatedWord.getLength() - 1; for ( ; nPosR >= nPosL && nAltPosR >= nAltPosL && pWord[ nPosR ] == pAltWord[ nAltPosR ]; @@ -645,7 +645,7 @@ uno::Reference< XHyphenatedWord > RebuildHyphensAndControlChars( uno::Reference< XHyphenatedWord > xRes; if (rOrigWord.getLength() && rxHyphWord.is()) { - INT16 nChgPos = 0, + INT16 nChgPos = 0, nChgLen = 0; OUString aRplc; BOOL bAltSpelling = GetAltSpelling( nChgPos, nChgLen, aRplc, rxHyphWord ); @@ -716,7 +716,7 @@ static CharClass & lcl_GetCharClass() osl::Mutex & lcl_GetCharClassMutex() { - static osl::Mutex aMutex; + static osl::Mutex aMutex; return aMutex; } @@ -728,7 +728,7 @@ BOOL IsUpper( const String &rText, xub_StrLen nPos, xub_StrLen nLen, INT16 nLang CharClass &rCC = lcl_GetCharClass(); rCC.setLocale( CreateLocale( nLanguage ) ); sal_Int32 nFlags = rCC.getStringType( rText, nPos, nLen ); - return (nFlags & KCharacterType::UPPER) + return (nFlags & KCharacterType::UPPER) && !(nFlags & KCharacterType::LOWER); } @@ -775,7 +775,7 @@ String ToTitle( const String &rText, INT16 nLanguage ) } -sal_Unicode ToLower( const sal_Unicode cChar, INT16 nLanguage ) +sal_Unicode ToLower( const sal_Unicode cChar, INT16 nLanguage ) { MutexGuard aGuard( lcl_GetCharClassMutex() ); @@ -785,7 +785,7 @@ sal_Unicode ToLower( const sal_Unicode cChar, INT16 nLanguage ) } -sal_Unicode ToUpper( const sal_Unicode cChar, INT16 nLanguage ) +sal_Unicode ToUpper( const sal_Unicode cChar, INT16 nLanguage ) { MutexGuard aGuard( lcl_GetCharClassMutex() ); @@ -974,11 +974,11 @@ void SAL_CALL AppExitListener::disposing( const EventObject& rEvtSource ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (xDesktop.is() && rEvtSource.Source == xDesktop) { - xDesktop = NULL; //! release reference to desktop + xDesktop = NULL; //! release reference to desktop } } @@ -987,7 +987,7 @@ void SAL_CALL AppExitListener::queryTermination( const EventObject& /*rEvtSource*/ ) throw(frame::TerminationVetoException, RuntimeException) { - //MutexGuard aGuard( GetLinguMutex() ); + //MutexGuard aGuard( GetLinguMutex() ); } @@ -995,7 +995,7 @@ void SAL_CALL AppExitListener::notifyTermination( const EventObject& rEvtSource ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (xDesktop.is() && rEvtSource.Source == xDesktop) { @@ -1005,5 +1005,5 @@ void SAL_CALL /////////////////////////////////////////////////////////////////////////// -} // namespace linguistic +} // namespace linguistic diff --git a/linguistic/source/misc2.cxx b/linguistic/source/misc2.cxx index 2b5910e03172..df7bc2f9f636 100644 --- a/linguistic/source/misc2.cxx +++ b/linguistic/source/misc2.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx index 255295730c83..2c9c99296ad7 100644 --- a/linguistic/source/spelldsp.cxx +++ b/linguistic/source/spelldsp.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -33,7 +33,7 @@ #include <com/sun/star/linguistic2/SpellFailure.hpp> #include <com/sun/star/registry/XRegistryKey.hpp> -#include <cppuhelper/factory.hxx> // helper for factories +#include <cppuhelper/factory.hxx> // helper for factories #include <unotools/localedatawrapper.hxx> #include <unotools/processfactory.hxx> #include <tools/debug.hxx> @@ -64,7 +64,7 @@ using namespace linguistic; // spellchecker should have put the more likely suggestions at the top. // New entries will be added to the end but duplicates are to be avoided. // Removing entries is done by assigning the empty string. -// The sequence is constructed from all non empty strings in the original +// The sequence is constructed from all non empty strings in the original // while maintaining the order. // class ProposalList @@ -151,7 +151,7 @@ size_t ProposalList::Count() const } return nRes; } - + Sequence< OUString > ProposalList::GetSequence() const { INT32 nCount = Count(); @@ -177,7 +177,7 @@ void ProposalList::Remove( const OUString &rText ) OUString &rEntry = aVec[i]; if (rEntry == rText) { - rEntry = OUString(); + rEntry = OUString(); break; // there should be only one matching entry } } @@ -186,13 +186,13 @@ void ProposalList::Remove( const OUString &rText ) /////////////////////////////////////////////////////////////////////////// -BOOL SvcListHasLanguage( - const LangSvcEntries_Spell &rEntry, +BOOL SvcListHasLanguage( + const LangSvcEntries_Spell &rEntry, LanguageType nLanguage ) { BOOL bHasLanguage = FALSE; Locale aTmpLocale; - + const Reference< XSpellChecker > *pRef = rEntry.aSvcRefs .getConstArray(); sal_Int32 nLen = rEntry.aSvcRefs.getLength(); for (INT32 k = 0; k < nLen && !bHasLanguage; ++k) @@ -204,7 +204,7 @@ BOOL SvcListHasLanguage( bHasLanguage = pRef[k]->hasLocale( aTmpLocale ); } } - + return bHasLanguage; } @@ -212,7 +212,7 @@ BOOL SvcListHasLanguage( SpellCheckerDispatcher::SpellCheckerDispatcher( LngSvcMgr &rLngSvcMgr ) : - rMgr (rLngSvcMgr) + rMgr (rLngSvcMgr) { pCache = NULL; } @@ -236,15 +236,15 @@ void SpellCheckerDispatcher::ClearSvcList() Sequence< Locale > SAL_CALL SpellCheckerDispatcher::getLocales() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); - + MutexGuard aGuard( GetLinguMutex() ); + Sequence< Locale > aLocales( static_cast< sal_Int32 >(aSvcMap.size()) ); Locale *pLocales = aLocales.getArray(); SpellSvcByLangMap_t::const_iterator aIt; for (aIt = aSvcMap.begin(); aIt != aSvcMap.end(); ++aIt) { *pLocales++ = CreateLocale( aIt->first ); - } + } return aLocales; } @@ -252,7 +252,7 @@ Sequence< Locale > SAL_CALL SpellCheckerDispatcher::getLocales() sal_Bool SAL_CALL SpellCheckerDispatcher::hasLocale( const Locale& rLocale ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); SpellSvcByLangMap_t::const_iterator aIt( aSvcMap.find( LocaleToLanguage( rLocale ) ) ); return aIt != aSvcMap.end(); } @@ -263,7 +263,7 @@ sal_Bool SAL_CALL const PropertyValues& rProperties ) throw(IllegalArgumentException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return isValid_Impl( rWord, LocaleToLanguage( rLocale ), rProperties, TRUE ); } @@ -273,7 +273,7 @@ Reference< XSpellAlternatives > SAL_CALL const PropertyValues& rProperties ) throw(IllegalArgumentException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return spell_Impl( rWord, LocaleToLanguage( rLocale ), rProperties, TRUE ); } @@ -313,23 +313,23 @@ static Reference< XDictionaryEntry > lcl_GetRulingDictionaryEntry( BOOL SpellCheckerDispatcher::isValid_Impl( - const OUString& rWord, - LanguageType nLanguage, + const OUString& rWord, + LanguageType nLanguage, const PropertyValues& rProperties, - BOOL bCheckDics) + BOOL bCheckDics) throw( RuntimeException, IllegalArgumentException ) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); + + BOOL bRes = TRUE; - BOOL bRes = TRUE; - if (nLanguage == LANGUAGE_NONE || !rWord.getLength()) return bRes; - + // search for entry with that language SpellSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); LangSvcEntries_Spell *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; - + if (!pEntry) { #ifdef LINGU_EXCEPTIONS @@ -352,9 +352,9 @@ BOOL SpellCheckerDispatcher::isValid_Impl( RemoveControlChars( aChkWord ); INT32 nLen = pEntry->aSvcRefs.getLength(); - DBG_ASSERT( nLen == pEntry->aSvcImplNames.getLength(), + DBG_ASSERT( nLen == pEntry->aSvcImplNames.getLength(), "lng : sequence length mismatch"); - DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen, + DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen, "lng : index out of range"); INT32 i = 0; @@ -363,7 +363,7 @@ BOOL SpellCheckerDispatcher::isValid_Impl( // try already instantiated services first { - const Reference< XSpellChecker > *pRef = + const Reference< XSpellChecker > *pRef = pEntry->aSvcRefs.getConstArray(); while (i <= pEntry->nLastTriedSvcIndex && (!bTmpResValid || FALSE == bTmpRes)) @@ -375,7 +375,7 @@ BOOL SpellCheckerDispatcher::isValid_Impl( if (!bTmpRes) { bTmpRes = pRef[i]->isValid( aChkWord, aLocale, rProperties ); - + // Add correct words to the cache. // But not those that are correct only because of // the temporary supplied settings. @@ -392,14 +392,14 @@ BOOL SpellCheckerDispatcher::isValid_Impl( ++i; } } - + // if still no result instantiate new services and try those if ((!bTmpResValid || FALSE == bTmpRes) && pEntry->nLastTriedSvcIndex < nLen - 1) { const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray(); Reference< XSpellChecker > *pRef = pEntry->aSvcRefs .getArray(); - + Reference< XMultiServiceFactory > xMgr( getProcessServiceFactory() ); if (xMgr.is()) { @@ -416,8 +416,8 @@ BOOL SpellCheckerDispatcher::isValid_Impl( Reference< XSpellChecker > xSpell; try { - xSpell = Reference< XSpellChecker >( - xMgr->createInstanceWithArguments( + xSpell = Reference< XSpellChecker >( + xMgr->createInstanceWithArguments( pImplNames[i], aArgs ), UNO_QUERY ); } catch (uno::Exception &) @@ -425,20 +425,20 @@ BOOL SpellCheckerDispatcher::isValid_Impl( DBG_ASSERT( 0, "createInstanceWithArguments failed" ); } pRef [i] = xSpell; - - Reference< XLinguServiceEventBroadcaster > + + Reference< XLinguServiceEventBroadcaster > xBroadcaster( xSpell, UNO_QUERY ); if (xBroadcaster.is()) rMgr.AddLngSvcEvtBroadcaster( xBroadcaster ); - - bTmpResValid = TRUE; + + bTmpResValid = TRUE; if (xSpell.is() && xSpell->hasLocale( aLocale )) { bTmpRes = GetCache().CheckWord( aChkWord, nLanguage ); if (!bTmpRes) { bTmpRes = xSpell->isValid( aChkWord, aLocale, rProperties ); - + // Add correct words to the cache. // But not those that are correct only because of // the temporary supplied settings. @@ -448,14 +448,14 @@ BOOL SpellCheckerDispatcher::isValid_Impl( } else bTmpResValid = FALSE; - + if (bTmpResValid) bRes = bTmpRes; pEntry->nLastTriedSvcIndex = (INT16) i; ++i; } - + // if language is not supported by any of the services // remove it from the list. if (i == nLen) @@ -465,9 +465,9 @@ BOOL SpellCheckerDispatcher::isValid_Impl( } } } - + // cross-check against results from dictionaries which have precedence! - if (bCheckDics && + if (bCheckDics && GetDicList().is() && IsUseDicList( rProperties, GetPropSet() )) { Reference< XDictionaryEntry > xTmp( lcl_GetRulingDictionaryEntry( aChkWord, nLanguage ) ); @@ -480,24 +480,24 @@ BOOL SpellCheckerDispatcher::isValid_Impl( } -Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( - const OUString& rWord, +Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( + const OUString& rWord, LanguageType nLanguage, const PropertyValues& rProperties, - BOOL bCheckDics ) + BOOL bCheckDics ) throw(IllegalArgumentException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); Reference< XSpellAlternatives > xRes; - + if (nLanguage == LANGUAGE_NONE || !rWord.getLength()) return xRes; - + // search for entry with that language SpellSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); LangSvcEntries_Spell *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; - + if (!pEntry) { #ifdef LINGU_EXCEPTIONS @@ -520,9 +520,9 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( RemoveControlChars( aChkWord ); INT32 nLen = pEntry->aSvcRefs.getLength(); - DBG_ASSERT( nLen == pEntry->aSvcImplNames.getLength(), + DBG_ASSERT( nLen == pEntry->aSvcImplNames.getLength(), "lng : sequence length mismatch"); - DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen, + DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen, "lng : index out of range"); INT32 i = 0; @@ -545,7 +545,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( else { xTmpRes = pRef[i]->spell( aChkWord, aLocale, rProperties ); - + // Add correct words to the cache. // But not those that are correct only because of // the temporary supplied settings. @@ -557,7 +557,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( bTmpResValid = FALSE; // return first found result if the word is not known by any checker. - // But if that result has no suggestions use the first one that does + // But if that result has no suggestions use the first one that does // provide suggestions for the misspelled word. if (!xRes.is() && bTmpResValid) { @@ -573,19 +573,19 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( { xRes = xTmpRes; nNumSugestions = nTmpNumSugestions; - } + } ++i; } } - + // if still no result instantiate new services and try those if ((!bTmpResValid || xTmpRes.is()) && pEntry->nLastTriedSvcIndex < nLen - 1) { const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray(); Reference< XSpellChecker > *pRef = pEntry->aSvcRefs .getArray(); - + Reference< XMultiServiceFactory > xMgr( getProcessServiceFactory() ); if (xMgr.is()) { @@ -603,8 +603,8 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( Reference< XSpellChecker > xSpell; try { - xSpell = Reference< XSpellChecker >( - xMgr->createInstanceWithArguments( + xSpell = Reference< XSpellChecker >( + xMgr->createInstanceWithArguments( pImplNames[i], aArgs ), UNO_QUERY ); } catch (uno::Exception &) @@ -612,13 +612,13 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( DBG_ASSERT( 0, "createInstanceWithArguments failed" ); } pRef [i] = xSpell; - - Reference< XLinguServiceEventBroadcaster > + + Reference< XLinguServiceEventBroadcaster > xBroadcaster( xSpell, UNO_QUERY ); if (xBroadcaster.is()) rMgr.AddLngSvcEvtBroadcaster( xBroadcaster ); - - bTmpResValid = TRUE; + + bTmpResValid = TRUE; if (xSpell.is() && xSpell->hasLocale( aLocale )) { BOOL bOK = GetCache().CheckWord( aChkWord, nLanguage ); @@ -627,7 +627,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( else { xTmpRes = xSpell->spell( aChkWord, aLocale, rProperties ); - + // Add correct words to the cache. // But not those that are correct only because of // the temporary supplied settings. @@ -637,9 +637,9 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( } else bTmpResValid = FALSE; - + // return first found result if the word is not known by any checker. - // But if that result has no suggestions use the first one that does + // But if that result has no suggestions use the first one that does // provide suggestions for the misspelled word. if (!xRes.is() && bTmpResValid) { @@ -655,7 +655,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( { xRes = xTmpRes; nNumSugestions = nTmpNumSugestions; - } + } pEntry->nLastTriedSvcIndex = (INT16) i; ++i; @@ -670,7 +670,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( } } } - + // if word is finally found to be correct // clear previously remembered alternatives if (bTmpResValid && !xTmpRes.is()) @@ -680,13 +680,13 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( // neagtive dictionaries) ProposalList aProposalList; // Sequence< OUString > aProposals; - INT16 eFailureType = -1; // no failure + INT16 eFailureType = -1; // no failure if (xRes.is()) { aProposalList.Append( xRes->getAlternatives() ); // aProposals = xRes->getAlternatives(); eFailureType = xRes->getFailureType(); - } + } Reference< XDictionaryList > xDList; if (GetDicList().is() && IsUseDicList( rProperties, GetPropSet() )) xDList = Reference< XDictionaryList >( GetDicList(), UNO_QUERY ); @@ -727,12 +727,12 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( SearchSimilarText( aChkWord, nLanguage, xDList, aDicListProps ); aProposalList.Append( aDicListProps ); Sequence< OUString > aProposals = aProposalList.GetSequence(); - + // remove entries listed in negative dictionaries // (we don't want to display suggestions that will be regarded as misspelledlater on) if (bCheckDics && xDList.is()) SeqRemoveNegEntries( aProposals, xDList, nLanguage ); - + uno::Reference< linguistic2::XSetSpellAlternatives > xSetAlt( xRes, uno::UNO_QUERY ); if (xSetAlt.is()) { @@ -749,7 +749,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( { // no xRes but Proposals found from the user-dictionaries. // Thus we need to create an xRes... - xRes = new linguistic::SpellAlternatives( rWord, nLanguage, + xRes = new linguistic::SpellAlternatives( rWord, nLanguage, SpellFailure::IS_NEGATIVE_WORD, aProposals ); } } @@ -759,7 +759,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( return xRes; } -uno::Sequence< sal_Int16 > SAL_CALL SpellCheckerDispatcher::getLanguages( ) +uno::Sequence< sal_Int16 > SAL_CALL SpellCheckerDispatcher::getLanguages( ) throw (uno::RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -768,9 +768,9 @@ throw (uno::RuntimeException) return aRes; } - -sal_Bool SAL_CALL SpellCheckerDispatcher::hasLanguage( - sal_Int16 nLanguage ) + +sal_Bool SAL_CALL SpellCheckerDispatcher::hasLanguage( + sal_Int16 nLanguage ) throw (uno::RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -778,11 +778,11 @@ throw (uno::RuntimeException) return hasLocale( aLocale ); } - -sal_Bool SAL_CALL SpellCheckerDispatcher::isValid( - const OUString& rWord, - sal_Int16 nLanguage, - const uno::Sequence< beans::PropertyValue >& rProperties ) + +sal_Bool SAL_CALL SpellCheckerDispatcher::isValid( + const OUString& rWord, + sal_Int16 nLanguage, + const uno::Sequence< beans::PropertyValue >& rProperties ) throw (lang::IllegalArgumentException, uno::RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -790,11 +790,11 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) return isValid( rWord, aLocale, rProperties); } - -uno::Reference< linguistic2::XSpellAlternatives > SAL_CALL SpellCheckerDispatcher::spell( - const OUString& rWord, - sal_Int16 nLanguage, - const uno::Sequence< beans::PropertyValue >& rProperties ) + +uno::Reference< linguistic2::XSpellAlternatives > SAL_CALL SpellCheckerDispatcher::spell( + const OUString& rWord, + sal_Int16 nLanguage, + const uno::Sequence< beans::PropertyValue >& rProperties ) throw (lang::IllegalArgumentException, uno::RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -802,11 +802,11 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) return spell( rWord, aLocale, rProperties); } - + void SpellCheckerDispatcher::SetServiceList( const Locale &rLocale, const Sequence< OUString > &rSvcImplNames ) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (pCache) pCache->Flush(); // new services may spell differently... @@ -837,13 +837,13 @@ void SpellCheckerDispatcher::SetServiceList( const Locale &rLocale, } -Sequence< OUString > +Sequence< OUString > SpellCheckerDispatcher::GetServiceList( const Locale &rLocale ) const { - MutexGuard aGuard( GetLinguMutex() ); - + MutexGuard aGuard( GetLinguMutex() ); + Sequence< OUString > aRes; - + // search for entry with that language and use data from that INT16 nLanguage = LocaleToLanguage( rLocale ); SpellCheckerDispatcher *pThis = (SpellCheckerDispatcher *) this; @@ -865,7 +865,7 @@ void SpellCheckerDispatcher::FlushSpellCache() { if (pCache) pCache->Flush(); -} +} /////////////////////////////////////////////////////////////////////////// diff --git a/linguistic/source/spelldsp.hxx b/linguistic/source/spelldsp.hxx index dcb53ef57b60..28807ac7a800 100644 --- a/linguistic/source/spelldsp.hxx +++ b/linguistic/source/spelldsp.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -32,7 +32,7 @@ #include "misc.hxx" #include "iprcache.hxx" -#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type #include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase7.hxx> @@ -68,11 +68,11 @@ class SpellCheckerDispatcher : LinguOptions aOpt; ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > xPropSet; + ::com::sun::star::beans::XPropertySet > xPropSet; ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XSearchableDictionaryList > xDicList; + ::com::sun::star::linguistic2::XSearchableDictionaryList > xDicList; - LngSvcMgr &rMgr; + LngSvcMgr &rMgr; linguistic::SpellCache *pCache; // Spell Cache (holds known words) // disallow copy-constructor and assignment-operator for now @@ -88,7 +88,7 @@ class SpellCheckerDispatcher : ::com::sun::star::linguistic2::XSearchableDictionaryList > GetDicList(); - void ClearSvcList(); + void ClearSvcList(); BOOL isValid_Impl(const ::rtl::OUString& aWord, LanguageType nLanguage, const ::com::sun::star::beans::PropertyValues& aProperties, @@ -114,7 +114,7 @@ public: virtual sal_Bool SAL_CALL isValid( const ::rtl::OUString& aWord, const ::com::sun::star::lang::Locale& aLocale, const ::com::sun::star::beans::PropertyValues& aProperties ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellAlternatives > SAL_CALL spell( const ::rtl::OUString& aWord, const ::com::sun::star::lang::Locale& aLocale, const ::com::sun::star::beans::PropertyValues& aProperties ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - // XSupportedLanguages + // XSupportedLanguages virtual ::com::sun::star::uno::Sequence< ::sal_Int16 > SAL_CALL getLanguages( ) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Bool SAL_CALL hasLanguage( ::sal_Int16 nLanguage ) throw (::com::sun::star::uno::RuntimeException); @@ -143,7 +143,7 @@ inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SpellCheckerDispatcher::GetPropSet() { - return xPropSet.is() ? + return xPropSet.is() ? xPropSet : xPropSet = linguistic::GetLinguProperties(); } @@ -152,7 +152,7 @@ inline ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSearchableDictionaryList > SpellCheckerDispatcher::GetDicList() { - return xDicList.is() ? + return xDicList.is() ? xDicList : xDicList = linguistic::GetSearchableDictionaryList(); } diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx index c260631b74fc..cb7578f54852 100644 --- a/linguistic/source/spelldta.cxx +++ b/linguistic/source/spelldta.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -52,11 +52,11 @@ using namespace com::sun::star::linguistic2; namespace linguistic { - + /////////////////////////////////////////////////////////////////////////// -#define MAX_PROPOSALS 40 +#define MAX_PROPOSALS 40 Reference< XSpellAlternatives > MergeProposals( Reference< XSpellAlternatives > &rxAlt1, @@ -86,8 +86,8 @@ Reference< XSpellAlternatives > MergeProposals( INT32 i = 0; for (int j = 0; j < 2; j++) { - INT32 nCount = j == 0 ? nAltCount1 : nAltCount2; - const OUString *pAlt = j == 0 ? pAlt1 : pAlt2; + INT32 nCount = j == 0 ? nAltCount1 : nAltCount2; + const OUString *pAlt = j == 0 ? pAlt1 : pAlt2; for (i = 0; i < nCount && nIndex < MAX_PROPOSALS; i++) { if (pAlt[i].getLength()) @@ -108,8 +108,8 @@ Reference< XSpellAlternatives > MergeProposals( } -BOOL SeqHasEntry( - const Sequence< OUString > &rSeq, +BOOL SeqHasEntry( + const Sequence< OUString > &rSeq, const OUString &rTxt) { BOOL bRes = FALSE; @@ -124,7 +124,7 @@ BOOL SeqHasEntry( } -void SearchSimilarText( const OUString &rText, INT16 nLanguage, +void SearchSimilarText( const OUString &rText, INT16 nLanguage, Reference< XDictionaryList > &xDicList, std::vector< OUString > & rDicListProps ) { @@ -171,8 +171,8 @@ void SearchSimilarText( const OUString &rText, INT16 nLanguage, } -void SeqRemoveNegEntries( Sequence< OUString > &rSeq, - Reference< XDictionaryList > &rxDicList, +void SeqRemoveNegEntries( Sequence< OUString > &rSeq, + Reference< XDictionaryList > &rxDicList, INT16 nLanguage ) { static const OUString aEmpty; @@ -181,7 +181,7 @@ void SeqRemoveNegEntries( Sequence< OUString > &rSeq, OUString *pEntries = rSeq.getArray(); for (INT32 i = 0; i < nLen; ++i) { - Reference< XDictionaryEntry > xNegEntry( SearchDicList( rxDicList, + Reference< XDictionaryEntry > xNegEntry( SearchDicList( rxDicList, pEntries[i], nLanguage, FALSE, TRUE ) ); if (xNegEntry.is()) { @@ -229,7 +229,7 @@ Sequence< OUString > MergeProposalSeqs( const OUString *pAlt = j == 0 ? pAlt1 : pAlt2; for (i = 0; i < nCount && nIndex < MAX_PROPOSALS; i++) { - if (pAlt[i].getLength() && + if (pAlt[i].getLength() && (bAllowDuplicates || !SeqHasEntry(aMerged, pAlt[i] ))) pMerged[ nIndex++ ] = pAlt[ i ]; } @@ -246,16 +246,16 @@ Sequence< OUString > MergeProposalSeqs( SpellAlternatives::SpellAlternatives() { - nLanguage = LANGUAGE_NONE; - nType = SpellFailure::IS_NEGATIVE_WORD; + nLanguage = LANGUAGE_NONE; + nType = SpellFailure::IS_NEGATIVE_WORD; } -SpellAlternatives::SpellAlternatives( +SpellAlternatives::SpellAlternatives( const OUString &rWord, INT16 nLang, INT16 nFailureType, const OUString &rRplcWord ) : aAlt ( Sequence< OUString >(1) ), - aWord (rWord), + aWord (rWord), nType (nFailureType), nLanguage (nLang) { @@ -285,7 +285,7 @@ SpellAlternatives::~SpellAlternatives() OUString SAL_CALL SpellAlternatives::getWord() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return aWord; } @@ -293,7 +293,7 @@ OUString SAL_CALL SpellAlternatives::getWord() Locale SAL_CALL SpellAlternatives::getLocale() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return CreateLocale( nLanguage ); } @@ -301,7 +301,7 @@ Locale SAL_CALL SpellAlternatives::getLocale() sal_Int16 SAL_CALL SpellAlternatives::getFailureType() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return nType; } @@ -309,7 +309,7 @@ sal_Int16 SAL_CALL SpellAlternatives::getFailureType() sal_Int16 SAL_CALL SpellAlternatives::getAlternativesCount() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return (INT16) aAlt.getLength(); } @@ -317,12 +317,12 @@ sal_Int16 SAL_CALL SpellAlternatives::getAlternativesCount() Sequence< OUString > SAL_CALL SpellAlternatives::getAlternatives() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return aAlt; } -void SAL_CALL SpellAlternatives::setAlternatives( const uno::Sequence< OUString >& rAlternatives ) +void SAL_CALL SpellAlternatives::setAlternatives( const uno::Sequence< OUString >& rAlternatives ) throw (uno::RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -330,7 +330,7 @@ throw (uno::RuntimeException) } -void SAL_CALL SpellAlternatives::setFailureType( sal_Int16 nFailureType ) +void SAL_CALL SpellAlternatives::setFailureType( sal_Int16 nFailureType ) throw (uno::RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); @@ -340,7 +340,7 @@ throw (uno::RuntimeException) void SpellAlternatives::SetWordLanguage(const OUString &rWord, INT16 nLang) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); aWord = rWord; nLanguage = nLang; } @@ -348,19 +348,19 @@ void SpellAlternatives::SetWordLanguage(const OUString &rWord, INT16 nLang) void SpellAlternatives::SetFailureType(INT16 nTypeP) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); nType = nTypeP; } void SpellAlternatives::SetAlternatives( const Sequence< OUString > &rAlt ) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); aAlt = rAlt; } /////////////////////////////////////////////////////////////////////////// -} // namespace linguistic +} // namespace linguistic diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx index 2cc8e536adac..6bd61ef408dd 100644 --- a/linguistic/source/thesdsp.cxx +++ b/linguistic/source/thesdsp.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -31,7 +31,7 @@ #include <tools/debug.hxx> #include <svl/lngmisc.hxx> -#include <cppuhelper/factory.hxx> // helper for factories +#include <cppuhelper/factory.hxx> // helper for factories #include <com/sun/star/registry/XRegistryKey.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <unotools/processfactory.hxx> @@ -52,12 +52,12 @@ using namespace linguistic; /////////////////////////////////////////////////////////////////////////// -static BOOL SvcListHasLanguage( - const Sequence< Reference< XThesaurus > > &rRefs, +static BOOL SvcListHasLanguage( + const Sequence< Reference< XThesaurus > > &rRefs, const Locale &rLocale ) { BOOL bHasLanguage = FALSE; - + const Reference< XThesaurus > *pRef = rRefs.getConstArray(); INT32 nLen = rRefs.getLength(); for (INT32 k = 0; k < nLen && !bHasLanguage; ++k) @@ -65,7 +65,7 @@ static BOOL SvcListHasLanguage( if (pRef[k].is()) bHasLanguage = pRef[k]->hasLocale( rLocale ); } - + return bHasLanguage; } @@ -95,7 +95,7 @@ Sequence< Locale > SAL_CALL ThesaurusDispatcher::getLocales() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); Sequence< Locale > aLocales( static_cast< sal_Int32 >(aSvcMap.size()) ); Locale *pLocales = aLocales.getArray(); @@ -103,7 +103,7 @@ Sequence< Locale > SAL_CALL for (aIt = aSvcMap.begin(); aIt != aSvcMap.end(); ++aIt) { *pLocales++ = CreateLocale( aIt->first ); - } + } return aLocales; } @@ -112,7 +112,7 @@ sal_Bool SAL_CALL ThesaurusDispatcher::hasLocale( const Locale& rLocale ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); ThesSvcByLangMap_t::const_iterator aIt( aSvcMap.find( LocaleToLanguage( rLocale ) ) ); return aIt != aSvcMap.end(); } @@ -124,9 +124,9 @@ Sequence< Reference< XMeaning > > SAL_CALL const PropertyValues& rProperties ) throw(IllegalArgumentException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); - Sequence< Reference< XMeaning > > aMeanings; + Sequence< Reference< XMeaning > > aMeanings; INT16 nLanguage = LocaleToLanguage( rLocale ); if (nLanguage == LANGUAGE_NONE || !rTerm.getLength()) @@ -206,7 +206,7 @@ Sequence< Reference< XMeaning > > SAL_CALL pEntry->nLastTriedSvcIndex = (INT16) i; ++i; } - + // if language is not supported by any of the services // remove it from the list. if (i == nLen && aMeanings.getLength() == 0) @@ -225,7 +225,7 @@ Sequence< Reference< XMeaning > > SAL_CALL void ThesaurusDispatcher::SetServiceList( const Locale &rLocale, const Sequence< OUString > &rSvcImplNames ) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); INT16 nLanguage = LocaleToLanguage( rLocale ); @@ -256,7 +256,7 @@ void ThesaurusDispatcher::SetServiceList( const Locale &rLocale, Sequence< OUString > ThesaurusDispatcher::GetServiceList( const Locale &rLocale ) const { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); Sequence< OUString > aRes; diff --git a/linguistic/source/thesdsp.hxx b/linguistic/source/thesdsp.hxx index 97259e167885..e7eeeff120ee 100644 --- a/linguistic/source/thesdsp.hxx +++ b/linguistic/source/thesdsp.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -40,9 +40,9 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/linguistic2/XThesaurus.hpp> -#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include <cppuhelper/implbase1.hxx> // helper for implementations -#include <cppuhelper/implbase5.hxx> // helper for implementations +#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include <cppuhelper/implbase1.hxx> // helper for implementations +#include <cppuhelper/implbase5.hxx> // helper for implementations #include <cppuhelper/interfacecontainer.h> #include <vos/mutex.hxx> @@ -67,7 +67,7 @@ class ThesaurusDispatcher : ThesSvcByLangMap_t aSvcMap; ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > xPropSet; + ::com::sun::star::beans::XPropertySet > xPropSet; // disallow copy-constructor and assignment-operator for now ThesaurusDispatcher(const ThesaurusDispatcher &); @@ -77,7 +77,7 @@ class ThesaurusDispatcher : ::com::sun::star::beans::XPropertySet > GetPropSet(); - void ClearSvcList(); + void ClearSvcList(); public: ThesaurusDispatcher(); @@ -118,7 +118,7 @@ inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > ThesaurusDispatcher::GetPropSet() { - return xPropSet.is() ? + return xPropSet.is() ? xPropSet : xPropSet = linguistic::GetLinguProperties(); } diff --git a/linguistic/source/thesdta.cxx b/linguistic/source/thesdta.cxx index 6cee02b9f35c..85a57e000f3e 100644 --- a/linguistic/source/thesdta.cxx +++ b/linguistic/source/thesdta.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -53,9 +53,9 @@ namespace linguistic ThesaurusMeaning::ThesaurusMeaning(const OUString &rText, const OUString &rLookUpText, INT16 nLookUpLang ) : - aText (rText), - aLookUpText (rLookUpText), - nLookUpLanguage (nLookUpLang) + aText (rText), + aLookUpText (rLookUpText), + nLookUpLanguage (nLookUpLang) { } @@ -66,7 +66,7 @@ ThesaurusMeaning::~ThesaurusMeaning() OUString SAL_CALL ThesaurusMeaning::getMeaning() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return aText; } diff --git a/linguistic/workben/sprophelp.cxx b/linguistic/workben/sprophelp.cxx index 40f2fa986d8c..0a02bc22bb58 100644 --- a/linguistic/workben/sprophelp.cxx +++ b/linguistic/workben/sprophelp.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -51,19 +51,19 @@ using namespace com::sun::star::linguistic2; using namespace linguistic; -#define A2OU(x) ::rtl::OUString::createFromAscii( x ) +#define A2OU(x) ::rtl::OUString::createFromAscii( x ) /////////////////////////////////////////////////////////////////////////// - + PropertyChgHelper::PropertyChgHelper( const Reference< XInterface > & rxSource, Reference< XPropertySet > &rxPropSet, const char *pPropNames[], USHORT nPropCount ) : - xMyEvtObj (rxSource), - xPropSet (rxPropSet), - aPropNames (nPropCount), - aLngSvcEvtListeners (GetLinguMutex()) + xMyEvtObj (rxSource), + xPropSet (rxPropSet), + aPropNames (nPropCount), + aLngSvcEvtListeners (GetLinguMutex()) { OUString *pName = aPropNames.getArray(); for (INT32 i = 0; i < nPropCount; ++i) @@ -74,18 +74,18 @@ PropertyChgHelper::PropertyChgHelper( PropertyChgHelper::PropertyChgHelper( const PropertyChgHelper &rHelper ) : - aLngSvcEvtListeners (GetLinguMutex()) + aLngSvcEvtListeners (GetLinguMutex()) { - xPropSet = rHelper.xPropSet; - aPropNames = rHelper.aPropNames; + xPropSet = rHelper.xPropSet; + aPropNames = rHelper.aPropNames; AddAsPropListener(); - - xMyEvtObj = rHelper.xMyEvtObj; + + xMyEvtObj = rHelper.xMyEvtObj; } PropertyChgHelper::~PropertyChgHelper() -{ +{ } @@ -116,7 +116,7 @@ void PropertyChgHelper::RemoveAsPropListener() } } } - + void PropertyChgHelper::LaunchEvent( const LinguServiceEvent &rEvt ) { @@ -130,10 +130,10 @@ void PropertyChgHelper::LaunchEvent( const LinguServiceEvent &rEvt ) } -void SAL_CALL PropertyChgHelper::disposing( const EventObject& rSource ) +void SAL_CALL PropertyChgHelper::disposing( const EventObject& rSource ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (rSource.Source == xPropSet) { RemoveAsPropListener(); @@ -141,36 +141,36 @@ void SAL_CALL PropertyChgHelper::disposing( const EventObject& rSource ) aPropNames.realloc( 0 ); } } - - -sal_Bool SAL_CALL - PropertyChgHelper::addLinguServiceEventListener( - const Reference< XLinguServiceEventListener >& rxListener ) + + +sal_Bool SAL_CALL + PropertyChgHelper::addLinguServiceEventListener( + const Reference< XLinguServiceEventListener >& rxListener ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); - + MutexGuard aGuard( GetLinguMutex() ); + BOOL bRes = FALSE; if (rxListener.is()) { - INT32 nCount = aLngSvcEvtListeners.getLength(); + INT32 nCount = aLngSvcEvtListeners.getLength(); bRes = aLngSvcEvtListeners.addInterface( rxListener ) != nCount; } return bRes; } -sal_Bool SAL_CALL - PropertyChgHelper::removeLinguServiceEventListener( - const Reference< XLinguServiceEventListener >& rxListener ) +sal_Bool SAL_CALL + PropertyChgHelper::removeLinguServiceEventListener( + const Reference< XLinguServiceEventListener >& rxListener ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); - + MutexGuard aGuard( GetLinguMutex() ); + BOOL bRes = FALSE; if (rxListener.is()) { - INT32 nCount = aLngSvcEvtListeners.getLength(); + INT32 nCount = aLngSvcEvtListeners.getLength(); bRes = aLngSvcEvtListeners.removeInterface( rxListener ) != nCount; } return bRes; @@ -192,7 +192,7 @@ static const char *aSP[] = PropertyHelper_Spell::PropertyHelper_Spell( const Reference< XInterface > & rxSource, Reference< XPropertySet > &rxPropSet ) : - PropertyChgHelper ( rxSource, rxPropSet, aSP, sizeof(aSP) / sizeof(aSP[0]) ) + PropertyChgHelper ( rxSource, rxPropSet, aSP, sizeof(aSP) / sizeof(aSP[0]) ) { SetDefault(); INT32 nLen = GetPropNames().getLength(); @@ -201,40 +201,40 @@ PropertyHelper_Spell::PropertyHelper_Spell( const OUString *pPropName = GetPropNames().getConstArray(); for (INT32 i = 0; i < nLen; ++i) { - BOOL *pbVal = NULL, - *pbResVal = NULL; + BOOL *pbVal = NULL, + *pbResVal = NULL; if (A2OU( UPN_IS_GERMAN_PRE_REFORM ) == pPropName[i]) { - pbVal = &bIsGermanPreReform; + pbVal = &bIsGermanPreReform; pbResVal = &bResIsGermanPreReform; } else if (A2OU( UPN_IS_IGNORE_CONTROL_CHARACTERS ) == pPropName[i]) { - pbVal = &bIsIgnoreControlCharacters; + pbVal = &bIsIgnoreControlCharacters; pbResVal = &bResIsIgnoreControlCharacters; } else if (A2OU( UPN_IS_USE_DICTIONARY_LIST ) == pPropName[i]) { - pbVal = &bIsUseDictionaryList; + pbVal = &bIsUseDictionaryList; pbResVal = &bResIsUseDictionaryList; } else if (A2OU( UPN_IS_SPELL_UPPER_CASE ) == pPropName[i]) { - pbVal = &bIsSpellUpperCase; + pbVal = &bIsSpellUpperCase; pbResVal = &bResIsSpellUpperCase; } else if (A2OU( UPN_IS_SPELL_WITH_DIGITS ) == pPropName[i]) { - pbVal = &bIsSpellWithDigits; + pbVal = &bIsSpellWithDigits; pbResVal = &bResIsSpellWithDigits; } else if (A2OU( UPN_IS_SPELL_CAPITALIZATION ) == pPropName[i]) { - pbVal = &bIsSpellCapitalization; + pbVal = &bIsSpellCapitalization; pbResVal = &bResIsSpellCapitalization; } - + if (pbVal && pbResVal) { rxPropSet->getPropertyValue( pPropName[i] ) >>= *pbVal; @@ -252,66 +252,66 @@ PropertyHelper_Spell::~PropertyHelper_Spell() void PropertyHelper_Spell::SetDefault() { - bResIsGermanPreReform = bIsGermanPreReform = FALSE; - bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = TRUE; - bResIsUseDictionaryList = bIsUseDictionaryList = TRUE; - bResIsSpellUpperCase = bIsSpellUpperCase = FALSE; - bResIsSpellWithDigits = bIsSpellWithDigits = FALSE; - bResIsSpellCapitalization = bIsSpellCapitalization = TRUE; + bResIsGermanPreReform = bIsGermanPreReform = FALSE; + bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = TRUE; + bResIsUseDictionaryList = bIsUseDictionaryList = TRUE; + bResIsSpellUpperCase = bIsSpellUpperCase = FALSE; + bResIsSpellWithDigits = bIsSpellWithDigits = FALSE; + bResIsSpellCapitalization = bIsSpellCapitalization = TRUE; } -void SAL_CALL - PropertyHelper_Spell::propertyChange( const PropertyChangeEvent& rEvt ) +void SAL_CALL + PropertyHelper_Spell::propertyChange( const PropertyChangeEvent& rEvt ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (GetPropSet().is() && rEvt.Source == GetPropSet()) { INT16 nLngSvcFlags = 0; - BOOL bSCWA = FALSE, // SPELL_CORRECT_WORDS_AGAIN ? - bSWWA = FALSE; // SPELL_WRONG_WORDS_AGAIN ? + BOOL bSCWA = FALSE, // SPELL_CORRECT_WORDS_AGAIN ? + bSWWA = FALSE; // SPELL_WRONG_WORDS_AGAIN ? BOOL *pbVal = NULL; switch (rEvt.PropertyHandle) { case UPH_IS_IGNORE_CONTROL_CHARACTERS : { - pbVal = &bIsIgnoreControlCharacters; + pbVal = &bIsIgnoreControlCharacters; break; } - case UPH_IS_GERMAN_PRE_REFORM : + case UPH_IS_GERMAN_PRE_REFORM : { - pbVal = &bIsGermanPreReform; + pbVal = &bIsGermanPreReform; bSCWA = bSWWA = TRUE; break; } - case UPH_IS_USE_DICTIONARY_LIST : + case UPH_IS_USE_DICTIONARY_LIST : { - pbVal = &bIsUseDictionaryList; + pbVal = &bIsUseDictionaryList; bSCWA = bSWWA = TRUE; break; } - case UPH_IS_SPELL_UPPER_CASE : + case UPH_IS_SPELL_UPPER_CASE : { pbVal = &bIsSpellUpperCase; - bSCWA = FALSE == *pbVal; // FALSE->TRUE change? - bSWWA = !bSCWA; // TRUE->FALSE change? + bSCWA = FALSE == *pbVal; // FALSE->TRUE change? + bSWWA = !bSCWA; // TRUE->FALSE change? break; } - case UPH_IS_SPELL_WITH_DIGITS : + case UPH_IS_SPELL_WITH_DIGITS : { - pbVal = &bIsSpellWithDigits; - bSCWA = FALSE == *pbVal; // FALSE->TRUE change? - bSWWA = !bSCWA; // TRUE->FALSE change? + pbVal = &bIsSpellWithDigits; + bSCWA = FALSE == *pbVal; // FALSE->TRUE change? + bSWWA = !bSCWA; // TRUE->FALSE change? break; } - case UPH_IS_SPELL_CAPITALIZATION : + case UPH_IS_SPELL_CAPITALIZATION : { - pbVal = &bIsSpellCapitalization; - bSCWA = FALSE == *pbVal; // FALSE->TRUE change? - bSWWA = !bSCWA; // TRUE->FALSE change? + pbVal = &bIsSpellCapitalization; + bSCWA = FALSE == *pbVal; // FALSE->TRUE change? + bSWWA = !bSCWA; // TRUE->FALSE change? break; } default: @@ -332,17 +332,17 @@ void SAL_CALL } } - + void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals ) { - // set return value to default value unless there is an + // set return value to default value unless there is an // explicitly supplied temporary value - bResIsGermanPreReform = bIsGermanPreReform; - bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters; - bResIsUseDictionaryList = bIsUseDictionaryList; - bResIsSpellUpperCase = bIsSpellUpperCase; - bResIsSpellWithDigits = bIsSpellWithDigits; - bResIsSpellCapitalization = bIsSpellCapitalization; + bResIsGermanPreReform = bIsGermanPreReform; + bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters; + bResIsUseDictionaryList = bIsUseDictionaryList; + bResIsSpellUpperCase = bIsSpellUpperCase; + bResIsSpellWithDigits = bIsSpellWithDigits; + bResIsSpellCapitalization = bIsSpellCapitalization; // INT32 nLen = rPropVals.getLength(); if (nLen) @@ -353,12 +353,12 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals ) BOOL *pbResVal = NULL; switch (pVal[i].Handle) { - case UPH_IS_GERMAN_PRE_REFORM : pbResVal = &bResIsGermanPreReform; break; + case UPH_IS_GERMAN_PRE_REFORM : pbResVal = &bResIsGermanPreReform; break; case UPH_IS_IGNORE_CONTROL_CHARACTERS : pbResVal = &bResIsIgnoreControlCharacters; break; - case UPH_IS_USE_DICTIONARY_LIST : pbResVal = &bResIsUseDictionaryList; break; - case UPH_IS_SPELL_UPPER_CASE : pbResVal = &bResIsSpellUpperCase; break; - case UPH_IS_SPELL_WITH_DIGITS : pbResVal = &bResIsSpellWithDigits; break; - case UPH_IS_SPELL_CAPITALIZATION : pbResVal = &bResIsSpellCapitalization; break; + case UPH_IS_USE_DICTIONARY_LIST : pbResVal = &bResIsUseDictionaryList; break; + case UPH_IS_SPELL_UPPER_CASE : pbResVal = &bResIsSpellUpperCase; break; + case UPH_IS_SPELL_WITH_DIGITS : pbResVal = &bResIsSpellWithDigits; break; + case UPH_IS_SPELL_CAPITALIZATION : pbResVal = &bResIsSpellCapitalization; break; default: DBG_ERROR( "unknown property" ); } diff --git a/linguistic/workben/sprophelp.hxx b/linguistic/workben/sprophelp.hxx index 30a7656acc5f..92e25e88f221 100644 --- a/linguistic/workben/sprophelp.hxx +++ b/linguistic/workben/sprophelp.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -30,8 +30,8 @@ #include <tools/solar.h> -#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include <cppuhelper/implbase2.hxx> // helper for implementations +#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include <cppuhelper/implbase2.hxx> // helper for implementations #include <cppuhelper/interfacecontainer.h> #include <com/sun/star/beans/XPropertyChangeListener.hpp> #include <com/sun/star/beans/PropertyValues.hpp> @@ -39,11 +39,11 @@ #include <com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp> namespace com { namespace sun { namespace star { namespace beans { - class XPropertySet; + class XPropertySet; }}}}; namespace com { namespace sun { namespace star { namespace linguistic2 { - struct LinguServiceEvent; + struct LinguServiceEvent; }}}}; @@ -66,53 +66,53 @@ class PropertyChgHelper : XLinguServiceEventBroadcaster > { - Sequence< OUString > aPropNames; - Reference< XInterface > xMyEvtObj; - ::cppu::OInterfaceContainerHelper aLngSvcEvtListeners; - Reference< XPropertySet > xPropSet; + Sequence< OUString > aPropNames; + Reference< XInterface > xMyEvtObj; + ::cppu::OInterfaceContainerHelper aLngSvcEvtListeners; + Reference< XPropertySet > xPropSet; // disallow use of copy-constructor and assignment-operator PropertyChgHelper( const PropertyChgHelper & ); PropertyChgHelper & operator = ( const PropertyChgHelper & ); public: - PropertyChgHelper( + PropertyChgHelper( const Reference< XInterface > &rxSource, Reference< XPropertySet > &rxPropSet, const char *pPropNames[], USHORT nPropCount ); virtual ~PropertyChgHelper(); // XEventListener - virtual void SAL_CALL - disposing( const EventObject& rSource ) + virtual void SAL_CALL + disposing( const EventObject& rSource ) throw(RuntimeException); // XPropertyChangeListener - virtual void SAL_CALL - propertyChange( const PropertyChangeEvent& rEvt ) + virtual void SAL_CALL + propertyChange( const PropertyChangeEvent& rEvt ) throw(RuntimeException) = 0; // XLinguServiceEventBroadcaster - virtual sal_Bool SAL_CALL - addLinguServiceEventListener( - const Reference< XLinguServiceEventListener >& rxListener ) + virtual sal_Bool SAL_CALL + addLinguServiceEventListener( + const Reference< XLinguServiceEventListener >& rxListener ) throw(RuntimeException); - virtual sal_Bool SAL_CALL - removeLinguServiceEventListener( - const Reference< XLinguServiceEventListener >& rxListener ) + virtual sal_Bool SAL_CALL + removeLinguServiceEventListener( + const Reference< XLinguServiceEventListener >& rxListener ) throw(RuntimeException); // non UNO functions - void AddAsPropListener(); - void RemoveAsPropListener(); - void LaunchEvent( const LinguServiceEvent& rEvt ); - + void AddAsPropListener(); + void RemoveAsPropListener(); + void LaunchEvent( const LinguServiceEvent& rEvt ); + const Sequence< OUString > & - GetPropNames() const { return aPropNames; } - const Reference< XPropertySet > & - GetPropSet() const { return xPropSet; } + GetPropNames() const { return aPropNames; } + const Reference< XPropertySet > & + GetPropSet() const { return xPropSet; } const Reference< XInterface > & - GetEvtObj() const { return xMyEvtObj; } + GetEvtObj() const { return xMyEvtObj; } }; @@ -123,27 +123,27 @@ class PropertyHelper_Spell : public PropertyChgHelper { // default values - BOOL bIsGermanPreReform; - BOOL bIsIgnoreControlCharacters; - BOOL bIsUseDictionaryList; - BOOL bIsSpellUpperCase; - BOOL bIsSpellWithDigits; - BOOL bIsSpellCapitalization; + BOOL bIsGermanPreReform; + BOOL bIsIgnoreControlCharacters; + BOOL bIsUseDictionaryList; + BOOL bIsSpellUpperCase; + BOOL bIsSpellWithDigits; + BOOL bIsSpellCapitalization; // return values, will be set to default value or current temporary value - BOOL bResIsGermanPreReform; - BOOL bResIsIgnoreControlCharacters; - BOOL bResIsUseDictionaryList; - BOOL bResIsSpellUpperCase; - BOOL bResIsSpellWithDigits; - BOOL bResIsSpellCapitalization; - - + BOOL bResIsGermanPreReform; + BOOL bResIsIgnoreControlCharacters; + BOOL bResIsUseDictionaryList; + 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 & ); - - void SetDefault(); + + void SetDefault(); public: PropertyHelper_Spell( @@ -152,18 +152,18 @@ public: virtual ~PropertyHelper_Spell(); // XPropertyChangeListener - virtual void SAL_CALL - propertyChange( const PropertyChangeEvent& rEvt ) + virtual void SAL_CALL + propertyChange( const PropertyChangeEvent& rEvt ) throw(RuntimeException); - - void SetTmpPropVals( const PropertyValues &rPropVals ); - - BOOL IsGermanPreReform() const { return bResIsGermanPreReform; } - BOOL IsIgnoreControlCharacters() const { return bResIsIgnoreControlCharacters; } - BOOL IsUseDictionaryList() const { return bResIsUseDictionaryList; } - BOOL IsSpellUpperCase() const { return bResIsSpellUpperCase; } - BOOL IsSpellWithDigits() const { return bResIsSpellWithDigits; } - BOOL IsSpellCapitalization() const { return bResIsSpellCapitalization; } + + void SetTmpPropVals( const PropertyValues &rPropVals ); + + BOOL IsGermanPreReform() const { return bResIsGermanPreReform; } + BOOL IsIgnoreControlCharacters() const { return bResIsIgnoreControlCharacters; } + BOOL IsUseDictionaryList() const { return bResIsUseDictionaryList; } + BOOL IsSpellUpperCase() const { return bResIsSpellUpperCase; } + BOOL IsSpellWithDigits() const { return bResIsSpellWithDigits; } + BOOL IsSpellCapitalization() const { return bResIsSpellCapitalization; } }; /////////////////////////////////////////////////////////////////////////// diff --git a/linguistic/workben/sreg.cxx b/linguistic/workben/sreg.cxx index f574977cab83..21fa50246472 100644 --- a/linguistic/workben/sreg.cxx +++ b/linguistic/workben/sreg.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -29,7 +29,7 @@ #include "precompiled_linguistic.hxx" -#include <cppuhelper/factory.hxx> // helper for factories +#include <cppuhelper/factory.hxx> // helper for factories #include <rtl/string.hxx> #include <com/sun/star/registry/XRegistryKey.hpp> diff --git a/linguistic/workben/sspellimp.cxx b/linguistic/workben/sspellimp.cxx index d6761afbd100..81981093e2f8 100644 --- a/linguistic/workben/sspellimp.cxx +++ b/linguistic/workben/sspellimp.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -31,7 +31,7 @@ #include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp> #include <com/sun/star/linguistic2/SpellFailure.hpp> -#include <cppuhelper/factory.hxx> // helper for factories +#include <cppuhelper/factory.hxx> // helper for factories #include <com/sun/star/registry/XRegistryKey.hpp> #include <tools/debug.hxx> #include <unotools/processfactory.hxx> @@ -59,8 +59,8 @@ using namespace linguistic; BOOL operator == ( const Locale &rL1, const Locale &rL2 ) { - return rL1.Language == rL2.Language && - rL1.Country == rL2.Country && + return rL1.Language == rL2.Language && + rL1.Country == rL2.Country && rL1.Variant == rL2.Variant; } @@ -68,7 +68,7 @@ BOOL operator == ( const Locale &rL1, const Locale &rL2 ) SpellChecker::SpellChecker() : - aEvtListeners ( GetLinguMutex() ) + aEvtListeners ( GetLinguMutex() ) { bDisposing = FALSE; pPropHelper = NULL; @@ -86,11 +86,11 @@ PropertyHelper_Spell & SpellChecker::GetPropHelper_Impl() { if (!pPropHelper) { - Reference< XPropertySet > xPropSet( GetLinguProperties(), UNO_QUERY ); + Reference< XPropertySet > xPropSet( GetLinguProperties(), UNO_QUERY ); - pPropHelper = new PropertyHelper_Spell( (XSpellChecker *) this, xPropSet ); + pPropHelper = new PropertyHelper_Spell( (XSpellChecker *) this, xPropSet ); xPropHelper = pPropHelper; - pPropHelper->AddAsPropListener(); //! after a reference is established + pPropHelper->AddAsPropListener(); //! after a reference is established } return *pPropHelper; } @@ -99,7 +99,7 @@ PropertyHelper_Spell & SpellChecker::GetPropHelper_Impl() Sequence< Locale > SAL_CALL SpellChecker::getLocales() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (!aSuppLocales.getLength()) { @@ -117,7 +117,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales() sal_Bool SAL_CALL SpellChecker::hasLocale(const Locale& rLocale) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); BOOL bRes = FALSE; if (!aSuppLocales.getLength()) @@ -144,7 +144,7 @@ INT16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rLocal // - words with 'x' or 'X' will have incorrect spelling. // - words with 's' or 'S' as first letter will have the wrong caption. // - all other words will be OK. - + INT16 nRes = -1; String aTmp( rWord ); @@ -171,12 +171,12 @@ INT16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rLocal } -sal_Bool SAL_CALL - SpellChecker::isValid( const OUString& rWord, const Locale& rLocale, - const PropertyValues& rProperties ) +sal_Bool SAL_CALL + SpellChecker::isValid( const OUString& rWord, const Locale& rLocale, + const PropertyValues& rProperties ) throw(IllegalArgumentException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (rLocale == Locale() || !rWord.getLength()) return TRUE; @@ -223,7 +223,7 @@ Reference< XSpellAlternatives > // - 'x' or 'X' will be replaced by 'u' or 'U' for the first proposal // and they will be removed from the word for the second proposal. // - 's' or 'S' as first letter will be changed to the other caption. - + Reference< XSpellAlternatives > xRes; String aTmp( rWord ); @@ -234,7 +234,7 @@ Reference< XSpellAlternatives > if (STRING_NOTFOUND != aTmp.SearchAscii( "liss" )) { aTmp.SearchAndReplaceAllAscii( "liss", A2OU("liz") ); - xRes = new SpellAlternatives( aTmp, nLang, + xRes = new SpellAlternatives( aTmp, nLang, SpellFailure::IS_NEGATIVE_WORD, aTmp ); } else if (STRING_NOTFOUND != aTmp.Search( (sal_Unicode) 'x' ) || @@ -250,12 +250,12 @@ Reference< XSpellAlternatives > aAlt2.EraseAllChars( (sal_Unicode) 'X' ); pStr[0] = aAlt1; pStr[1] = aAlt2; - + SpellAlternatives *pAlt = new SpellAlternatives; pAlt->SetWordLanguage( aTmp, nLang ); pAlt->SetFailureType( SpellFailure::SPELLING_ERROR ); pAlt->SetAlternatives( aStr ); - + xRes = pAlt; } else @@ -263,7 +263,7 @@ Reference< XSpellAlternatives > sal_Unicode cChar = aTmp.GetChar( 0 ); if (cChar == (sal_Unicode) 's' || cChar == (sal_Unicode) 'S') { - sal_Unicode cNewChar = cChar == (sal_Unicode) 's' ? + sal_Unicode cNewChar = cChar == (sal_Unicode) 's' ? (sal_Unicode) 'S': (sal_Unicode) 's'; aTmp.GetBufferAccess()[0] = cNewChar; xRes = new SpellAlternatives( aTmp, nLang, @@ -276,12 +276,12 @@ Reference< XSpellAlternatives > } -Reference< XSpellAlternatives > SAL_CALL - SpellChecker::spell( const OUString& rWord, const Locale& rLocale, - const PropertyValues& rProperties ) +Reference< XSpellAlternatives > SAL_CALL + SpellChecker::spell( const OUString& rWord, const Locale& rLocale, + const PropertyValues& rProperties ) throw(IllegalArgumentException, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); if (rLocale == Locale() || !rWord.getLength()) return NULL; @@ -302,23 +302,23 @@ Reference< XSpellAlternatives > SAL_CALL } -Reference< XInterface > SAL_CALL SpellChecker_CreateInstance( +Reference< XInterface > SAL_CALL SpellChecker_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw(Exception) { Reference< XInterface > xService = (cppu::OWeakObject*) new SpellChecker; return xService; } - - -sal_Bool SAL_CALL - SpellChecker::addLinguServiceEventListener( - const Reference< XLinguServiceEventListener >& rxLstnr ) + + +sal_Bool SAL_CALL + SpellChecker::addLinguServiceEventListener( + const Reference< XLinguServiceEventListener >& rxLstnr ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); - - BOOL bRes = FALSE; + MutexGuard aGuard( GetLinguMutex() ); + + BOOL bRes = FALSE; if (!bDisposing && rxLstnr.is()) { bRes = GetPropHelper().addLinguServiceEventListener( rxLstnr ); @@ -327,14 +327,14 @@ sal_Bool SAL_CALL } -sal_Bool SAL_CALL - SpellChecker::removeLinguServiceEventListener( - const Reference< XLinguServiceEventListener >& rxLstnr ) +sal_Bool SAL_CALL + SpellChecker::removeLinguServiceEventListener( + const Reference< XLinguServiceEventListener >& rxLstnr ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); - - BOOL bRes = FALSE; + MutexGuard aGuard( GetLinguMutex() ); + + BOOL bRes = FALSE; if (!bDisposing && rxLstnr.is()) { DBG_ASSERT( xPropHelper.is(), "xPropHelper non existent" ); @@ -344,27 +344,27 @@ sal_Bool SAL_CALL } -OUString SAL_CALL - SpellChecker::getServiceDisplayName( const Locale& rLocale ) +OUString SAL_CALL + SpellChecker::getServiceDisplayName( const Locale& rLocale ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return A2OU( "OpenOffice example spellchecker" ); } -void SAL_CALL - SpellChecker::initialize( const Sequence< Any >& rArguments ) +void SAL_CALL + SpellChecker::initialize( const Sequence< Any >& rArguments ) throw(Exception, RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); - + MutexGuard aGuard( GetLinguMutex() ); + if (!pPropHelper) { INT32 nLen = rArguments.getLength(); if (2 == nLen) { - Reference< XPropertySet > xPropSet; + Reference< XPropertySet > xPropSet; rArguments.getConstArray()[0] >>= xPropSet; //rArguments.getConstArray()[1] >>= xDicList; @@ -374,7 +374,7 @@ void SAL_CALL //! when the object is not longer used. pPropHelper = new PropertyHelper_Spell( (XSpellChecker *) this, xPropSet ); xPropHelper = pPropHelper; - pPropHelper->AddAsPropListener(); //! after a reference is established + pPropHelper->AddAsPropListener(); //! after a reference is established } else DBG_ERROR( "wrong number of arguments in sequence" ); @@ -382,38 +382,38 @@ void SAL_CALL } -void SAL_CALL - SpellChecker::dispose() +void SAL_CALL + SpellChecker::dispose() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); - + MutexGuard aGuard( GetLinguMutex() ); + if (!bDisposing) { bDisposing = TRUE; - EventObject aEvtObj( (XSpellChecker *) this ); + EventObject aEvtObj( (XSpellChecker *) this ); aEvtListeners.disposeAndClear( aEvtObj ); } } -void SAL_CALL - SpellChecker::addEventListener( const Reference< XEventListener >& rxListener ) +void SAL_CALL + SpellChecker::addEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); - + MutexGuard aGuard( GetLinguMutex() ); + if (!bDisposing && rxListener.is()) aEvtListeners.addInterface( rxListener ); } -void SAL_CALL - SpellChecker::removeEventListener( const Reference< XEventListener >& rxListener ) +void SAL_CALL + SpellChecker::removeEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); - + MutexGuard aGuard( GetLinguMutex() ); + if (!bDisposing && rxListener.is()) aEvtListeners.removeInterface( rxListener ); } @@ -423,10 +423,10 @@ void SAL_CALL // Service specific part // -OUString SAL_CALL SpellChecker::getImplementationName() +OUString SAL_CALL SpellChecker::getImplementationName() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return getImplementationName_Static(); } @@ -434,7 +434,7 @@ OUString SAL_CALL SpellChecker::getImplementationName() sal_Bool SAL_CALL SpellChecker::supportsService( const OUString& ServiceName ) throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); Sequence< OUString > aSNL = getSupportedServiceNames(); const OUString * pArray = aSNL.getConstArray(); @@ -448,17 +448,17 @@ sal_Bool SAL_CALL SpellChecker::supportsService( const OUString& ServiceName ) Sequence< OUString > SAL_CALL SpellChecker::getSupportedServiceNames() throw(RuntimeException) { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); return getSupportedServiceNames_Static(); } -Sequence< OUString > SpellChecker::getSupportedServiceNames_Static() +Sequence< OUString > SpellChecker::getSupportedServiceNames_Static() throw() { - MutexGuard aGuard( GetLinguMutex() ); + MutexGuard aGuard( GetLinguMutex() ); - Sequence< OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich + Sequence< OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich aSNS.getArray()[0] = A2OU( SN_SPELLCHECKER ); return aSNS; } diff --git a/linguistic/workben/sspellimp.hxx b/linguistic/workben/sspellimp.hxx index c02302fdfa41..df37c403572f 100644 --- a/linguistic/workben/sspellimp.hxx +++ b/linguistic/workben/sspellimp.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -28,9 +28,9 @@ #ifndef _LINGU2_SPELLIMP_HXX_ #define _LINGU2_SPELLIMP_HXX_ -#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type -#include <cppuhelper/implbase1.hxx> // helper for implementations -#include <cppuhelper/implbase6.hxx> // helper for implementations +#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type +#include <cppuhelper/implbase1.hxx> // helper for implementations +#include <cppuhelper/implbase6.hxx> // helper for implementations #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceDisplayName.hpp> @@ -52,7 +52,7 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::linguistic2; -#define A2OU(x) ::rtl::OUString::createFromAscii( x ) +#define A2OU(x) ::rtl::OUString::createFromAscii( x ) /////////////////////////////////////////////////////////////////////////// @@ -68,23 +68,23 @@ class SpellChecker : XServiceDisplayName > { - Sequence< Locale > aSuppLocales; - ::cppu::OInterfaceContainerHelper aEvtListeners; - Reference< XPropertyChangeListener > xPropHelper; - PropertyHelper_Spell * pPropHelper; - BOOL bDisposing; + Sequence< Locale > aSuppLocales; + ::cppu::OInterfaceContainerHelper aEvtListeners; + Reference< XPropertyChangeListener > xPropHelper; + PropertyHelper_Spell * pPropHelper; + BOOL bDisposing; // disallow copy-constructor and assignment-operator for now SpellChecker(const SpellChecker &); SpellChecker & operator = (const SpellChecker &); - PropertyHelper_Spell & GetPropHelper_Impl(); - PropertyHelper_Spell & GetPropHelper() + PropertyHelper_Spell & GetPropHelper_Impl(); + PropertyHelper_Spell & GetPropHelper() { return pPropHelper ? *pPropHelper : GetPropHelper_Impl(); } - INT16 GetSpellFailure( const OUString &rWord, const Locale &rLocale ); + INT16 GetSpellFailure( const OUString &rWord, const Locale &rLocale ); Reference< XSpellAlternatives > GetProposals( const OUString &rWord, const Locale &rLocale ); @@ -93,54 +93,54 @@ public: virtual ~SpellChecker(); // XSupportedLocales (for XSpellChecker) - virtual Sequence< Locale > SAL_CALL - getLocales() + virtual Sequence< Locale > SAL_CALL + getLocales() throw(RuntimeException); - virtual sal_Bool SAL_CALL - hasLocale( const Locale& rLocale ) + virtual sal_Bool SAL_CALL + hasLocale( const Locale& rLocale ) throw(RuntimeException); // XSpellChecker - virtual sal_Bool SAL_CALL - isValid( const OUString& rWord, const Locale& rLocale, - const PropertyValues& rProperties ) - throw(IllegalArgumentException, + virtual sal_Bool SAL_CALL + isValid( const OUString& rWord, const Locale& rLocale, + const PropertyValues& rProperties ) + throw(IllegalArgumentException, RuntimeException); - virtual Reference< XSpellAlternatives > SAL_CALL - spell( const OUString& rWord, const Locale& rLocale, - const PropertyValues& rProperties ) - throw(IllegalArgumentException, + virtual Reference< XSpellAlternatives > SAL_CALL + spell( const OUString& rWord, const Locale& rLocale, + const PropertyValues& rProperties ) + throw(IllegalArgumentException, RuntimeException); // XLinguServiceEventBroadcaster - virtual sal_Bool SAL_CALL - addLinguServiceEventListener( - const Reference< XLinguServiceEventListener >& rxLstnr ) + virtual sal_Bool SAL_CALL + addLinguServiceEventListener( + const Reference< XLinguServiceEventListener >& rxLstnr ) throw(RuntimeException); - virtual sal_Bool SAL_CALL - removeLinguServiceEventListener( - const Reference< XLinguServiceEventListener >& rxLstnr ) + virtual sal_Bool SAL_CALL + removeLinguServiceEventListener( + const Reference< XLinguServiceEventListener >& rxLstnr ) throw(RuntimeException); - + // XServiceDisplayName - virtual OUString SAL_CALL - getServiceDisplayName( const Locale& rLocale ) + virtual OUString SAL_CALL + getServiceDisplayName( const Locale& rLocale ) throw(RuntimeException); // XInitialization - virtual void SAL_CALL - initialize( const Sequence< Any >& rArguments ) + virtual void SAL_CALL + initialize( const Sequence< Any >& rArguments ) throw(Exception, RuntimeException); // XComponent - virtual void SAL_CALL - dispose() + virtual void SAL_CALL + dispose() throw(RuntimeException); - virtual void SAL_CALL - addEventListener( const Reference< XEventListener >& rxListener ) + virtual void SAL_CALL + addEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException); - virtual void SAL_CALL - removeEventListener( const Reference< XEventListener >& rxListener ) + virtual void SAL_CALL + removeEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException); //////////////////////////////////////////////////////////// @@ -148,20 +148,20 @@ public: // // XServiceInfo - virtual OUString SAL_CALL - getImplementationName() + virtual OUString SAL_CALL + getImplementationName() throw(RuntimeException); - virtual sal_Bool SAL_CALL - supportsService( const OUString& rServiceName ) + virtual sal_Bool SAL_CALL + supportsService( const OUString& rServiceName ) throw(RuntimeException); - virtual Sequence< OUString > SAL_CALL - getSupportedServiceNames() + virtual Sequence< OUString > SAL_CALL + getSupportedServiceNames() throw(RuntimeException); - static inline OUString + static inline OUString getImplementationName_Static() throw(); - static Sequence< OUString > + static Sequence< OUString > getSupportedServiceNames_Static() throw(); }; |