1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <tools/debug.hxx>
22 #include <sal/macros.h>
24 #include <com/sun/star/linguistic2/LinguServiceEvent.hpp>
25 #include <com/sun/star/linguistic2/LinguServiceEventFlags.hpp>
26 #include <com/sun/star/linguistic2/XLinguServiceEventListener.hpp>
27 #include <com/sun/star/beans/XPropertySet.hpp>
28 #include <osl/mutex.hxx>
30 #include <linguistic/misc.hxx>
31 #include <linguistic/lngprops.hxx>
33 #include <linguistic/lngprophelp.hxx>
36 using namespace com::sun::star
;
37 using namespace com::sun::star::beans
;
38 using namespace com::sun::star::lang
;
39 using namespace com::sun::star::uno
;
40 using namespace com::sun::star::linguistic2
;
41 using namespace linguistic
;
48 static const char *aCH
[] =
50 UPN_IS_IGNORE_CONTROL_CHARACTERS
,
51 UPN_IS_USE_DICTIONARY_LIST
,
54 static const int nCHCount
= sizeof(aCH
) / sizeof(aCH
[0]);
57 PropertyChgHelper::PropertyChgHelper(
58 const Reference
< XInterface
> &rxSource
,
59 Reference
< XLinguProperties
> &rxPropSet
,
60 int nAllowedEvents
) :
61 PropertyChgHelperBase(),
62 aPropNames (nCHCount
),
64 aLngSvcEvtListeners (GetLinguMutex()),
66 nEvtFlags (nAllowedEvents
)
68 OUString
*pName
= aPropNames
.getArray();
69 for (sal_Int32 i
= 0; i
< nCHCount
; ++i
)
71 pName
[i
] = OUString::createFromAscii( aCH
[i
] );
77 PropertyChgHelper::~PropertyChgHelper()
82 void PropertyChgHelper::AddPropNames( const char *pNewNames
[], sal_Int32 nCount
)
84 if (pNewNames
&& nCount
)
86 sal_Int32 nLen
= GetPropNames().getLength();
87 GetPropNames().realloc( nLen
+ nCount
);
88 OUString
*pName
= GetPropNames().getArray();
89 for (sal_Int32 i
= 0; i
< nCount
; ++i
)
91 pName
[ nLen
+ i
] = OUString::createFromAscii( pNewNames
[ i
] );
98 void PropertyChgHelper::SetDefaultValues()
100 bResIsIgnoreControlCharacters
= bIsIgnoreControlCharacters
= true;
101 bResIsUseDictionaryList
= bIsUseDictionaryList
= true;
105 void PropertyChgHelper::GetCurrentValues()
107 sal_Int32 nLen
= GetPropNames().getLength();
108 if (GetPropSet().is() && nLen
)
110 const OUString
*pPropName
= GetPropNames().getConstArray();
111 for (sal_Int32 i
= 0; i
< nLen
; ++i
)
116 if ( pPropName
[i
] == UPN_IS_IGNORE_CONTROL_CHARACTERS
)
118 pbVal
= &bIsIgnoreControlCharacters
;
119 pbResVal
= &bResIsIgnoreControlCharacters
;
121 else if ( pPropName
[i
] == UPN_IS_USE_DICTIONARY_LIST
)
123 pbVal
= &bIsUseDictionaryList
;
124 pbResVal
= &bResIsUseDictionaryList
;
127 if (pbVal
&& pbResVal
)
129 GetPropSet()->getPropertyValue( pPropName
[i
] ) >>= *pbVal
;
137 void PropertyChgHelper::SetTmpPropVals( const PropertyValues
&rPropVals
)
139 // return value is default value unless there is an explicitly supplied
141 bResIsIgnoreControlCharacters
= bIsIgnoreControlCharacters
;
142 bResIsUseDictionaryList
= bIsUseDictionaryList
;
144 sal_Int32 nLen
= rPropVals
.getLength();
147 const PropertyValue
*pVal
= rPropVals
.getConstArray();
148 for (sal_Int32 i
= 0; i
< nLen
; ++i
)
150 bool *pbResVal
= NULL
;
151 switch (pVal
[i
].Handle
)
153 case UPH_IS_IGNORE_CONTROL_CHARACTERS
:
154 pbResVal
= &bResIsIgnoreControlCharacters
; break;
155 case UPH_IS_USE_DICTIONARY_LIST
:
156 pbResVal
= &bResIsUseDictionaryList
; break;
161 pVal
[i
].Value
>>= *pbResVal
;
167 bool PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent
& rEvt
)
171 if (GetPropSet().is() && rEvt
.Source
== GetPropSet())
173 sal_Int16 nLngSvcFlags
= (nEvtFlags
& AE_HYPHENATOR
) ?
174 LinguServiceEventFlags::HYPHENATE_AGAIN
: 0;
175 bool bSCWA
= false, // SPELL_CORRECT_WORDS_AGAIN ?
176 bSWWA
= false; // SPELL_WRONG_WORDS_AGAIN ?
179 switch (rEvt
.PropertyHandle
)
181 case UPH_IS_IGNORE_CONTROL_CHARACTERS
:
183 pbVal
= &bIsIgnoreControlCharacters
;
187 case UPH_IS_USE_DICTIONARY_LIST
:
189 pbVal
= &bIsUseDictionaryList
;
190 bSCWA
= bSWWA
= true;
199 rEvt
.NewValue
>>= *pbVal
;
201 bRes
= 0 != pbVal
; // sth changed?
204 bool bSpellEvts
= (nEvtFlags
& AE_SPELLCHECKER
);
205 if (bSCWA
&& bSpellEvts
)
206 nLngSvcFlags
|= LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN
;
207 if (bSWWA
&& bSpellEvts
)
208 nLngSvcFlags
|= LinguServiceEventFlags::SPELL_WRONG_WORDS_AGAIN
;
211 LinguServiceEvent
aEvt( GetEvtObj(), nLngSvcFlags
);
222 PropertyChgHelper::propertyChange( const PropertyChangeEvent
& rEvt
)
223 throw(RuntimeException
, std::exception
)
225 MutexGuard
aGuard( GetLinguMutex() );
226 propertyChange_Impl( rEvt
);
230 void PropertyChgHelper::AddAsPropListener()
234 sal_Int32 nLen
= aPropNames
.getLength();
235 const OUString
*pPropName
= aPropNames
.getConstArray();
236 for (sal_Int32 i
= 0; i
< nLen
; ++i
)
238 if (!pPropName
[i
].isEmpty())
239 xPropSet
->addPropertyChangeListener( pPropName
[i
], this );
244 void PropertyChgHelper::RemoveAsPropListener()
248 sal_Int32 nLen
= aPropNames
.getLength();
249 const OUString
*pPropName
= aPropNames
.getConstArray();
250 for (sal_Int32 i
= 0; i
< nLen
; ++i
)
252 if (!pPropName
[i
].isEmpty())
253 xPropSet
->removePropertyChangeListener( pPropName
[i
], this );
259 void PropertyChgHelper::LaunchEvent( const LinguServiceEvent
&rEvt
)
261 cppu::OInterfaceIteratorHelper
aIt( aLngSvcEvtListeners
);
262 while (aIt
.hasMoreElements())
264 Reference
< XLinguServiceEventListener
> xRef( aIt
.next(), UNO_QUERY
);
266 xRef
->processLinguServiceEvent( rEvt
);
271 void SAL_CALL
PropertyChgHelper::disposing( const EventObject
& rSource
)
272 throw(RuntimeException
, std::exception
)
274 MutexGuard
aGuard( GetLinguMutex() );
275 if (rSource
.Source
== xPropSet
)
277 RemoveAsPropListener();
279 aPropNames
.realloc( 0 );
285 PropertyChgHelper::addLinguServiceEventListener(
286 const Reference
< XLinguServiceEventListener
>& rxListener
)
287 throw(RuntimeException
, std::exception
)
289 MutexGuard
aGuard( GetLinguMutex() );
294 sal_Int32 nCount
= aLngSvcEvtListeners
.getLength();
295 bRes
= aLngSvcEvtListeners
.addInterface( rxListener
) != nCount
;
302 PropertyChgHelper::removeLinguServiceEventListener(
303 const Reference
< XLinguServiceEventListener
>& rxListener
)
304 throw(RuntimeException
, std::exception
)
306 MutexGuard
aGuard( GetLinguMutex() );
311 sal_Int32 nCount
= aLngSvcEvtListeners
.getLength();
312 bRes
= aLngSvcEvtListeners
.removeInterface( rxListener
) != nCount
;
319 PropertyHelper_Thes::PropertyHelper_Thes(
320 const Reference
< XInterface
> &rxSource
,
321 Reference
< XLinguProperties
> &rxPropSet
) :
322 PropertyChgHelper ( rxSource
, rxPropSet
, 0 )
329 PropertyHelper_Thes::~PropertyHelper_Thes()
335 PropertyHelper_Thes::propertyChange( const PropertyChangeEvent
& rEvt
)
336 throw(RuntimeException
, std::exception
)
338 MutexGuard
aGuard( GetLinguMutex() );
339 PropertyChgHelper::propertyChange_Impl( rEvt
);
344 // list of properties from the property set to be used
346 static const char *aSP
[] =
348 UPN_IS_SPELL_UPPER_CASE
,
349 UPN_IS_SPELL_WITH_DIGITS
,
350 UPN_IS_SPELL_CAPITALIZATION
354 PropertyHelper_Spell::PropertyHelper_Spell(
355 const Reference
< XInterface
> & rxSource
,
356 Reference
< XLinguProperties
> &rxPropSet
) :
357 PropertyChgHelper ( rxSource
, rxPropSet
, AE_SPELLCHECKER
)
359 AddPropNames( aSP
, sizeof(aSP
) / sizeof(aSP
[0]) );
363 nResMaxNumberOfSuggestions
= GetDefaultNumberOfSuggestions();
367 PropertyHelper_Spell::~PropertyHelper_Spell()
372 void PropertyHelper_Spell::SetDefaultValues()
374 PropertyChgHelper::SetDefaultValues();
376 bResIsSpellUpperCase
= bIsSpellUpperCase
= false;
377 bResIsSpellWithDigits
= bIsSpellWithDigits
= false;
378 bResIsSpellCapitalization
= bIsSpellCapitalization
= true;
382 void PropertyHelper_Spell::GetCurrentValues()
384 PropertyChgHelper::GetCurrentValues();
386 sal_Int32 nLen
= GetPropNames().getLength();
387 if (GetPropSet().is() && nLen
)
389 const OUString
*pPropName
= GetPropNames().getConstArray();
390 for (sal_Int32 i
= 0; i
< nLen
; ++i
)
395 if ( pPropName
[i
] == UPN_IS_SPELL_UPPER_CASE
)
397 pbVal
= &bIsSpellUpperCase
;
398 pbResVal
= &bResIsSpellUpperCase
;
400 else if ( pPropName
[i
] == UPN_IS_SPELL_WITH_DIGITS
)
402 pbVal
= &bIsSpellWithDigits
;
403 pbResVal
= &bResIsSpellWithDigits
;
405 else if ( pPropName
[i
] == UPN_IS_SPELL_CAPITALIZATION
)
407 pbVal
= &bIsSpellCapitalization
;
408 pbResVal
= &bResIsSpellCapitalization
;
411 if (pbVal
&& pbResVal
)
413 GetPropSet()->getPropertyValue( pPropName
[i
] ) >>= *pbVal
;
421 bool PropertyHelper_Spell::propertyChange_Impl( const PropertyChangeEvent
& rEvt
)
423 bool bRes
= PropertyChgHelper::propertyChange_Impl( rEvt
);
425 if (!bRes
&& GetPropSet().is() && rEvt
.Source
== GetPropSet())
427 bool bSCWA
= false, // SPELL_CORRECT_WORDS_AGAIN ?
428 bSWWA
= false; // SPELL_WRONG_WORDS_AGAIN ?
431 switch (rEvt
.PropertyHandle
)
433 case UPH_IS_SPELL_UPPER_CASE
:
435 pbVal
= &bIsSpellUpperCase
;
436 bSCWA
= ! *pbVal
; // sal_False->sal_True change?
437 bSWWA
= !bSCWA
; // sal_True->sal_False change?
440 case UPH_IS_SPELL_WITH_DIGITS
:
442 pbVal
= &bIsSpellWithDigits
;
443 bSCWA
= ! *pbVal
; // sal_False->sal_True change?
444 bSWWA
= !bSCWA
; // sal_True->sal_False change?
447 case UPH_IS_SPELL_CAPITALIZATION
:
449 pbVal
= &bIsSpellCapitalization
;
450 bSCWA
= ! *pbVal
; // sal_False->sal_True change?
451 bSWWA
= !bSCWA
; // sal_True->sal_False change?
455 DBG_ASSERT( false, "unknown property" );
458 rEvt
.NewValue
>>= *pbVal
;
463 sal_Int16 nLngSvcFlags
= 0;
465 nLngSvcFlags
|= LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN
;
467 nLngSvcFlags
|= LinguServiceEventFlags::SPELL_WRONG_WORDS_AGAIN
;
470 LinguServiceEvent
aEvt( GetEvtObj(), nLngSvcFlags
);
481 PropertyHelper_Spell::propertyChange( const PropertyChangeEvent
& rEvt
)
482 throw(RuntimeException
, std::exception
)
484 MutexGuard
aGuard( GetLinguMutex() );
485 propertyChange_Impl( rEvt
);
489 void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues
&rPropVals
)
491 PropertyChgHelper::SetTmpPropVals( rPropVals
);
493 // return value is default value unless there is an explicitly supplied
495 nResMaxNumberOfSuggestions
= GetDefaultNumberOfSuggestions();
496 bResIsSpellWithDigits
= bIsSpellWithDigits
;
497 bResIsSpellCapitalization
= bIsSpellCapitalization
;
498 bResIsSpellUpperCase
= bIsSpellUpperCase
;
500 sal_Int32 nLen
= rPropVals
.getLength();
503 const PropertyValue
*pVal
= rPropVals
.getConstArray();
504 for (sal_Int32 i
= 0; i
< nLen
; ++i
)
506 if ( pVal
[i
].Name
== UPN_MAX_NUMBER_OF_SUGGESTIONS
)
508 pVal
[i
].Value
>>= nResMaxNumberOfSuggestions
;
512 bool *pbResVal
= NULL
;
513 switch (pVal
[i
].Handle
)
515 case UPH_IS_SPELL_UPPER_CASE
: pbResVal
= &bResIsSpellUpperCase
; break;
516 case UPH_IS_SPELL_WITH_DIGITS
: pbResVal
= &bResIsSpellWithDigits
; break;
517 case UPH_IS_SPELL_CAPITALIZATION
: pbResVal
= &bResIsSpellCapitalization
; break;
519 DBG_ASSERT( false, "unknown property" );
522 pVal
[i
].Value
>>= *pbResVal
;
528 static const char *aHP
[] =
530 UPN_HYPH_MIN_LEADING
,
531 UPN_HYPH_MIN_TRAILING
,
532 UPN_HYPH_MIN_WORD_LENGTH
536 PropertyHelper_Hyphen::PropertyHelper_Hyphen(
537 const Reference
< XInterface
> & rxSource
,
538 Reference
< XLinguProperties
> &rxPropSet
) :
539 PropertyChgHelper ( rxSource
, rxPropSet
, AE_HYPHENATOR
)
541 AddPropNames( aHP
, sizeof(aHP
) / sizeof(aHP
[0]) );
547 PropertyHelper_Hyphen::~PropertyHelper_Hyphen()
552 void PropertyHelper_Hyphen::SetDefaultValues()
554 PropertyChgHelper::SetDefaultValues();
556 nResHyphMinLeading
= nHyphMinLeading
= 2;
557 nResHyphMinTrailing
= nHyphMinTrailing
= 2;
558 nResHyphMinWordLength
= nHyphMinWordLength
= 0;
562 void PropertyHelper_Hyphen::GetCurrentValues()
564 PropertyChgHelper::GetCurrentValues();
566 sal_Int32 nLen
= GetPropNames().getLength();
567 if (GetPropSet().is() && nLen
)
569 const OUString
*pPropName
= GetPropNames().getConstArray();
570 for (sal_Int32 i
= 0; i
< nLen
; ++i
)
572 sal_Int16
*pnVal
= NULL
,
575 if ( pPropName
[i
] == UPN_HYPH_MIN_LEADING
)
577 pnVal
= &nHyphMinLeading
;
578 pnResVal
= &nResHyphMinLeading
;
580 else if ( pPropName
[i
] == UPN_HYPH_MIN_TRAILING
)
582 pnVal
= &nHyphMinTrailing
;
583 pnResVal
= &nResHyphMinTrailing
;
585 else if ( pPropName
[i
] == UPN_HYPH_MIN_WORD_LENGTH
)
587 pnVal
= &nHyphMinWordLength
;
588 pnResVal
= &nResHyphMinWordLength
;
591 if (pnVal
&& pnResVal
)
593 GetPropSet()->getPropertyValue( pPropName
[i
] ) >>= *pnVal
;
601 bool PropertyHelper_Hyphen::propertyChange_Impl( const PropertyChangeEvent
& rEvt
)
603 bool bRes
= PropertyChgHelper::propertyChange_Impl( rEvt
);
605 if (!bRes
&& GetPropSet().is() && rEvt
.Source
== GetPropSet())
607 sal_Int16 nLngSvcFlags
= LinguServiceEventFlags::HYPHENATE_AGAIN
;
609 sal_Int16
*pnVal
= NULL
;
610 switch (rEvt
.PropertyHandle
)
612 case UPH_HYPH_MIN_LEADING
: pnVal
= &nHyphMinLeading
; break;
613 case UPH_HYPH_MIN_TRAILING
: pnVal
= &nHyphMinTrailing
; break;
614 case UPH_HYPH_MIN_WORD_LENGTH
: pnVal
= &nHyphMinWordLength
; break;
616 DBG_ASSERT( false, "unknown property" );
619 rEvt
.NewValue
>>= *pnVal
;
626 LinguServiceEvent
aEvt( GetEvtObj(), nLngSvcFlags
);
637 PropertyHelper_Hyphen::propertyChange( const PropertyChangeEvent
& rEvt
)
638 throw(RuntimeException
, std::exception
)
640 MutexGuard
aGuard( GetLinguMutex() );
641 propertyChange_Impl( rEvt
);
645 void PropertyHelper_Hyphen::SetTmpPropVals( const PropertyValues
&rPropVals
)
647 PropertyChgHelper::SetTmpPropVals( rPropVals
);
649 // return value is default value unless there is an explicitly supplied
651 nResHyphMinLeading
= nHyphMinLeading
;
652 nResHyphMinTrailing
= nHyphMinTrailing
;
653 nResHyphMinWordLength
= nHyphMinWordLength
;
655 sal_Int32 nLen
= rPropVals
.getLength();
659 const PropertyValue
*pVal
= rPropVals
.getConstArray();
660 for (sal_Int32 i
= 0; i
< nLen
; ++i
)
662 sal_Int16
*pnResVal
= NULL
;
664 if ( pVal
[i
].Name
== UPN_HYPH_MIN_LEADING
)
665 pnResVal
= &nResHyphMinLeading
;
666 else if ( pVal
[i
].Name
== UPN_HYPH_MIN_TRAILING
)
667 pnResVal
= &nResHyphMinTrailing
;
668 else if ( pVal
[i
].Name
== UPN_HYPH_MIN_WORD_LENGTH
)
669 pnResVal
= &nResHyphMinWordLength
;
671 DBG_ASSERT( pnResVal
, "unknown property" );
674 pVal
[i
].Value
>>= *pnResVal
;
679 PropertyHelper_Thesaurus::PropertyHelper_Thesaurus(
680 const ::com::sun::star::uno::Reference
<
681 ::com::sun::star::uno::XInterface
> &rxSource
,
682 ::com::sun::star::uno::Reference
<
683 ::com::sun::star::linguistic2::XLinguProperties
> &rxPropSet
)
685 pInst
= new PropertyHelper_Thes( rxSource
, rxPropSet
);
689 PropertyHelper_Thesaurus::~PropertyHelper_Thesaurus()
693 void PropertyHelper_Thesaurus::AddAsPropListener()
695 pInst
->AddAsPropListener();
698 void PropertyHelper_Thesaurus::RemoveAsPropListener()
700 pInst
->RemoveAsPropListener();
703 void PropertyHelper_Thesaurus::SetTmpPropVals( const com::sun::star::beans::PropertyValues
&rPropVals
)
705 pInst
->SetTmpPropVals( rPropVals
);
708 PropertyHelper_Hyphenation::PropertyHelper_Hyphenation(
709 const ::com::sun::star::uno::Reference
<
710 ::com::sun::star::uno::XInterface
> &rxSource
,
711 ::com::sun::star::uno::Reference
<
712 ::com::sun::star::linguistic2::XLinguProperties
> &rxPropSet
)
714 pInst
= new PropertyHelper_Hyphen( rxSource
, rxPropSet
);
718 PropertyHelper_Hyphenation::~PropertyHelper_Hyphenation()
722 void PropertyHelper_Hyphenation::AddAsPropListener()
724 pInst
->AddAsPropListener();
727 void PropertyHelper_Hyphenation::RemoveAsPropListener()
729 pInst
->RemoveAsPropListener();
732 void PropertyHelper_Hyphenation::SetTmpPropVals( const com::sun::star::beans::PropertyValues
&rPropVals
)
734 pInst
->SetTmpPropVals( rPropVals
);
737 sal_Int16
PropertyHelper_Hyphenation::GetMinLeading() const
739 return pInst
->GetMinLeading();
742 sal_Int16
PropertyHelper_Hyphenation::GetMinTrailing() const
744 return pInst
->GetMinTrailing();
747 sal_Int16
PropertyHelper_Hyphenation::GetMinWordLength() const
749 return pInst
->GetMinWordLength();
752 bool PropertyHelper_Hyphenation::addLinguServiceEventListener(
753 const ::com::sun::star::uno::Reference
<
754 ::com::sun::star::linguistic2::XLinguServiceEventListener
>& rxListener
)
755 throw(::com::sun::star::uno::RuntimeException
)
757 return pInst
->addLinguServiceEventListener( rxListener
);
760 bool PropertyHelper_Hyphenation::removeLinguServiceEventListener(
761 const ::com::sun::star::uno::Reference
<
762 ::com::sun::star::linguistic2::XLinguServiceEventListener
>& rxListener
)
763 throw(::com::sun::star::uno::RuntimeException
)
765 return pInst
->removeLinguServiceEventListener( rxListener
);
768 PropertyHelper_Spelling::PropertyHelper_Spelling(
769 const ::com::sun::star::uno::Reference
<
770 ::com::sun::star::uno::XInterface
> &rxSource
,
771 ::com::sun::star::uno::Reference
<
772 ::com::sun::star::linguistic2::XLinguProperties
> &rxPropSet
)
774 pInst
= new PropertyHelper_Spell( rxSource
, rxPropSet
);
778 PropertyHelper_Spelling::~PropertyHelper_Spelling()
782 void PropertyHelper_Spelling::AddAsPropListener()
784 pInst
->AddAsPropListener();
787 void PropertyHelper_Spelling::RemoveAsPropListener()
789 pInst
->RemoveAsPropListener();
792 void PropertyHelper_Spelling::SetTmpPropVals( const com::sun::star::beans::PropertyValues
&rPropVals
)
794 pInst
->SetTmpPropVals( rPropVals
);
797 bool PropertyHelper_Spelling::IsSpellUpperCase() const
799 return pInst
->IsSpellUpperCase();
802 bool PropertyHelper_Spelling::IsSpellWithDigits() const
804 return pInst
->IsSpellWithDigits();
807 bool PropertyHelper_Spelling::IsSpellCapitalization() const
809 return pInst
->IsSpellCapitalization();
812 bool PropertyHelper_Spelling::addLinguServiceEventListener(
813 const ::com::sun::star::uno::Reference
<
814 ::com::sun::star::linguistic2::XLinguServiceEventListener
>& rxListener
)
815 throw(::com::sun::star::uno::RuntimeException
)
817 return pInst
->addLinguServiceEventListener( rxListener
);
820 bool PropertyHelper_Spelling::removeLinguServiceEventListener(
821 const ::com::sun::star::uno::Reference
<
822 ::com::sun::star::linguistic2::XLinguServiceEventListener
>& rxListener
)
823 throw(::com::sun::star::uno::RuntimeException
)
825 return pInst
->removeLinguServiceEventListener( rxListener
);
828 } // namespace linguistic
830 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */