Kaydet (Commit) 7fbfd070 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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
üst 4bf48957
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment