24#include <com/sun/star/linguistic2/DictionaryListEventFlags.hpp>
25#include <osl/mutex.hxx>
40#define NUM_FLUSH_PROPS 8
62 if (xListener.is() && rPropSet.is())
66 rPropSet->addPropertyChangeListener(
67 aFlushProperty.aPropName, xListener );
77 if (xListener.is() && rPropSet.is())
81 rPropSet->removePropertyChangeListener(
82 aFlushProperty.aPropName, xListener );
107 xDicList->removeDictionaryListEventListener(
this );
111 xDicList->addDictionaryListEventListener(
this,
false );
138 xDicList->removeDictionaryListEventListener(
this );
150 const DictionaryListEvent& rDicListEvent )
154 if (rDicListEvent.Source !=
xDicList)
157 sal_Int16 nEvt = rDicListEvent.nCondensedEvent;
158 sal_Int16
const nFlushFlags =
159 DictionaryListEventFlags::ADD_NEG_ENTRY |
160 DictionaryListEventFlags::DEL_POS_ENTRY |
161 DictionaryListEventFlags::ACTIVATE_NEG_DIC |
162 DictionaryListEventFlags::DEACTIVATE_POS_DIC;
163 bool bFlush = 0 != (nEvt & nFlushFlags);
171 const PropertyChangeEvent& rEvt )
213 const WordList_t::const_iterator aIt = rList.find( rWord );
214 return aIt != rList.end();
222 if (rList.size() > 500)
224 rList.insert( rWord );
virtual void SAL_CALL processDictionaryListEvent(const css::linguistic2::DictionaryListEvent &rDicListEvent) override
virtual void SAL_CALL disposing(const css::lang::EventObject &rSource) override
SpellCache & mrSpellCache
css::uno::Reference< css::linguistic2::XLinguProperties > xPropSet
css::uno::Reference< css::linguistic2::XSearchableDictionaryList > xDicList
void SetDicList(css::uno::Reference< css::linguistic2::XSearchableDictionaryList > const &rDL)
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &rEvt) override
void SetPropSet(css::uno::Reference< css::linguistic2::XLinguProperties > const &rPS)
LangWordList_t aWordLists
void AddWord(const OUString &rWord, LanguageType nLang)
std::map< LanguageType, WordList_t > LangWordList_t
rtl::Reference< FlushListener > mxFlushLstnr
bool CheckWord(const OUString &rWord, LanguageType nLang)
std::set< OUString > WordList_t
#define UPH_IS_SPELL_WITH_DIGITS
#define UPH_IS_SPELL_CLOSED_COMPOUND
constexpr OUStringLiteral UPN_IS_SPELL_UPPER_CASE
#define UPH_IS_SPELL_HYPHENATED_COMPOUND
constexpr OUStringLiteral UPN_IS_SPELL_CLOSED_COMPOUND
constexpr OUStringLiteral UPN_IS_USE_DICTIONARY_LIST
constexpr OUStringLiteral UPN_IS_SPELL_WITH_DIGITS
constexpr OUStringLiteral UPN_IS_SPELL_HYPHENATED_COMPOUND
#define UPH_IS_SPELL_UPPER_CASE
constexpr OUStringLiteral UPN_IS_IGNORE_CONTROL_CHARACTERS
#define UPH_IS_USE_DICTIONARY_LIST
#define UPH_IS_SPELL_CAPITALIZATION
constexpr OUStringLiteral UPN_IS_SPELL_CAPITALIZATION
#define UPH_IS_IGNORE_CONTROL_CHARACTERS
static void lcl_AddAsPropertyChangeListener(const Reference< XPropertyChangeListener > &xListener, Reference< XLinguProperties > const &rPropSet)
static void lcl_RemoveAsPropertyChangeListener(const Reference< XPropertyChangeListener > &xListener, Reference< XLinguProperties > const &rPropSet)
static bool lcl_IsFlushProperty(sal_Int32 nHandle)
const struct linguistic::@0 aFlushProperties[NUM_FLUSH_PROPS]
uno::Reference< XSearchableDictionaryList > GetDictionaryList()
uno::Reference< XLinguProperties > GetLinguProperties()
osl::Mutex & GetLinguMutex()
! multi-thread safe mutex for all platforms !!