summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-03-26 15:15:19 +0200
committerNoel Grandin <noel@peralex.com>2013-04-23 16:05:55 +0200
commit1dec1f2f7efc579dedaec0535e3a750945039019 (patch)
tree761ae4a0a92cbdbb952def9ad808e1ff7c9de516
parentdbb4d4dd98c623c5c9309961ebb0548898b111e1 (diff)
fdo#46808, convert framework::AddonsToolBarWrapper to XComponentContext
-rw-r--r--framework/inc/uielement/addonstoolbarwrapper.hxx6
-rw-r--r--framework/inc/uifactory/addonstoolboxfactory.hxx5
-rw-r--r--framework/source/uielement/addonstoolbarwrapper.cxx6
-rw-r--r--framework/source/uifactory/addonstoolboxfactory.cxx18
4 files changed, 17 insertions, 18 deletions
diff --git a/framework/inc/uielement/addonstoolbarwrapper.hxx b/framework/inc/uielement/addonstoolbarwrapper.hxx
index d73c67b6c741..34d80ae28929 100644
--- a/framework/inc/uielement/addonstoolbarwrapper.hxx
+++ b/framework/inc/uielement/addonstoolbarwrapper.hxx
@@ -24,7 +24,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
{
@@ -33,7 +33,7 @@ class AddonsToolBarManager;
class AddonsToolBarWrapper : public UIElementWrapperBase
{
public:
- AddonsToolBarWrapper( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
+ AddonsToolBarWrapper( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xContext );
virtual ~AddonsToolBarWrapper();
// XComponent
@@ -49,7 +49,7 @@ class AddonsToolBarWrapper : public UIElementWrapperBase
// protected methods
//-------------------------------------------------------------------------------------------------------------
private:
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext;
com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xToolBarManager;
com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > > m_aConfigData;
};
diff --git a/framework/inc/uifactory/addonstoolboxfactory.hxx b/framework/inc/uifactory/addonstoolboxfactory.hxx
index 7f0c377494ff..920a4ed490fd 100644
--- a/framework/inc/uifactory/addonstoolboxfactory.hxx
+++ b/framework/inc/uifactory/addonstoolboxfactory.hxx
@@ -30,7 +30,6 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/ui/XUIElementFactory.hpp>
#include <com/sun/star/frame/XModuleManager2.hpp>
@@ -48,7 +47,7 @@ class AddonsToolBoxFactory : protected ThreadHelpBase
com::sun::star::ui::XUIElementFactory >
{
public:
- AddonsToolBoxFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
+ AddonsToolBoxFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
virtual ~AddonsToolBoxFactory();
// XInterface, XTypeProvider, XServiceInfo
@@ -61,7 +60,7 @@ class AddonsToolBoxFactory : protected ThreadHelpBase
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager2 > m_xModuleManager;
};
diff --git a/framework/source/uielement/addonstoolbarwrapper.cxx b/framework/source/uielement/addonstoolbarwrapper.cxx
index 2921b020ab84..3153b2abbafc 100644
--- a/framework/source/uielement/addonstoolbarwrapper.cxx
+++ b/framework/source/uielement/addonstoolbarwrapper.cxx
@@ -53,9 +53,9 @@ using namespace ::com::sun::star::ui;
namespace framework
{
-AddonsToolBarWrapper::AddonsToolBarWrapper( const Reference< XMultiServiceFactory >& xServiceManager ) :
+AddonsToolBarWrapper::AddonsToolBarWrapper( const Reference< XComponentContext >& xContext ) :
UIElementWrapperBase( UIElementType::TOOLBAR ),
- m_xServiceManager( xServiceManager )
+ m_xContext( xContext )
{
}
@@ -116,7 +116,7 @@ void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArgument
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 AddonsToolBarManager( comphelper::getComponentContext(m_xServiceManager), xFrame, m_aResourceURL, pToolBar );
+ pToolBarManager = new AddonsToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar );
m_xToolBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY );
}
}
diff --git a/framework/source/uifactory/addonstoolboxfactory.cxx b/framework/source/uifactory/addonstoolboxfactory.cxx
index 823ca67e89b3..990f32d06d62 100644
--- a/framework/source/uifactory/addonstoolboxfactory.cxx
+++ b/framework/source/uifactory/addonstoolboxfactory.cxx
@@ -51,19 +51,19 @@ namespace framework
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( AddonsToolBoxFactory ,
- ::cppu::OWeakObject ,
- SERVICENAME_TOOLBARFACTORY ,
- IMPLEMENTATIONNAME_ADDONSTOOLBARFACTORY
- )
+PRIVATE_DEFINE_XSERVICEINFO_NEWSTYLE( AddonsToolBoxFactory,
+ ::cppu::OWeakObject,
+ SERVICENAME_TOOLBARFACTORY,
+ IMPLEMENTATIONNAME_ADDONSTOOLBARFACTORY )
+PRIVATE_DEFINE_ONEINSTANCEFACTORY( AddonsToolBoxFactory )
DEFINE_INIT_SERVICE ( AddonsToolBoxFactory, {} )
AddonsToolBoxFactory::AddonsToolBoxFactory(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ) :
ThreadHelpBase( &Application::GetSolarMutex() )
- , m_xServiceManager( xServiceManager )
- , m_xModuleManager( ModuleManager::create( comphelper::getComponentContext(xServiceManager) ) )
+ , m_xContext( xContext )
+ , m_xModuleManager( ModuleManager::create( xContext ) )
{
}
@@ -186,7 +186,7 @@ throw ( ::com::sun::star::container::NoSuchElementException,
aPropSeq[2] <<= aPropValue;
SolarMutexGuard aGuard;
- AddonsToolBarWrapper* pToolBarWrapper = new AddonsToolBarWrapper( m_xServiceManager );
+ AddonsToolBarWrapper* pToolBarWrapper = new AddonsToolBarWrapper( m_xContext );
xToolBar = Reference< ::com::sun::star::ui::XUIElement >( (OWeakObject *)pToolBarWrapper, UNO_QUERY );
Reference< XInitialization > xInit( xToolBar, UNO_QUERY );
xInit->initialize( aPropSeq );