summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-21 15:01:22 +0200
committerNoel Grandin <noel@peralex.com>2013-05-22 15:19:49 +0200
commit122e4bc598e2d7d1a3e5cef4c45cda94ca7cfd9b (patch)
tree60f226b57ba464fedb21a5637532aba6f32da248 /framework
parent03c3cd90930d6fb7d0f498e4b21871b1746d9b2d (diff)
fdo#46808, XMultiServiceFactory to XComponentContext
Change-Id: I2ca9a2930a921c600f5e93cc2e66d461220ea87d
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/helper/uiconfigelementwrapperbase.hxx6
-rw-r--r--framework/inc/uielement/menubarwrapper.hxx3
-rw-r--r--framework/inc/uielement/statusbarwrapper.hxx5
-rw-r--r--framework/inc/uielement/toolbarwrapper.hxx4
-rw-r--r--framework/source/helper/uiconfigelementwrapperbase.cxx3
-rw-r--r--framework/source/uielement/menubarwrapper.cxx13
-rw-r--r--framework/source/uielement/statusbarwrapper.cxx9
-rw-r--r--framework/source/uielement/toolbarwrapper.cxx7
-rw-r--r--framework/source/uifactory/menubarfactory.cxx2
-rw-r--r--framework/source/uifactory/statusbarfactory.cxx2
-rw-r--r--framework/source/uifactory/toolboxfactory.cxx2
11 files changed, 30 insertions, 26 deletions
diff --git a/framework/inc/helper/uiconfigelementwrapperbase.hxx b/framework/inc/helper/uiconfigelementwrapperbase.hxx
index a97aea5acbef..dd223ad08a41 100644
--- a/framework/inc/helper/uiconfigelementwrapperbase.hxx
+++ b/framework/inc/helper/uiconfigelementwrapperbase.hxx
@@ -34,7 +34,6 @@
#include <com/sun/star/util/XUpdatable.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <rtl/ustring.hxx>
#include <cppuhelper/propshlp.hxx>
@@ -60,7 +59,7 @@ class UIConfigElementWrapperBase : public ::com::sun::star::lang::XTypeProvider
// public methods
//-------------------------------------------------------------------------------------------------------------
public:
- UIConfigElementWrapperBase( sal_Int16 nType,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceFactory );
+ UIConfigElementWrapperBase( sal_Int16 nType );
virtual ~UIConfigElementWrapperBase();
// XInterface
@@ -132,8 +131,7 @@ class UIConfigElementWrapperBase : public ::com::sun::star::lang::XTypeProvider
m_bConfigListening : 1,
m_bDisposed : 1,
m_bNoClose : 1;
- OUString m_aResourceURL;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory;
+ OUString m_aResourceURL;
com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xConfigSource;
com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > m_xConfigData;
com::sun::star::uno::WeakReference< com::sun::star::frame::XFrame > m_xWeakFrame;
diff --git a/framework/inc/uielement/menubarwrapper.hxx b/framework/inc/uielement/menubarwrapper.hxx
index 1bdeca3b726c..2b3d31e363d8 100644
--- a/framework/inc/uielement/menubarwrapper.hxx
+++ b/framework/inc/uielement/menubarwrapper.hxx
@@ -40,7 +40,7 @@ class MenuBarWrapper : public UIConfigElementWrapperBase,
{
public:
MenuBarWrapper(
- const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
+ const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xContext );
virtual ~MenuBarWrapper();
//---------------------------------------------------------------------------------------------------------
@@ -80,6 +80,7 @@ class MenuBarWrapper : public UIConfigElementWrapperBase,
sal_Bool m_bRefreshPopupControllerCache : 1;
com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xMenuBarManager;
PopupControllerCache m_aPopupControllerCache;
+ com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
};
} // namespace framework
diff --git a/framework/inc/uielement/statusbarwrapper.hxx b/framework/inc/uielement/statusbarwrapper.hxx
index 7a06cc12837a..034ce0772afb 100644
--- a/framework/inc/uielement/statusbarwrapper.hxx
+++ b/framework/inc/uielement/statusbarwrapper.hxx
@@ -25,7 +25,7 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
namespace framework
{
@@ -34,7 +34,7 @@ class StatusBarWrapper : public UIConfigElementWrapperBase
{
public:
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 );
virtual ~StatusBarWrapper();
// XComponent
@@ -51,6 +51,7 @@ class StatusBarWrapper : public UIConfigElementWrapperBase
private:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xStatusBarManager;
+ com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
};
} // namespace framework
diff --git a/framework/inc/uielement/toolbarwrapper.hxx b/framework/inc/uielement/toolbarwrapper.hxx
index 37c94d756abd..6b4134534c0d 100644
--- a/framework/inc/uielement/toolbarwrapper.hxx
+++ b/framework/inc/uielement/toolbarwrapper.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ui/XUIFunctionListener.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
namespace framework
{
@@ -35,7 +36,7 @@ class ToolBarWrapper : public ::com::sun::star::ui::XUIFunctionListener,
public UIConfigElementWrapperBase
{
public:
- ToolBarWrapper( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
+ ToolBarWrapper( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xContext );
virtual ~ToolBarWrapper();
// XInterface
@@ -74,6 +75,7 @@ class ToolBarWrapper : public ::com::sun::star::ui::XUIFunctionListener,
private:
com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xToolBarManager;
+ com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
};
}
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();