summaryrefslogtreecommitdiffstats
path: root/sc
diff options
context:
space:
mode:
authorDaniel Rentz [dr] <daniel.rentz@oracle.com>2010-09-20 20:50:44 +0200
committerDaniel Rentz [dr] <daniel.rentz@oracle.com>2010-09-20 20:50:44 +0200
commitedd423387c36fa561dc34ccc43097aac58813a9a (patch)
tree93f0a4007a7cb1689c86c25d8b41f68d4d44a230 /sc
parentmib19: #163691# remember VBA object provider instance (diff)
downloadcore-edd423387c36fa561dc34ccc43097aac58813a9a.tar.gz
core-edd423387c36fa561dc34ccc43097aac58813a9a.zip
mib19: #163655# do not fire events when document is disposed
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/docsh.cxx20
1 files changed, 7 insertions, 13 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 9e98d7430d96..e7089349fdb7 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -553,6 +553,13 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
xVbaEvents->processVbaEvent( WORKBOOK_AFTERSAVE, aArgs );
}
break;
+ case SFX_EVENT_CLOSEDOC:
+ {
+ // #163655# prevent event processing after model is disposed
+ aDocument.SetVbaEventProcessor( uno::Reference< script::vba::XVBAEventProcessor >() );
+ uno::Reference< lang::XEventListener >( xVbaEvents, uno::UNO_QUERY_THROW )->disposing( lang::EventObject() );
+ }
+ break;
}
}
}
@@ -618,19 +625,6 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
SetReadOnlyUI( sal_True );
}
}
-
- // VBA specific initialization
- if( aDocument.IsInVBAMode() ) try
- {
- uno::Reference< frame::XModel > xModel( GetModel(), uno::UNO_SET_THROW );
-
- // create VBAGlobals object if not yet done (this also creates the "ThisExcelDoc" symbol and the event processor)
- uno::Reference< lang::XMultiServiceFactory > xFactory( xModel, uno::UNO_QUERY_THROW );
- xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAGlobals" ) ) );
- }
- catch( uno::Exception& )
- {
- }
}
break;
case SFX_EVENT_VIEWCREATED: