summaryrefslogtreecommitdiff
path: root/forms/source/misc/InterfaceContainer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'forms/source/misc/InterfaceContainer.cxx')
-rw-r--r--forms/source/misc/InterfaceContainer.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx
index e494406f87ef..713dc8fb8909 100644
--- a/forms/source/misc/InterfaceContainer.cxx
+++ b/forms/source/misc/InterfaceContainer.cxx
@@ -154,9 +154,16 @@ void OInterfaceContainer::impl_addVbEvents_nolck_nothrow( const sal_Int32 i_nIn
xProps->getPropertyValue( rtl::OUString::createFromAscii("DefaultControl" ) ) >>= sServiceName;
Reference< ooo::vba::XVBAToOOEventDescGen > xDescSupplier( m_xServiceFactory->createInstance( rtl::OUString::createFromAscii( "ooo.vba.VBAToOOEventDesc" ) ), UNO_QUERY_THROW );
- Sequence< ScriptEventDescriptor > vbaEvents = xDescSupplier->getEventDescriptions( m_xServiceFactory->createInstance( sServiceName ), sCodeName );
+ Reference< XInterface > xInterface = m_xServiceFactory->createInstance( sServiceName );
+ Sequence< ScriptEventDescriptor > vbaEvents = xDescSupplier->getEventDescriptions( xInterface, sCodeName );
// register the vba script events
m_xEventAttacher->registerScriptEvents( i_nIndex, vbaEvents );
+
+ Reference< XComponent > xComponent( xInterface, UNO_QUERY );
+ if ( xComponent.is() )
+ {
+ xComponent->dispose();
+ }
}
while ( false );
}