tdf#146269: don't set modified when connecting frame, model and controller
[LibreOffice.git] / linguistic / source / lngprophelp.cxx
blobce479ee851d8ce540093aa6a6851c10f147869a3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/log.hxx>
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/linguistic2/XLinguProperties.hpp>
28 #include <com/sun/star/beans/XPropertySet.hpp>
29 #include <osl/mutex.hxx>
30 #include <unotools/linguprops.hxx>
32 #include <linguistic/misc.hxx>
33 #include <linguistic/lngprops.hxx>
35 #include <linguistic/lngprophelp.hxx>
37 using namespace osl;
38 using namespace com::sun::star;
39 using namespace com::sun::star::beans;
40 using namespace com::sun::star::lang;
41 using namespace com::sun::star::uno;
42 using namespace com::sun::star::linguistic2;
43 using namespace linguistic;
46 namespace linguistic
50 PropertyChgHelper::PropertyChgHelper(
51 const Reference< XInterface > &rxSource,
52 Reference< XLinguProperties > const &rxPropSet,
53 int nAllowedEvents ) :
54 aPropNames ({UPN_IS_IGNORE_CONTROL_CHARACTERS, UPN_IS_USE_DICTIONARY_LIST}),
55 xMyEvtObj (rxSource),
56 aLngSvcEvtListeners (GetLinguMutex()),
57 xPropSet (rxPropSet),
58 nEvtFlags (nAllowedEvents)
60 SetDefaultValues();
63 PropertyChgHelper::~PropertyChgHelper()
67 void PropertyChgHelper::SetDefaultValues()
69 bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = true;
70 bResIsUseDictionaryList = bIsUseDictionaryList = true;
74 void PropertyChgHelper::GetCurrentValues()
76 const auto& rPropNames = GetPropNames();
77 if (!GetPropSet().is() || rPropNames.empty())
78 return;
80 for (const OUString& rPropName : rPropNames)
82 bool *pbVal = nullptr,
83 *pbResVal = nullptr;
85 if ( rPropName == UPN_IS_IGNORE_CONTROL_CHARACTERS )
87 pbVal = &bIsIgnoreControlCharacters;
88 pbResVal = &bResIsIgnoreControlCharacters;
90 else if ( rPropName == UPN_IS_USE_DICTIONARY_LIST )
92 pbVal = &bIsUseDictionaryList;
93 pbResVal = &bResIsUseDictionaryList;
96 if (pbVal && pbResVal)
98 GetPropSet()->getPropertyValue( rPropName ) >>= *pbVal;
99 *pbResVal = *pbVal;
105 void PropertyChgHelper::SetTmpPropVals( const PropertyValues &rPropVals )
107 // return value is default value unless there is an explicitly supplied
108 // temporary value
109 bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters;
110 bResIsUseDictionaryList = bIsUseDictionaryList;
112 for (const PropertyValue& rVal : rPropVals)
114 bool *pbResVal = nullptr;
115 switch (rVal.Handle)
117 case UPH_IS_IGNORE_CONTROL_CHARACTERS :
118 pbResVal = &bResIsIgnoreControlCharacters; break;
119 case UPH_IS_USE_DICTIONARY_LIST :
120 pbResVal = &bResIsUseDictionaryList; break;
121 default:
124 if (pbResVal)
125 rVal.Value >>= *pbResVal;
130 bool PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt )
132 bool bRes = false;
134 if (GetPropSet().is() && rEvt.Source == GetPropSet())
136 sal_Int16 nLngSvcFlags = (nEvtFlags & AE_HYPHENATOR) ?
137 LinguServiceEventFlags::HYPHENATE_AGAIN : 0;
138 bool bSCWA = false, // SPELL_CORRECT_WORDS_AGAIN ?
139 bSWWA = false; // SPELL_WRONG_WORDS_AGAIN ?
141 bool *pbVal = nullptr;
142 switch (rEvt.PropertyHandle)
144 case UPH_IS_IGNORE_CONTROL_CHARACTERS :
146 pbVal = &bIsIgnoreControlCharacters;
147 nLngSvcFlags = 0;
148 break;
150 case UPH_IS_USE_DICTIONARY_LIST :
152 pbVal = &bIsUseDictionaryList;
153 bSCWA = bSWWA = true;
154 break;
157 if (pbVal)
158 rEvt.NewValue >>= *pbVal;
160 bRes = nullptr != pbVal; // sth changed?
161 if (bRes)
163 bool bSpellEvts = (nEvtFlags & AE_SPELLCHECKER);
164 if (bSCWA && bSpellEvts)
165 nLngSvcFlags |= LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN;
166 if (bSWWA && bSpellEvts)
167 nLngSvcFlags |= LinguServiceEventFlags::SPELL_WRONG_WORDS_AGAIN;
168 if (nLngSvcFlags)
170 LinguServiceEvent aEvt( GetEvtObj(), nLngSvcFlags );
171 LaunchEvent( aEvt );
176 return bRes;
180 void SAL_CALL
181 PropertyChgHelper::propertyChange( const PropertyChangeEvent& rEvt )
183 MutexGuard aGuard( GetLinguMutex() );
184 propertyChange_Impl( rEvt );
188 void PropertyChgHelper::AddAsPropListener()
190 if (xPropSet.is())
192 for (const OUString& rPropName : aPropNames)
194 if (!rPropName.isEmpty())
195 xPropSet->addPropertyChangeListener( rPropName, this );
200 void PropertyChgHelper::RemoveAsPropListener()
202 if (xPropSet.is())
204 for (const OUString& rPropName : aPropNames)
206 if (!rPropName.isEmpty())
207 xPropSet->removePropertyChangeListener( rPropName, this );
213 void PropertyChgHelper::LaunchEvent( const LinguServiceEvent &rEvt )
215 aLngSvcEvtListeners.notifyEach( &XLinguServiceEventListener::processLinguServiceEvent, rEvt );
219 void SAL_CALL PropertyChgHelper::disposing( const EventObject& rSource )
221 MutexGuard aGuard( GetLinguMutex() );
222 if (rSource.Source == xPropSet)
224 RemoveAsPropListener();
225 xPropSet = nullptr;
226 aPropNames.clear();
231 sal_Bool SAL_CALL
232 PropertyChgHelper::addLinguServiceEventListener(
233 const Reference< XLinguServiceEventListener >& rxListener )
235 MutexGuard aGuard( GetLinguMutex() );
237 bool bRes = false;
238 if (rxListener.is())
240 sal_Int32 nCount = aLngSvcEvtListeners.getLength();
241 bRes = aLngSvcEvtListeners.addInterface( rxListener ) != nCount;
243 return bRes;
247 sal_Bool SAL_CALL
248 PropertyChgHelper::removeLinguServiceEventListener(
249 const Reference< XLinguServiceEventListener >& rxListener )
251 MutexGuard aGuard( GetLinguMutex() );
253 bool bRes = false;
254 if (rxListener.is())
256 sal_Int32 nCount = aLngSvcEvtListeners.getLength();
257 bRes = aLngSvcEvtListeners.removeInterface( rxListener ) != nCount;
259 return bRes;
263 PropertyHelper_Thes::PropertyHelper_Thes(
264 const Reference< XInterface > &rxSource,
265 Reference< XLinguProperties > const &rxPropSet ) :
266 PropertyChgHelper ( rxSource, rxPropSet, 0 )
268 SetDefaultValues();
269 GetCurrentValues();
273 PropertyHelper_Thes::~PropertyHelper_Thes()
278 void SAL_CALL
279 PropertyHelper_Thes::propertyChange( const PropertyChangeEvent& rEvt )
281 MutexGuard aGuard( GetLinguMutex() );
282 PropertyChgHelper::propertyChange_Impl( rEvt );
286 PropertyHelper_Spell::PropertyHelper_Spell(
287 const Reference< XInterface > & rxSource,
288 Reference< XLinguProperties > const &rxPropSet ) :
289 PropertyChgHelper ( rxSource, rxPropSet, AE_SPELLCHECKER )
291 auto& rPropNames = GetPropNames();
292 rPropNames.push_back(UPN_IS_SPELL_UPPER_CASE);
293 rPropNames.push_back(UPN_IS_SPELL_WITH_DIGITS);
294 rPropNames.push_back(UPN_IS_SPELL_CLOSED_COMPOUND);
295 rPropNames.push_back(UPN_IS_SPELL_HYPHENATED_COMPOUND);
296 SetDefaultValues();
297 GetCurrentValues();
301 PropertyHelper_Spell::~PropertyHelper_Spell()
306 void PropertyHelper_Spell::SetDefaultValues()
308 PropertyChgHelper::SetDefaultValues();
310 bResIsSpellUpperCase = bIsSpellUpperCase = false;
311 bResIsSpellWithDigits = bIsSpellWithDigits = false;
312 bResIsSpellClosedCompound = bIsSpellClosedCompound = true;
313 bResIsSpellHyphenatedCompound = bIsSpellHyphenatedCompound = true;
317 void PropertyHelper_Spell::GetCurrentValues()
319 PropertyChgHelper::GetCurrentValues();
321 const auto& rPropNames = GetPropNames();
322 if (!GetPropSet().is() || rPropNames.empty())
323 return;
325 for (const OUString& rPropName : rPropNames)
327 bool *pbVal = nullptr,
328 *pbResVal = nullptr;
330 if ( rPropName == UPN_IS_SPELL_UPPER_CASE )
332 pbVal = &bIsSpellUpperCase;
333 pbResVal = &bResIsSpellUpperCase;
335 else if ( rPropName == UPN_IS_SPELL_WITH_DIGITS )
337 pbVal = &bIsSpellWithDigits;
338 pbResVal = &bResIsSpellWithDigits;
340 else if ( rPropName == UPN_IS_SPELL_CLOSED_COMPOUND )
342 pbVal = &bIsSpellClosedCompound;
343 pbResVal = &bResIsSpellClosedCompound;
345 else if ( rPropName == UPN_IS_SPELL_HYPHENATED_COMPOUND )
347 pbVal = &bIsSpellHyphenatedCompound;
348 pbResVal = &bResIsSpellHyphenatedCompound;
351 if (pbVal && pbResVal)
353 GetPropSet()->getPropertyValue( rPropName ) >>= *pbVal;
354 *pbResVal = *pbVal;
360 bool PropertyHelper_Spell::propertyChange_Impl( const PropertyChangeEvent& rEvt )
362 bool bRes = PropertyChgHelper::propertyChange_Impl( rEvt );
364 if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet())
366 bool bSCWA = false, // SPELL_CORRECT_WORDS_AGAIN ?
367 bSWWA = false; // SPELL_WRONG_WORDS_AGAIN ?
369 bool *pbVal = nullptr;
370 switch (rEvt.PropertyHandle)
372 case UPH_IS_SPELL_UPPER_CASE :
374 pbVal = &bIsSpellUpperCase;
375 bSCWA = ! *pbVal; // sal_False->sal_True change?
376 bSWWA = !bSCWA; // sal_True->sal_False change?
377 break;
379 case UPH_IS_SPELL_WITH_DIGITS :
381 pbVal = &bIsSpellWithDigits;
382 bSCWA = ! *pbVal; // sal_False->sal_True change?
383 bSWWA = !bSCWA; // sal_True->sal_False change?
384 break;
386 case UPH_IS_SPELL_CLOSED_COMPOUND :
388 pbVal = &bIsSpellClosedCompound;
389 bSCWA = ! *pbVal; // sal_False->sal_True change?
390 bSWWA = !bSCWA; // sal_True->sal_False change?
391 break;
393 case UPH_IS_SPELL_HYPHENATED_COMPOUND :
395 pbVal = &bIsSpellHyphenatedCompound;
396 bSCWA = ! *pbVal; // sal_False->sal_True change?
397 bSWWA = !bSCWA; // sal_True->sal_False change?
398 break;
400 default:
401 SAL_WARN( "linguistic", "unknown property handle " << rEvt.PropertyHandle << " (check in include/unotools/linguprops.hxx)" );
403 if (pbVal)
404 rEvt.NewValue >>= *pbVal;
406 bRes = (pbVal != nullptr);
407 if (bRes)
409 sal_Int16 nLngSvcFlags = 0;
410 if (bSCWA)
411 nLngSvcFlags |= LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN;
412 if (bSWWA)
413 nLngSvcFlags |= LinguServiceEventFlags::SPELL_WRONG_WORDS_AGAIN;
414 if (nLngSvcFlags)
416 LinguServiceEvent aEvt( GetEvtObj(), nLngSvcFlags );
417 LaunchEvent( aEvt );
422 return bRes;
426 void SAL_CALL
427 PropertyHelper_Spell::propertyChange( const PropertyChangeEvent& rEvt )
429 MutexGuard aGuard( GetLinguMutex() );
430 propertyChange_Impl( rEvt );
434 void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals )
436 PropertyChgHelper::SetTmpPropVals( rPropVals );
438 // return value is default value unless there is an explicitly supplied
439 // temporary value
440 bResIsSpellWithDigits = bIsSpellWithDigits;
441 bResIsSpellClosedCompound = bIsSpellClosedCompound;
442 bResIsSpellHyphenatedCompound = bIsSpellHyphenatedCompound;
443 bResIsSpellUpperCase = bIsSpellUpperCase;
445 for (const PropertyValue& rVal : rPropVals)
447 if ( rVal.Name == UPN_MAX_NUMBER_OF_SUGGESTIONS )
449 // special value that is not part of the property set and thus needs to be handled differently
451 else
453 bool *pbResVal = nullptr;
454 switch (rVal.Handle)
456 case UPH_IS_SPELL_UPPER_CASE : pbResVal = &bResIsSpellUpperCase; break;
457 case UPH_IS_SPELL_WITH_DIGITS : pbResVal = &bResIsSpellWithDigits; break;
458 case UPH_IS_SPELL_CLOSED_COMPOUND : pbResVal = &bResIsSpellClosedCompound; break;
459 case UPH_IS_SPELL_HYPHENATED_COMPOUND : pbResVal = &bResIsSpellHyphenatedCompound; break;
460 default:
461 SAL_WARN( "linguistic", "unknown property handle " << rVal.Handle << " (check in include/unotools/linguprops.hxx)" );
463 if (pbResVal)
464 rVal.Value >>= *pbResVal;
469 PropertyHelper_Hyphen::PropertyHelper_Hyphen(
470 const Reference< XInterface > & rxSource,
471 Reference< XLinguProperties > const &rxPropSet ) :
472 PropertyChgHelper ( rxSource, rxPropSet, AE_HYPHENATOR )
474 auto& rPropNames = GetPropNames();
475 rPropNames.push_back(UPN_HYPH_MIN_LEADING);
476 rPropNames.push_back(UPN_HYPH_MIN_TRAILING);
477 rPropNames.push_back(UPN_HYPH_MIN_WORD_LENGTH);
478 SetDefaultValues();
479 GetCurrentValues();
483 PropertyHelper_Hyphen::~PropertyHelper_Hyphen()
488 void PropertyHelper_Hyphen::SetDefaultValues()
490 PropertyChgHelper::SetDefaultValues();
492 nResHyphMinLeading = nHyphMinLeading = 2;
493 nResHyphMinTrailing = nHyphMinTrailing = 2;
494 nResHyphCompoundMinLeading = nHyphCompoundMinLeading = 2;
495 nResHyphMinWordLength = nHyphMinWordLength = 0;
496 nResHyphTextHyphenZone = nHyphTextHyphenZone = 0;
497 bResNoHyphenateCaps = bNoHyphenateCaps = false;
501 void PropertyHelper_Hyphen::GetCurrentValues()
503 PropertyChgHelper::GetCurrentValues();
505 const auto& rPropNames = GetPropNames();
506 if (!GetPropSet().is() || rPropNames.empty())
507 return;
509 for (const OUString& rPropName : rPropNames)
511 sal_Int16 *pnVal = nullptr,
512 *pnResVal = nullptr;
513 bool *pbVal = nullptr;
514 bool *pbResVal = nullptr;
516 if ( rPropName == UPN_HYPH_MIN_LEADING )
518 pnVal = &nHyphMinLeading;
519 pnResVal = &nResHyphMinLeading;
521 else if ( rPropName == UPN_HYPH_MIN_TRAILING )
523 pnVal = &nHyphMinTrailing;
524 pnResVal = &nResHyphMinTrailing;
526 if ( rPropName == UPN_HYPH_COMPOUND_MIN_LEADING )
528 pnVal = &nHyphCompoundMinLeading;
529 pnResVal = &nResHyphCompoundMinLeading;
531 else if ( rPropName == UPN_HYPH_MIN_WORD_LENGTH )
533 pnVal = &nHyphMinWordLength;
534 pnResVal = &nResHyphMinWordLength;
536 else if ( rPropName == UPN_HYPH_ZONE )
538 pnVal = &nHyphTextHyphenZone;
539 pnResVal = &nResHyphTextHyphenZone;
541 else if ( rPropName == UPN_HYPH_NO_CAPS )
543 pbVal = &bNoHyphenateCaps;
544 pbResVal = &bResNoHyphenateCaps;
547 if (pnVal && pnResVal)
549 GetPropSet()->getPropertyValue( rPropName ) >>= *pnVal;
550 *pnResVal = *pnVal;
552 else if (pbVal && pbResVal)
554 GetPropSet()->getPropertyValue( rPropName ) >>= *pbVal;
555 *pbResVal = *pbVal;
561 bool PropertyHelper_Hyphen::propertyChange_Impl( const PropertyChangeEvent& rEvt )
563 bool bRes = PropertyChgHelper::propertyChange_Impl( rEvt );
565 if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet())
567 sal_Int16 *pnVal = nullptr;
568 bool *pbVal = nullptr;
569 switch (rEvt.PropertyHandle)
571 case UPH_HYPH_MIN_LEADING : pnVal = &nHyphMinLeading; break;
572 case UPH_HYPH_MIN_TRAILING : pnVal = &nHyphMinTrailing; break;
573 case UPH_HYPH_COMPOUND_MIN_LEADING : pnVal = &nHyphCompoundMinLeading; break;
574 case UPH_HYPH_MIN_WORD_LENGTH : pnVal = &nHyphMinWordLength; break;
575 case UPH_HYPH_ZONE : pnVal = &nHyphTextHyphenZone; break;
576 case UPH_HYPH_NO_CAPS : pbVal = &bNoHyphenateCaps; break;
577 default:
578 SAL_WARN( "linguistic", "unknown property handle " << rEvt.PropertyHandle << " (check in include/unotools/linguprops.hxx)");
580 if (pnVal)
581 rEvt.NewValue >>= *pnVal;
582 else if (pbVal)
583 rEvt.NewValue >>= *pbVal;
585 bRes = (pnVal != nullptr || pbVal != nullptr);
586 if (bRes)
588 LinguServiceEvent aEvt(GetEvtObj(), LinguServiceEventFlags::HYPHENATE_AGAIN);
589 LaunchEvent(aEvt);
593 return bRes;
597 void SAL_CALL
598 PropertyHelper_Hyphen::propertyChange( const PropertyChangeEvent& rEvt )
600 MutexGuard aGuard( GetLinguMutex() );
601 propertyChange_Impl( rEvt );
605 void PropertyHelper_Hyphen::SetTmpPropVals( const PropertyValues &rPropVals )
607 PropertyChgHelper::SetTmpPropVals( rPropVals );
609 // return value is default value unless there is an explicitly supplied
610 // temporary value
611 nResHyphMinLeading = nHyphMinLeading;
612 nResHyphMinTrailing = nHyphMinTrailing;
613 nResHyphCompoundMinLeading = nHyphCompoundMinLeading;
614 nResHyphMinWordLength = nHyphMinWordLength;
615 nResHyphTextHyphenZone = nHyphTextHyphenZone;
616 bResNoHyphenateCaps = bNoHyphenateCaps;
618 for (const PropertyValue& rVal : rPropVals)
620 sal_Int16 *pnResVal = nullptr;
621 bool *pbResVal = nullptr;
623 if ( rVal.Name == UPN_HYPH_MIN_LEADING )
624 pnResVal = &nResHyphMinLeading;
625 else if ( rVal.Name == UPN_HYPH_MIN_TRAILING )
626 pnResVal = &nResHyphMinTrailing;
627 if ( rVal.Name == UPN_HYPH_COMPOUND_MIN_LEADING )
628 pnResVal = &nResHyphCompoundMinLeading;
629 else if ( rVal.Name == UPN_HYPH_MIN_WORD_LENGTH )
630 pnResVal = &nResHyphMinWordLength;
631 else if ( rVal.Name == UPN_HYPH_ZONE )
632 pnResVal = &nResHyphTextHyphenZone;
633 else if ( rVal.Name == UPN_HYPH_NO_CAPS )
634 pbResVal = &bResNoHyphenateCaps;
635 else if (rVal.Name == UPN_HYPH_NO_LAST_WORD ||
636 rVal.Name == UPN_HYPH_KEEP ||
637 rVal.Name == UPN_HYPH_KEEP_TYPE)
639 // skip these known ones without warnings
640 continue;
643 SAL_WARN_IF( !(pnResVal || pbResVal), "linguistic", "unknown property '" << rVal.Name << "'");
645 if (pnResVal)
646 rVal.Value >>= *pnResVal;
647 else if (pbResVal)
648 rVal.Value >>= *pbResVal;
652 PropertyHelper_Thesaurus::PropertyHelper_Thesaurus(
653 const css::uno::Reference< css::uno::XInterface > &rxSource,
654 css::uno::Reference< css::linguistic2::XLinguProperties > const &rxPropSet )
656 mxPropHelper = new PropertyHelper_Thes( rxSource, rxPropSet );
659 PropertyHelper_Thesaurus::~PropertyHelper_Thesaurus()
663 void PropertyHelper_Thesaurus::AddAsPropListener()
665 mxPropHelper->AddAsPropListener();
668 void PropertyHelper_Thesaurus::RemoveAsPropListener()
670 mxPropHelper->RemoveAsPropListener();
673 void PropertyHelper_Thesaurus::SetTmpPropVals( const css::beans::PropertyValues &rPropVals )
675 mxPropHelper->SetTmpPropVals( rPropVals );
678 PropertyHelper_Hyphenation::PropertyHelper_Hyphenation(
679 const css::uno::Reference< css::uno::XInterface > &rxSource,
680 css::uno::Reference< css::linguistic2::XLinguProperties > const &rxPropSet)
682 mxPropHelper = new PropertyHelper_Hyphen( rxSource, rxPropSet );
685 PropertyHelper_Hyphenation::~PropertyHelper_Hyphenation()
689 void PropertyHelper_Hyphenation::AddAsPropListener()
691 mxPropHelper->AddAsPropListener();
694 void PropertyHelper_Hyphenation::RemoveAsPropListener()
696 mxPropHelper->RemoveAsPropListener();
699 void PropertyHelper_Hyphenation::SetTmpPropVals( const css::beans::PropertyValues &rPropVals )
701 mxPropHelper->SetTmpPropVals( rPropVals );
704 sal_Int16 PropertyHelper_Hyphenation::GetMinLeading() const
706 return mxPropHelper->GetMinLeading();
709 sal_Int16 PropertyHelper_Hyphenation::GetMinTrailing() const
711 return mxPropHelper->GetMinTrailing();
714 sal_Int16 PropertyHelper_Hyphenation::GetCompoundMinLeading() const
716 return mxPropHelper->GetCompoundMinLeading();
719 sal_Int16 PropertyHelper_Hyphenation::GetMinWordLength() const
721 return mxPropHelper->GetMinWordLength();
724 bool PropertyHelper_Hyphenation::IsNoHyphenateCaps() const
726 return mxPropHelper->IsNoHyphenateCaps();
729 bool PropertyHelper_Hyphenation::addLinguServiceEventListener(
730 const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >& rxListener )
732 return mxPropHelper->addLinguServiceEventListener( rxListener );
735 bool PropertyHelper_Hyphenation::removeLinguServiceEventListener(
736 const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >& rxListener )
738 return mxPropHelper->removeLinguServiceEventListener( rxListener );
741 PropertyHelper_Spelling::PropertyHelper_Spelling(
742 const css::uno::Reference< css::uno::XInterface > &rxSource,
743 css::uno::Reference< css::linguistic2::XLinguProperties > const &rxPropSet )
745 mxPropHelper = new PropertyHelper_Spell( rxSource, rxPropSet );
748 PropertyHelper_Spelling::~PropertyHelper_Spelling()
752 void PropertyHelper_Spelling::AddAsPropListener()
754 mxPropHelper->AddAsPropListener();
757 void PropertyHelper_Spelling::RemoveAsPropListener()
759 mxPropHelper->RemoveAsPropListener();
762 void PropertyHelper_Spelling::SetTmpPropVals( const css::beans::PropertyValues &rPropVals )
764 mxPropHelper->SetTmpPropVals( rPropVals );
767 bool PropertyHelper_Spelling::IsSpellUpperCase() const
769 return mxPropHelper->IsSpellUpperCase();
772 bool PropertyHelper_Spelling::IsSpellWithDigits() const
774 return mxPropHelper->IsSpellWithDigits();
777 bool PropertyHelper_Spelling::IsSpellClosedCompound() const
779 return mxPropHelper->IsSpellClosedCompound();
782 bool PropertyHelper_Spelling::IsSpellHyphenatedCompound() const
784 return mxPropHelper->IsSpellHyphenatedCompound();
787 bool PropertyHelper_Spelling::addLinguServiceEventListener(
788 const css::uno::Reference<
789 css::linguistic2::XLinguServiceEventListener >& rxListener )
791 return mxPropHelper->addLinguServiceEventListener( rxListener );
794 bool PropertyHelper_Spelling::removeLinguServiceEventListener(
795 const css::uno::Reference<
796 css::linguistic2::XLinguServiceEventListener >& rxListener )
798 return mxPropHelper->removeLinguServiceEventListener( rxListener );
801 } // namespace linguistic
803 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */