diff -ur orig/framework/source/accelerators/acceleratorconfiguration.cxx fix2/framework/source/accelerators/acceleratorconfiguration.cxx --- orig/framework/source/accelerators/acceleratorconfiguration.cxx 2011-11-30 23:33:26.106135700 +0800 +++ fix2/framework/source/accelerators/acceleratorconfiguration.cxx 2012-06-20 13:55:34.840462300 +0800 @@ -676,21 +676,23 @@ //----------------------------------------------- // XInterface, XTypeProvider -DEFINE_XINTERFACE_7(XCUBasedAcceleratorConfiguration , +DEFINE_XINTERFACE_8(XCUBasedAcceleratorConfiguration , OWeakObject , DIRECT_INTERFACE(css::lang::XTypeProvider ), DIRECT_INTERFACE(css::ui::XAcceleratorConfiguration ), DIRECT_INTERFACE(css::util::XChangesListener ), DIRECT_INTERFACE(css::form::XReset ), + DIRECT_INTERFACE(css::lang::XComponent ), DIRECT_INTERFACE(css::ui::XUIConfigurationPersistence), DIRECT_INTERFACE(css::ui::XUIConfigurationStorage ), DIRECT_INTERFACE(css::ui::XUIConfiguration )) - DEFINE_XTYPEPROVIDER_7(XCUBasedAcceleratorConfiguration , + DEFINE_XTYPEPROVIDER_8(XCUBasedAcceleratorConfiguration , css::lang::XTypeProvider , css::ui::XAcceleratorConfiguration , css::util::XChangesListener , css::form::XReset , + css::lang::XComponent , css::ui::XUIConfigurationPersistence, css::ui::XUIConfigurationStorage , css::ui::XUIConfiguration ) @@ -1292,6 +1294,27 @@ } //----------------------------------------------- +void SAL_CALL XCUBasedAcceleratorConfiguration::dispose() + throw(css::uno::RuntimeException) +{ + // nop +} + +//----------------------------------------------- +void SAL_CALL XCUBasedAcceleratorConfiguration::addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) + throw(css::uno::RuntimeException) +{ + // nop +} + +//----------------------------------------------- +void SAL_CALL XCUBasedAcceleratorConfiguration::removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) + throw(css::uno::RuntimeException) +{ + // nop +} + +//----------------------------------------------- void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const css::uno::Reference< css::container::XNameAccess >& xCfg ) { AcceleratorCache aReadCache = AcceleratorCache(); diff -ur orig/framework/source/accelerators/globalacceleratorconfiguration.cxx fix2/framework/source/accelerators/globalacceleratorconfiguration.cxx --- orig/framework/source/accelerators/globalacceleratorconfiguration.cxx 2011-11-30 23:33:26.137386300 +0800 +++ fix2/framework/source/accelerators/globalacceleratorconfiguration.cxx 2012-06-20 13:55:34.871713300 +0800 @@ -120,4 +120,23 @@ {} } +//----------------------------------------------- +// +// XComponent.dispose(), #120029#, to release the cyclic reference +// +void SAL_CALL GlobalAcceleratorConfiguration::dispose() + throw(css::uno::RuntimeException) +{ + try + { + css::uno::Reference< css::util::XChangesNotifier > xBroadcaster(m_xCfg, css::uno::UNO_QUERY_THROW); + if ( xBroadcaster.is() ) + xBroadcaster->removeChangesListener(static_cast< css::util::XChangesListener* >(this)); + } + catch(const css::uno::RuntimeException& exRun) + { throw exRun; } + catch(const css::uno::Exception&) + {} +} + } // namespace framework diff -ur orig/framework/source/accelerators/moduleacceleratorconfiguration.cxx fix2/framework/source/accelerators/moduleacceleratorconfiguration.cxx --- orig/framework/source/accelerators/moduleacceleratorconfiguration.cxx 2011-11-30 23:33:26.028009200 +0800 +++ fix2/framework/source/accelerators/moduleacceleratorconfiguration.cxx 2012-06-20 13:55:34.871713300 +0800 @@ -167,5 +167,24 @@ {} } +//----------------------------------------------- +// +// XComponent.dispose(), #120029#, to release the cyclic reference +// +void SAL_CALL ModuleAcceleratorConfiguration::dispose() + throw(css::uno::RuntimeException) +{ + try + { + css::uno::Reference< css::util::XChangesNotifier > xBroadcaster(m_xCfg, css::uno::UNO_QUERY_THROW); + if ( xBroadcaster.is() ) + xBroadcaster->removeChangesListener(static_cast< css::util::XChangesListener* >(this)); + } + catch(const css::uno::RuntimeException& exRun) + { throw exRun; } + catch(const css::uno::Exception&) + {} +} + } // namespace framework diff -ur orig/framework/source/inc/accelerators/acceleratorconfiguration.hxx fix2/framework/source/inc/accelerators/acceleratorconfiguration.hxx --- orig/framework/source/inc/accelerators/acceleratorconfiguration.hxx 2011-11-30 23:33:27.278033200 +0800 +++ fix2/framework/source/inc/accelerators/acceleratorconfiguration.hxx 2012-06-20 13:55:44.653276300 +0800 @@ -309,6 +309,7 @@ , public ::cppu::OWeakObject , public css::lang::XTypeProvider , public css::util::XChangesListener + , public css::lang::XComponent , public css::form::XReset // TODO use XPresetHandler instead if available , public css::ui::XAcceleratorConfiguration // => css::ui::XUIConfigurationPersistence // css::ui::XUIConfigurationStorage @@ -435,6 +436,11 @@ virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) throw(css::uno::RuntimeException); + // XComponent + virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + //______________________________________ // helper for derived classes diff -ur orig/framework/source/inc/accelerators/globalacceleratorconfiguration.hxx fix2/framework/source/inc/accelerators/globalacceleratorconfiguration.hxx --- orig/framework/source/inc/accelerators/globalacceleratorconfiguration.hxx 2011-11-30 23:33:27.293658500 +0800 +++ fix2/framework/source/inc/accelerators/globalacceleratorconfiguration.hxx 2012-06-20 13:55:44.684527300 +0800 @@ -88,6 +88,9 @@ throw (css::uno::Exception , css::uno::RuntimeException); + // XComponent + virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException); + //______________________________________ // helper diff -ur orig/framework/source/inc/accelerators/moduleacceleratorconfiguration.hxx fix2/framework/source/inc/accelerators/moduleacceleratorconfiguration.hxx --- orig/framework/source/inc/accelerators/moduleacceleratorconfiguration.hxx 2011-11-30 23:33:27.324909100 +0800 +++ fix2/framework/source/inc/accelerators/moduleacceleratorconfiguration.hxx 2012-06-20 13:55:44.700152800 +0800 @@ -96,6 +96,9 @@ throw(css::uno::Exception , css::uno::RuntimeException); + // XComponent + virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException); + //______________________________________ // helper diff -ur orig/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx fix2/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx --- orig/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx 2011-11-30 23:33:25.199868300 +0800 +++ fix2/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx 2012-06-20 13:55:55.919261800 +0800 @@ -777,6 +777,9 @@ ResetableGuard aGuard( m_aLock ); Reference< XComponent > xModuleImageManager( m_xModuleImageManager ); m_xModuleImageManager.clear(); + Reference< XComponent > xCompMAM( m_xModuleAcceleratorManager, UNO_QUERY ); + if ( xCompMAM.is() ) + xCompMAM->dispose(); m_xModuleAcceleratorManager.clear(); m_aUIElements[LAYER_USERDEFINED].clear(); m_aUIElements[LAYER_DEFAULT].clear(); diff -ur orig/framework/source/uielement/menubarmanager.cxx fix2/framework/source/uielement/menubarmanager.cxx --- orig/framework/source/uielement/menubarmanager.cxx 2012-02-10 17:28:55.819247600 +0800 +++ fix2/framework/source/uielement/menubarmanager.cxx 2012-06-20 13:56:06.044585800 +0800 @@ -422,6 +422,9 @@ } m_xDocImageManager.clear(); m_xModuleImageManager.clear(); + Reference< XComponent > xCompGAM( m_xGlobalAcceleratorManager, UNO_QUERY ); + if ( xCompGAM.is() ) + xCompGAM->dispose(); m_xGlobalAcceleratorManager.clear(); m_xModuleAcceleratorManager.clear(); m_xDocAcceleratorManager.clear(); diff -ur orig/framework/source/uielement/toolbarmanager.cxx fix2/framework/source/uielement/toolbarmanager.cxx --- orig/framework/source/uielement/toolbarmanager.cxx 2011-11-30 23:33:18.434113400 +0800 +++ fix2/framework/source/uielement/toolbarmanager.cxx 2012-06-20 13:56:06.107087800 +0800 @@ -706,6 +706,9 @@ m_xFrame.clear(); m_xServiceManager.clear(); + Reference< XComponent > xCompGAM( m_xGlobalAcceleratorManager, UNO_QUERY ); + if ( xCompGAM.is() ) + xCompGAM->dispose(); m_xGlobalAcceleratorManager.clear(); m_xModuleAcceleratorManager.clear(); m_xDocAcceleratorManager.clear();