diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-04-13 14:43:59 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-05-31 14:12:28 +0300 |
commit | 7fbfd070f97b048534725e1d89840031631c52d2 (patch) | |
tree | d26e7266101d2fc21fde4b0eec0e230d5e2aadb0 /sw/source/uibase/app | |
parent | 4bf4895739ea16f0fbc68099fd3372e9d8a389a5 (diff) |
Emit DocumentChange events less eagerly (to Automation clients)
They are supposed to be emitten when a new document is created, an
existing document opened, or a document is made the active
document. (Hopefully our SfxEventHintId::ActivateDoc matches the last
one semantically.)
Change-Id: Ic53285fc3d1b9a61ababf77f06477081cef20f27
Diffstat (limited to 'sw/source/uibase/app')
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 22696b2af35f..40d5976c64d2 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -254,10 +254,21 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) if( xVbaEvents.is() ) lcl_processCompatibleSfxHint( xVbaEvents, rHint ); - if ( rHint.GetId() == SfxHintId::DocChanged ) + if ( const SfxEventHint* pSfxEventHint = dynamic_cast<const SfxEventHint*>(&rHint) ) { - uno::Sequence< css::uno::Any > aArgs; - SW_MOD()->CallAutomationApplicationEventSinks( "DocumentChange", aArgs ); + switch( pSfxEventHint->GetEventId() ) + { + case SfxEventHintId::ActivateDoc: + case SfxEventHintId::CreateDoc: + case SfxEventHintId::OpenDoc: + { + uno::Sequence< css::uno::Any > aArgs; + SW_MOD()->CallAutomationApplicationEventSinks( "DocumentChange", aArgs ); + break; + } + default: + break; + } } sal_uInt16 nAction = 0; |