diff options
-rw-r--r-- | compilerplugins/clang/mergeclasses.results | 1 | ||||
-rw-r--r-- | linguistic/inc/iprcache.hxx | 32 | ||||
-rw-r--r-- | linguistic/source/iprcache.cxx | 23 |
3 files changed, 14 insertions, 42 deletions
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results index dc4a34987e8a..eb2789b8ccee 100644 --- a/compilerplugins/clang/mergeclasses.results +++ b/compilerplugins/clang/mergeclasses.results @@ -179,7 +179,6 @@ merge helpdatafileproxy::hdf_internal::Noncopyable with helpdatafileproxy::Hdf merge i_xml_parser_event_handler with (anonymous namespace)::recently_used_file_filter merge io_stm::IRingBuffer with io_stm::MemRingBuffer merge io_stm::I_FIFO with io_stm::MemFIFO -merge linguistic::Flushable with linguistic::SpellCache merge oglcanvas::CanvasHelper with oglcanvas::BitmapCanvasHelper merge oglcanvas::IBufferContext with oglcanvas::(anonymous namespace)::BufferContextImpl merge ooo::vba::XHelperInterface with ooo::vba::msforms::XShape diff --git a/linguistic/inc/iprcache.hxx b/linguistic/inc/iprcache.hxx index 5e56a13db643..095055479cd4 100644 --- a/linguistic/inc/iprcache.hxx +++ b/linguistic/inc/iprcache.hxx @@ -39,16 +39,7 @@ namespace linguistic { - -class Flushable -{ -public: - virtual void Flush() = 0; - -protected: - ~Flushable() {} -}; - +class SpellCache; class FlushListener : public cppu::WeakImplHelper @@ -57,20 +48,16 @@ class FlushListener : ::com::sun::star::beans::XPropertyChangeListener > { - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XSearchableDictionaryList > xDicList; - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XLinguProperties > xPropSet; - Flushable *pFlushObj; + css::uno::Reference< css::linguistic2::XSearchableDictionaryList > xDicList; + css::uno::Reference< css::linguistic2::XLinguProperties > xPropSet; + SpellCache& mrSpellCache; FlushListener(const FlushListener &) SAL_DELETED_FUNCTION; FlushListener & operator = (const FlushListener &) SAL_DELETED_FUNCTION; public: - FlushListener( Flushable *pFO ); - virtual ~FlushListener(); - - inline void SetFlushObj( Flushable *pFO) { pFlushObj = pFO; } + FlushListener( SpellCache& rFO ) : mrSpellCache(rFO) {} + virtual ~FlushListener() {} void SetDicList( ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSearchableDictionaryList > &rDL ); void SetPropSet( ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLinguProperties > &rPS ); @@ -86,8 +73,7 @@ public: }; -class SpellCache : - public Flushable +class SpellCache { ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryListEventListener > @@ -105,8 +91,8 @@ public: SpellCache(); virtual ~SpellCache(); - // Flushable - virtual void Flush() SAL_OVERRIDE; + // called from FlushListener + void Flush(); void AddWord( const OUString& rWord, LanguageType nLang ); bool CheckWord( const OUString& rWord, LanguageType nLang ); diff --git a/linguistic/source/iprcache.cxx b/linguistic/source/iprcache.cxx index cb68a3bad86d..5c4b98a3f51e 100644 --- a/linguistic/source/iprcache.cxx +++ b/linguistic/source/iprcache.cxx @@ -99,17 +99,6 @@ static bool lcl_IsFlushProperty( sal_Int32 nHandle ) } -FlushListener::FlushListener( Flushable *pFO ) -{ - SetFlushObj( pFO ); -} - - -FlushListener::~FlushListener() -{ -} - - void FlushListener::SetDicList( Reference<XSearchableDictionaryList> &rDL ) { MutexGuard aGuard( GetLinguMutex() ); @@ -176,9 +165,8 @@ void SAL_CALL FlushListener::processDictionaryListEvent( DictionaryListEventFlags::DEACTIVATE_POS_DIC; bool bFlush = 0 != (nEvt & nFlushFlags); - DBG_ASSERT( pFlushObj, "missing object (NULL pointer)" ); - if (bFlush && pFlushObj != NULL) - pFlushObj->Flush(); + if (bFlush) + mrSpellCache.Flush(); } } @@ -193,9 +181,8 @@ void SAL_CALL FlushListener::propertyChange( { bool bFlush = lcl_IsFlushProperty( rEvt.PropertyHandle ); - DBG_ASSERT( pFlushObj, "missing object (NULL pointer)" ); - if (bFlush && pFlushObj != NULL) - pFlushObj->Flush(); + if (bFlush) + mrSpellCache.Flush(); } } @@ -203,7 +190,7 @@ void SAL_CALL FlushListener::propertyChange( SpellCache::SpellCache() { - pFlushLstnr = new FlushListener( this ); + pFlushLstnr = new FlushListener( *this ); xFlushLstnr = pFlushLstnr; Reference<XSearchableDictionaryList> aDictionaryList(GetDictionaryList()); pFlushLstnr->SetDicList( aDictionaryList ); //! after reference is established |