diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-10-29 16:22:02 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-29 17:32:57 +0100 |
commit | d29818290376f10f318ba805a79643384b34986e (patch) | |
tree | 67ab94575c8bb775abe6ef08392085cd541450aa /sfx2/source | |
parent | eebcaa02585bda0656ca1032082c4dd676de732d (diff) |
fdo#46808: Fix previous commit
Removing the xJobExecutor.is() check from
SfxGlobalEvents_Impl::implts_notifyJobExecution was wrong, as
m_xJobExecutorListener was a WeakReference. However, it appears there is no
good reason for the latter, so the situation can be corrected by turning it into
a plain Reference.
Change-Id: I5690d226b3e8fdd97f75a37502e600b460ec674c
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/inc/eventsupplier.hxx | 3 | ||||
-rw-r--r-- | sfx2/source/notify/eventsupplier.cxx | 9 |
2 files changed, 3 insertions, 9 deletions
diff --git a/sfx2/source/inc/eventsupplier.hxx b/sfx2/source/inc/eventsupplier.hxx index b00a2a02a41c..737e3724bb99 100644 --- a/sfx2/source/inc/eventsupplier.hxx +++ b/sfx2/source/inc/eventsupplier.hxx @@ -34,7 +34,6 @@ #include <com/sun/star/uno/Type.hxx> #include <sal/types.h> #include <osl/mutex.hxx> -#include <cppuhelper/weak.hxx> #include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase3.hxx> @@ -177,7 +176,7 @@ class SfxGlobalEvents_Impl : public ModelCollectionMutexBase > { ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > m_xEvents; - ::com::sun::star::uno::WeakReference< ::com::sun::star::document::XEventListener > m_xJobExecutorListener; + ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener > m_xJobExecutorListener; OINTERFACECONTAINERHELPER m_aLegacyListeners; OINTERFACECONTAINERHELPER m_aDocumentListeners; TModelList m_lModels; diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index 625fedbd5cfa..21b578b7146a 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -551,6 +551,7 @@ SFX_IMPL_ONEINSTANCEFACTORY( SfxGlobalEvents_Impl ); //----------------------------------------------------------------------------- SfxGlobalEvents_Impl::SfxGlobalEvents_Impl( const css::uno::Reference < css::uno::XComponentContext >& rxContext) : ModelCollectionMutexBase( ) + , m_xJobExecutorListener( css::task::JobExecutor::create( rxContext ), css::uno::UNO_QUERY_THROW ) , m_aLegacyListeners (m_aLock) , m_aDocumentListeners (m_aLock) , pImp (0 ) @@ -559,7 +560,6 @@ SfxGlobalEvents_Impl::SfxGlobalEvents_Impl( const css::uno::Reference < css::uno SFX_APP(); pImp = new GlobalEventConfig(); m_xEvents = pImp; - m_xJobExecutorListener = css::uno::Reference< css::document::XEventListener >( css::task::JobExecutor::create( rxContext ), css::uno::UNO_QUERY_THROW ); m_refCount--; } @@ -784,12 +784,7 @@ void SfxGlobalEvents_Impl::implts_notifyJobExecution(const css::document::EventO { try { - // SAFE -> - ::osl::ResettableMutexGuard aLock(m_aLock); - css::uno::Reference< css::document::XEventListener > xJobExecutor(m_xJobExecutorListener); - aLock.clear(); - // <- SAFE - xJobExecutor->notifyEvent(aEvent); + m_xJobExecutorListener->notifyEvent(aEvent); } catch(const css::uno::RuntimeException&) { throw; } |