summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-11 11:27:08 +0200
committerNoel Grandin <noel@peralex.com>2012-12-13 05:20:58 +0200
commitb552f521f6bbf917ae41ccfcddeb498c75c824e3 (patch)
treeae21fbb700814e8b31bca384f47f68b0a5e71145 /framework
parentbb8900baaaaa489442a5bd805bb42d43cd6fc152 (diff)
fdo#46808, Adapt ui::UIElementFactoryManager UNO service to new style
Required creating a new merged interface. Change-Id: I12be54e7e4c0614a31a04715342aa244d1687c42
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/services.h1
-rw-r--r--framework/inc/services/layoutmanager.hxx3
-rw-r--r--framework/inc/uifactory/uielementfactorymanager.hxx10
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx6
-rw-r--r--framework/source/uifactory/uielementfactorymanager.cxx2
5 files changed, 10 insertions, 12 deletions
diff --git a/framework/inc/services.h b/framework/inc/services.h
index e606390c8664..7ab2c837895a 100644
--- a/framework/inc/services.h
+++ b/framework/inc/services.h
@@ -57,7 +57,6 @@ namespace framework{
#define SERVICENAME_POPUPMENUCONTROLLERFACTORY DECLARE_ASCII("com.sun.star.frame.PopupMenuControllerFactory" )
#define SERVICENAME_POPUPMENUCONTROLLER DECLARE_ASCII("com.sun.star.frame.PopupMenuController" )
#define SERVICENAME_UICOMMANDDESCRIPTION DECLARE_ASCII("com.sun.star.frame.UICommandDescription" )
-#define SERVICENAME_UIELEMENTFACTORYMANAGER DECLARE_ASCII("com.sun.star.ui.UIElementFactoryManager" )
#define SERVICENAME_UICONFIGURATIONMANAGER DECLARE_ASCII("com.sun.star.ui.UIConfigurationManager" )
#define SERVICENAME_MODULEUICONFIGURATIONMANAGER DECLARE_ASCII("com.sun.star.ui.ModuleUIConfigurationManager" )
#define SERVICENAME_MENUBARFACTORY DECLARE_ASCII("com.sun.star.ui.UIElementFactory" )
diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx
index 79477b248eeb..9e813a73cfc8 100644
--- a/framework/inc/services/layoutmanager.hxx
+++ b/framework/inc/services/layoutmanager.hxx
@@ -52,6 +52,7 @@
#include <com/sun/star/awt/XWindowListener.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/ui/XUIElementFactory.hpp>
+#include <com/sun/star/ui/XUIElementFactoryManager.hpp>
#include <com/sun/star/ui/DockingArea.hpp>
#include <com/sun/star/awt/XTopWindow2.hpp>
#include <com/sun/star/awt/XDockableWindow.hpp>
@@ -317,7 +318,7 @@ namespace framework
UIElement m_aProgressBarElement;
com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > m_xProgressBarBackup;
css::uno::Reference< ::com::sun::star::frame::XModuleManager2 > m_xModuleManager;
- css::uno::Reference< ::com::sun::star::ui::XUIElementFactory > m_xUIElementFactoryManager;
+ css::uno::Reference< ::com::sun::star::ui::XUIElementFactoryManager > m_xUIElementFactoryManager;
css::uno::Reference< ::com::sun::star::container::XNameAccess > m_xPersistentWindowState;
css::uno::Reference< ::com::sun::star::container::XNameAccess > m_xPersistentWindowStateSupplier;
GlobalSettings* m_pGlobalSettings;
diff --git a/framework/inc/uifactory/uielementfactorymanager.hxx b/framework/inc/uifactory/uielementfactorymanager.hxx
index e9bbfcff16cc..266111813de8 100644
--- a/framework/inc/uifactory/uielementfactorymanager.hxx
+++ b/framework/inc/uifactory/uielementfactorymanager.hxx
@@ -34,14 +34,13 @@
#include <stdtypes.h>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/ui/XUIElementFactory.hpp>
-#include <com/sun/star/ui/XUIElementFactoryRegistration.hpp>
+#include <com/sun/star/ui/XUIElementFactoryManager.hpp>
#include <com/sun/star/container/XContainerListener.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include "com/sun/star/frame/XModuleManager2.hpp"
#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <rtl/ustring.hxx>
namespace framework
@@ -100,9 +99,8 @@ namespace framework
class UIElementFactoryManager : private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::WeakImplHelper3< ::com::sun::star::lang::XServiceInfo,
- ::com::sun::star::ui::XUIElementFactory,
- ::com::sun::star::ui::XUIElementFactoryRegistration>
+ public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::ui::XUIElementFactoryManager>
{
public:
UIElementFactoryManager( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 18f1f81ec386..a91642888977 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -51,6 +51,7 @@
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/ui/UIElementType.hpp>
#include <com/sun/star/ui/WindowStateConfiguration.hpp>
+#include <com/sun/star/ui/UIElementFactoryManager.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/frame/LayoutManagerEvents.hpp>
@@ -131,8 +132,7 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM
, m_bMenuBarCloser( false )
, m_pInplaceMenuBar( NULL )
, m_xModuleManager( ModuleManager::create( comphelper::getComponentContext(xServiceManager) ))
- , m_xUIElementFactoryManager( Reference< ui::XUIElementFactory >(
- xServiceManager->createInstance( SERVICENAME_UIELEMENTFACTORYMANAGER ), UNO_QUERY ))
+ , m_xUIElementFactoryManager( ui::UIElementFactoryManager::create(comphelper::getComponentContext(xServiceManager)) )
, m_xPersistentWindowStateSupplier( ui::WindowStateConfiguration::create( comphelper::getComponentContext(xServiceManager) ) )
, m_pGlobalSettings( 0 )
, m_aStatusBarAlias( "private:resource/statusbar/statusbar" )
@@ -155,7 +155,7 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM
m_aStatusBarElement.m_aType = rtl::OUString( "statusbar" );
m_aStatusBarElement.m_aName = m_aStatusBarAlias;
- m_pToolbarManager = new ToolbarLayoutManager( comphelper::getComponentContext(xServiceManager), m_xUIElementFactoryManager, this );
+ m_pToolbarManager = new ToolbarLayoutManager( comphelper::getComponentContext(xServiceManager), Reference<XUIElementFactory>(m_xUIElementFactoryManager, UNO_QUERY_THROW), this );
m_xToolbarManager = uno::Reference< ui::XUIConfigurationListener >( static_cast< OWeakObject* >( m_pToolbarManager ), uno::UNO_QUERY );
Application::AddEventListener( LINK( this, LayoutManager, SettingsChanged ) );
diff --git a/framework/source/uifactory/uielementfactorymanager.cxx b/framework/source/uifactory/uielementfactorymanager.cxx
index 8e465c4cd3ac..dd366b7ca760 100644
--- a/framework/source/uifactory/uielementfactorymanager.cxx
+++ b/framework/source/uifactory/uielementfactorymanager.cxx
@@ -373,7 +373,7 @@ sal_Bool ConfigurationAccess_FactoryManager::impl_getElementProps( const Any& aE
//*****************************************************************************************************************
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2 ( UIElementFactoryManager ,
::cppu::OWeakObject ,
- SERVICENAME_UIELEMENTFACTORYMANAGER ,
+ DECLARE_ASCII("com.sun.star.ui.UIElementFactoryManager"),
IMPLEMENTATIONNAME_UIELEMENTFACTORYMANAGER
)