diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-21 15:01:22 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-22 15:19:49 +0200 |
commit | 122e4bc598e2d7d1a3e5cef4c45cda94ca7cfd9b (patch) | |
tree | 60f226b57ba464fedb21a5637532aba6f32da248 /framework/source | |
parent | 03c3cd90930d6fb7d0f498e4b21871b1746d9b2d (diff) |
fdo#46808, XMultiServiceFactory to XComponentContext
Change-Id: I2ca9a2930a921c600f5e93cc2e66d461220ea87d
Diffstat (limited to 'framework/source')
-rw-r--r-- | framework/source/helper/uiconfigelementwrapperbase.cxx | 3 | ||||
-rw-r--r-- | framework/source/uielement/menubarwrapper.cxx | 13 | ||||
-rw-r--r-- | framework/source/uielement/statusbarwrapper.cxx | 9 | ||||
-rw-r--r-- | framework/source/uielement/toolbarwrapper.cxx | 7 | ||||
-rw-r--r-- | framework/source/uifactory/menubarfactory.cxx | 2 | ||||
-rw-r--r-- | framework/source/uifactory/statusbarfactory.cxx | 2 | ||||
-rw-r--r-- | framework/source/uifactory/toolboxfactory.cxx | 2 |
7 files changed, 20 insertions, 18 deletions
diff --git a/framework/source/helper/uiconfigelementwrapperbase.cxx b/framework/source/helper/uiconfigelementwrapperbase.cxx index a70340ad22d8..abac6649ee39 100644 --- a/framework/source/helper/uiconfigelementwrapperbase.cxx +++ b/framework/source/helper/uiconfigelementwrapperbase.cxx @@ -89,7 +89,7 @@ DEFINE_XTYPEPROVIDER_10 ( UIConfigElementWrapperBase ::com::sun::star::ui::XUIConfigurationListener ) -UIConfigElementWrapperBase::UIConfigElementWrapperBase( sal_Int16 nType,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceFactory ) +UIConfigElementWrapperBase::UIConfigElementWrapperBase( sal_Int16 nType ) : ThreadHelpBase ( &Application::GetSolarMutex() ) , ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aLock.getShareableOslMutex() ) , ::cppu::OPropertySetHelper ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) ) @@ -101,7 +101,6 @@ UIConfigElementWrapperBase::UIConfigElementWrapperBase( sal_Int16 nType,const :: , m_bConfigListening ( sal_False ) , m_bDisposed ( sal_False ) , m_bNoClose ( sal_False ) - , m_xServiceFactory ( _xServiceFactory ) , m_aListenerContainer ( m_aLock.getShareableOslMutex() ) { } diff --git a/framework/source/uielement/menubarwrapper.cxx b/framework/source/uielement/menubarwrapper.cxx index 18bcfbe49f51..d2f3a1fbe3fc 100644 --- a/framework/source/uielement/menubarwrapper.cxx +++ b/framework/source/uielement/menubarwrapper.cxx @@ -83,10 +83,11 @@ DEFINE_XTYPEPROVIDER_11 ( MenuBarWrapper , ) MenuBarWrapper::MenuBarWrapper( - const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceManager + const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext ) -: UIConfigElementWrapperBase( UIElementType::MENUBAR,xServiceManager ), - m_bRefreshPopupControllerCache( sal_True ) +: UIConfigElementWrapperBase( UIElementType::MENUBAR ), + m_bRefreshPopupControllerCache( sal_True ), + m_xContext( rxContext ) { } @@ -138,7 +139,7 @@ void SAL_CALL MenuBarWrapper::initialize( const Sequence< Any >& aArguments ) th pVCLMenuBar = new MenuBar(); } - Reference< XModuleManager2 > xModuleManager = ModuleManager::create( comphelper::getComponentContext(m_xServiceFactory) ); + Reference< XModuleManager2 > xModuleManager = ModuleManager::create( m_xContext ); try { @@ -151,7 +152,7 @@ void SAL_CALL MenuBarWrapper::initialize( const Sequence< Any >& aArguments ) th Reference< XURLTransformer > xTrans; try { - xTrans.set( URLTransformer::create(::comphelper::getComponentContext(m_xServiceFactory)) ); + xTrans.set( URLTransformer::create(m_xContext) ); m_xConfigData = m_xConfigSource->getSettings( m_aResourceURL, sal_False ); if ( m_xConfigData.is() ) { @@ -183,7 +184,7 @@ void SAL_CALL MenuBarWrapper::initialize( const Sequence< Any >& aArguments ) th // support. This feature is currently used for "Inplace editing"! Reference< XDispatchProvider > xDispatchProvider; - MenuBarManager* pMenuBarManager = new MenuBarManager( comphelper::getComponentContext(m_xServiceFactory), + MenuBarManager* pMenuBarManager = new MenuBarManager( m_xContext, xFrame, xTrans, xDispatchProvider, diff --git a/framework/source/uielement/statusbarwrapper.cxx b/framework/source/uielement/statusbarwrapper.cxx index af72c33aab4e..8714c454a043 100644 --- a/framework/source/uielement/statusbarwrapper.cxx +++ b/framework/source/uielement/statusbarwrapper.cxx @@ -54,9 +54,10 @@ namespace framework { StatusBarWrapper::StatusBarWrapper( - const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceManager + const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext ) - : UIConfigElementWrapperBase( UIElementType::STATUSBAR,xServiceManager ) + : UIConfigElementWrapperBase( UIElementType::STATUSBAR ), + m_xContext( rxContext ) { } @@ -79,7 +80,7 @@ void SAL_CALL StatusBarWrapper::dispose() throw (::com::sun::star::uno::RuntimeE m_xStatusBarManager.clear(); m_xConfigSource.clear(); m_xConfigData.clear(); - m_xServiceFactory.clear(); + m_xContext.clear(); m_bDisposed = sal_True; } @@ -113,7 +114,7 @@ void SAL_CALL StatusBarWrapper::initialize( const Sequence< Any >& aArguments ) sal_uLong nStyles = WinBits( WB_LEFT | WB_3DLOOK ); pStatusBar = new FrameworkStatusBar( pWindow, nStyles ); - pStatusBarManager = new StatusBarManager( m_xServiceFactory, xFrame, m_aResourceURL, pStatusBar ); + pStatusBarManager = new StatusBarManager( Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW), xFrame, m_aResourceURL, pStatusBar ); ((FrameworkStatusBar*)pStatusBar)->SetStatusBarManager( pStatusBarManager ); m_xStatusBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pStatusBarManager ), UNO_QUERY ); pStatusBar->SetUniqueId( HID_STATUSBAR ); diff --git a/framework/source/uielement/toolbarwrapper.cxx b/framework/source/uielement/toolbarwrapper.cxx index 6c40103b0c93..b70a27d9ac2c 100644 --- a/framework/source/uielement/toolbarwrapper.cxx +++ b/framework/source/uielement/toolbarwrapper.cxx @@ -54,8 +54,9 @@ using namespace ::com::sun::star::ui; namespace framework { -ToolBarWrapper::ToolBarWrapper( const Reference< XMultiServiceFactory >& xServiceManager ) : - UIConfigElementWrapperBase( UIElementType::TOOLBAR,xServiceManager ) +ToolBarWrapper::ToolBarWrapper( const Reference< XComponentContext >& rxContext ) : + UIConfigElementWrapperBase( UIElementType::TOOLBAR ), + m_xContext( rxContext ) { } @@ -152,7 +153,7 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments ) th sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE; pToolBar = new ToolBox( pWindow, nStyles ); - pToolBarManager = new ToolBarManager( comphelper::getComponentContext(m_xServiceFactory), xFrame, m_aResourceURL, pToolBar ); + pToolBarManager = new ToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar ); m_xToolBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY ); pToolBar->WillUsePopupMode( bPopupMode ); } diff --git a/framework/source/uifactory/menubarfactory.cxx b/framework/source/uifactory/menubarfactory.cxx index ef24e5567ae0..9a3d4e4c3ba6 100644 --- a/framework/source/uifactory/menubarfactory.cxx +++ b/framework/source/uifactory/menubarfactory.cxx @@ -87,7 +87,7 @@ throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::l { // SAFE ResetableGuard aLock( m_aLock ); - MenuBarWrapper* pMenuBarWrapper = new MenuBarWrapper( m_xServiceManager ); + MenuBarWrapper* pMenuBarWrapper = new MenuBarWrapper( comphelper::getComponentContext(m_xServiceManager) ); Reference< ::com::sun::star::ui::XUIElement > xMenuBar( (OWeakObject *)pMenuBarWrapper, UNO_QUERY ); Reference< ::com::sun::star::frame::XModuleManager2 > xModuleManager = m_xModuleManager; aLock.unlock(); diff --git a/framework/source/uifactory/statusbarfactory.cxx b/framework/source/uifactory/statusbarfactory.cxx index 83ba7402c9ca..76c6443bc188 100644 --- a/framework/source/uifactory/statusbarfactory.cxx +++ b/framework/source/uifactory/statusbarfactory.cxx @@ -74,7 +74,7 @@ throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::l RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarFactory::createUIElement" ); // SAFE ResetableGuard aLock( m_aLock ); - StatusBarWrapper* pWrapper = new StatusBarWrapper( m_xServiceManager ); + StatusBarWrapper* pWrapper = new StatusBarWrapper( comphelper::getComponentContext(m_xServiceManager) ); Reference< ::com::sun::star::ui::XUIElement > xMenuBar( (OWeakObject *)pWrapper, UNO_QUERY ); Reference< ::com::sun::star::frame::XModuleManager2 > xModuleManager = m_xModuleManager; aLock.unlock(); diff --git a/framework/source/uifactory/toolboxfactory.cxx b/framework/source/uifactory/toolboxfactory.cxx index 993987ee3608..c5a172bd8c19 100644 --- a/framework/source/uifactory/toolboxfactory.cxx +++ b/framework/source/uifactory/toolboxfactory.cxx @@ -70,7 +70,7 @@ Reference< XUIElement > SAL_CALL ToolBoxFactory::createUIElement( throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ) { ResetableGuard aLock( m_aLock ); - ToolBarWrapper* pWrapper = new ToolBarWrapper( m_xServiceManager ); + ToolBarWrapper* pWrapper = new ToolBarWrapper( comphelper::getComponentContext(m_xServiceManager) ); Reference< ::com::sun::star::ui::XUIElement > xMenuBar( (OWeakObject *)pWrapper, UNO_QUERY ); Reference< ::com::sun::star::frame::XModuleManager2 > xModuleManager = m_xModuleManager; aLock.unlock(); |