summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-10 15:58:49 +0200
committerNoel Grandin <noel@peralex.com>2012-12-13 05:20:58 +0200
commite52a5e298b55125534cd8548ed4c1f8b694bfef6 (patch)
treecd05d4866578c0f63142a24c8ef7607778b3c78a
parent2f998bdf8f5c504f09833febe0cd16ce743f57a5 (diff)
fdo#46808, use service constructor for ui::GlobalAcceleratorConfiguration
Change-Id: Icab69ba138b28c3baed4352da86a1b3b0c0cc195
-rw-r--r--cui/source/customize/acccfg.cxx4
-rw-r--r--framework/inc/services.h1
-rw-r--r--framework/source/accelerators/globalacceleratorconfiguration.cxx2
-rw-r--r--framework/source/uielement/menubarmanager.cxx5
-rw-r--r--framework/source/uielement/newmenucontroller.cxx5
-rw-r--r--framework/source/uielement/toolbarmanager.cxx5
-rw-r--r--offapi/com/sun/star/ui/GlobalAcceleratorConfiguration.idl3
-rw-r--r--svtools/inc/svtools/acceleratorexecute.hxx5
-rw-r--r--svtools/source/misc/acceleratorexecute.cxx20
9 files changed, 19 insertions, 31 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index a0bac71abd32..e261ad09a8d6 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -32,6 +32,7 @@
#include <svl/stritem.hxx>
#include "svtools/treelistentry.hxx"
#include <com/sun/star/embed/StorageFactory.hpp>
+#include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp>
#include <sal/macros.h>
@@ -77,7 +78,6 @@ using namespace com::sun::star;
//-----------------------------------------------
static ::rtl::OUString SERVICE_UICONFIGMGR (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.UIConfigurationManager" ));
static ::rtl::OUString SERVICE_DESKTOP (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop" ));
-static ::rtl::OUString SERVICE_GLOBALACCCFG (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.GlobalAcceleratorConfiguration" ));
static ::rtl::OUString MODULEPROP_SHORTNAME (RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryShortName" ));
static ::rtl::OUString MODULEPROP_UINAME (RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryUIName" ));
@@ -852,7 +852,7 @@ void SfxAcceleratorConfigPage::InitAccCfg()
m_sModuleUIName = lModuleProps.getUnpackedValueOrDefault(MODULEPROP_UINAME , ::rtl::OUString());
// get global accelerator configuration
- m_xGlobal = css::uno::Reference< css::ui::XAcceleratorConfiguration >(m_xSMGR->createInstance(SERVICE_GLOBALACCCFG), css::uno::UNO_QUERY_THROW);
+ m_xGlobal = css::ui::GlobalAcceleratorConfiguration::create(comphelper::getComponentContext(m_xSMGR));
// get module accelerator configuration
diff --git a/framework/inc/services.h b/framework/inc/services.h
index d8f38672d57b..08f406f5c350 100644
--- a/framework/inc/services.h
+++ b/framework/inc/services.h
@@ -65,7 +65,6 @@ namespace framework{
#define SERVICENAME_WINDOWSTATECONFIGURATION DECLARE_ASCII("com.sun.star.ui.WindowStateConfiguration" )
#define SERVICENAME_STARTMODULE DECLARE_ASCII("com.sun.star.frame.StartModule" )
#define SERVICENAME_FRAMECONTROLLER DECLARE_ASCII("com.sun.star.frame.Controller" )
-#define SERVICENAME_GLOBALACCELERATORCONFIGURATION DECLARE_ASCII("com.sun.star.ui.GlobalAcceleratorConfiguration")
#define SERVICENAME_MODULEACCELERATORCONFIGURATION DECLARE_ASCII("com.sun.star.ui.ModuleAcceleratorConfiguration")
#define SERVICENAME_DOCUMENTACCELERATORCONFIGURATION DECLARE_ASCII("com.sun.star.ui.DocumentAcceleratorConfiguration")
#define SERVICENAME_PACKAGESTRUCTURECREATOR DECLARE_ASCII("com.sun.star.embed.PackageStructureCreator" )
diff --git a/framework/source/accelerators/globalacceleratorconfiguration.cxx b/framework/source/accelerators/globalacceleratorconfiguration.cxx
index 66f58e490494..fdc1505c92c3 100644
--- a/framework/source/accelerators/globalacceleratorconfiguration.cxx
+++ b/framework/source/accelerators/globalacceleratorconfiguration.cxx
@@ -53,7 +53,7 @@ DEFINE_XTYPEPROVIDER_2_WITH_BASECLASS(GlobalAcceleratorConfiguration,
DEFINE_XSERVICEINFO_MULTISERVICE(GlobalAcceleratorConfiguration ,
::cppu::OWeakObject ,
- SERVICENAME_GLOBALACCELERATORCONFIGURATION ,
+ DECLARE_ASCII("com.sun.star.ui.GlobalAcceleratorConfiguration"),
IMPLEMENTATIONNAME_GLOBALACCELERATORCONFIGURATION)
DEFINE_INIT_SERVICE(GlobalAcceleratorConfiguration,
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 1ef7dc919dbc..bb83d226f751 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -44,6 +44,7 @@
#include <com/sun/star/frame/XPopupMenuController.hpp>
#include <com/sun/star/frame/XUIControllerRegistration.hpp>
#include <com/sun/star/lang/SystemDependent.hpp>
+#include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp>
#include <com/sun/star/ui/ItemType.hpp>
#include <com/sun/star/ui/ImageType.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -1598,9 +1599,7 @@ void MenuBarManager::RetrieveShortcuts( std::vector< MenuItemHandler* >& aMenuSh
if ( !xGlobalAccelCfg.is() )
{
- xGlobalAccelCfg = Reference< XAcceleratorConfiguration >( getServiceFactory()->createInstance(
- SERVICENAME_GLOBALACCELERATORCONFIGURATION ),
- UNO_QUERY );
+ xGlobalAccelCfg = GlobalAcceleratorConfiguration::create( comphelper::getComponentContext(getServiceFactory()) );
m_xGlobalAcceleratorManager = xGlobalAccelCfg;
}
}
diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx
index 8bb012d9c47d..317b16a54e67 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/awt/MenuItemStyle.hpp>
#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <vcl/svapp.hxx>
@@ -215,9 +216,7 @@ void NewMenuController::setAccelerators( PopupMenu* pPopupMenu )
if ( !xGlobalAccelCfg.is() )
{
- xGlobalAccelCfg = Reference< XAcceleratorConfiguration >( m_xServiceManager->createInstance(
- SERVICENAME_GLOBALACCELERATORCONFIGURATION ),
- UNO_QUERY );
+ xGlobalAccelCfg = GlobalAcceleratorConfiguration::create( comphelper::getComponentContext(m_xServiceManager) );
m_xGlobalAcceleratorManager = xGlobalAccelCfg;
}
}
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 2cd1c12ccabc..cc1bac78414c 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -41,6 +41,7 @@
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
+#include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp>
#include <com/sun/star/ui/XUIElementSettings.hpp>
#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
@@ -2267,9 +2268,7 @@ bool ToolBarManager::RetrieveShortcut( const rtl::OUString& rCommandURL, rtl::OU
if ( !xGlobalAccelCfg.is() )
{
- xGlobalAccelCfg = Reference< XAcceleratorConfiguration >( m_xServiceManager->createInstance(
- SERVICENAME_GLOBALACCELERATORCONFIGURATION ),
- UNO_QUERY );
+ xGlobalAccelCfg = GlobalAcceleratorConfiguration::create( comphelper::getComponentContext(m_xServiceManager) );
m_xGlobalAcceleratorManager = xGlobalAccelCfg;
}
}
diff --git a/offapi/com/sun/star/ui/GlobalAcceleratorConfiguration.idl b/offapi/com/sun/star/ui/GlobalAcceleratorConfiguration.idl
index f97186355be7..6a464bde4d04 100644
--- a/offapi/com/sun/star/ui/GlobalAcceleratorConfiguration.idl
+++ b/offapi/com/sun/star/ui/GlobalAcceleratorConfiguration.idl
@@ -27,8 +27,7 @@ module com { module sun { module star { module ui {
@since OOo 2.0
*/
-service GlobalAcceleratorConfiguration : XAcceleratorConfiguration
-{};
+service GlobalAcceleratorConfiguration : XAcceleratorConfiguration;
}; }; }; }; // com.sun.star
diff --git a/svtools/inc/svtools/acceleratorexecute.hxx b/svtools/inc/svtools/acceleratorexecute.hxx
index b3682858e77e..15a7ae4c4683 100644
--- a/svtools/inc/svtools/acceleratorexecute.hxx
+++ b/svtools/inc/svtools/acceleratorexecute.hxx
@@ -25,6 +25,7 @@
#include <vector>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
@@ -201,11 +202,11 @@ class SVT_DLLPUBLIC AcceleratorExecute : private TMutexInit
//---------------------------------------
/** TODO document me */
- static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openGlobalConfig(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
+ static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openGlobalConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext);
//---------------------------------------
/** TODO document me */
- static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openModuleConfig(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
+ static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openModuleConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext ,
const css::uno::Reference< css::frame::XFrame >& xFrame);
//---------------------------------------
diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx
index 144a211f25f4..ea21f8640d9c 100644
--- a/svtools/source/misc/acceleratorexecute.cxx
+++ b/svtools/source/misc/acceleratorexecute.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp>
#include <com/sun/star/ui/XUIConfigurationManager.hpp>
#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
@@ -142,11 +143,11 @@ void AcceleratorExecute::init(const css::uno::Reference< css::lang::XMultiServic
css::uno::Reference< css::ui::XAcceleratorConfiguration > xDocCfg ;
// global cfg
- xGlobalCfg = AcceleratorExecute::st_openGlobalConfig(xSMGR);
+ xGlobalCfg = css::ui::GlobalAcceleratorConfiguration::create(comphelper::getComponentContext(xSMGR));
if (!bDesktopIsUsed)
{
// module cfg
- xModuleCfg = AcceleratorExecute::st_openModuleConfig(xSMGR, xEnv);
+ xModuleCfg = AcceleratorExecute::st_openModuleConfig(comphelper::getComponentContext(xSMGR), xEnv);
// doc cfg
css::uno::Reference< css::frame::XController > xController;
@@ -365,20 +366,11 @@ KeyCode AcceleratorExecute::st_AWTKey2VCLKey(const css::awt::KeyEvent& aAWTKey)
}
//-----------------------------------------------
-css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st_openGlobalConfig(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
-{
- css::uno::Reference< css::ui::XAcceleratorConfiguration > xAccCfg(
- xSMGR->createInstance(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.GlobalAcceleratorConfiguration" ))),
- css::uno::UNO_QUERY_THROW);
- return xAccCfg;
-}
-
-//-----------------------------------------------
-css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st_openModuleConfig(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
+css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st_openModuleConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::uno::Reference< css::frame::XFrame >& xFrame)
{
css::uno::Reference< css::frame::XModuleManager2 > xModuleDetection(
- css::frame::ModuleManager::create(comphelper::getComponentContext(xSMGR)));
+ css::frame::ModuleManager::create(rxContext));
::rtl::OUString sModule;
try
@@ -391,7 +383,7 @@ css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st
{ return css::uno::Reference< css::ui::XAcceleratorConfiguration >(); }
css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xUISupplier(
- css::ui::ModuleUIConfigurationManagerSupplier::create(comphelper::getComponentContext(xSMGR)) );
+ css::ui::ModuleUIConfigurationManagerSupplier::create(rxContext) );
css::uno::Reference< css::ui::XAcceleratorConfiguration > xAccCfg;
try