summaryrefslogtreecommitdiff
path: root/cui/source/customize
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/customize')
-rw-r--r--cui/source/customize/acccfg.cxx4
-rw-r--r--cui/source/customize/cfg.cxx33
-rw-r--r--cui/source/customize/cfgutil.cxx9
-rw-r--r--cui/source/customize/eventdlg.cxx7
-rw-r--r--cui/source/customize/selector.cxx9
5 files changed, 21 insertions, 41 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index e261ad09a8d6..d9125aff8927 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/frame/Desktop.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 MODULEPROP_SHORTNAME (RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryShortName" ));
static ::rtl::OUString MODULEPROP_UINAME (RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryUIName" ));
@@ -839,7 +839,7 @@ void SfxAcceleratorConfigPage::InitAccCfg()
m_xFrame = GetFrame();
if ( !m_xFrame.is() )
{
- css::uno::Reference< css::frame::XFramesSupplier > xDesktop(m_xSMGR->createInstance(SERVICE_DESKTOP), css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( comphelper::getComponentContext(m_xSMGR) );
m_xFrame = xDesktop->getActiveFrame();
}
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index aadccd82cb94..3b4e49f6f572 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -67,7 +67,7 @@
#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/UICommandDescription.hpp>
#include <com/sun/star/ui/XUIConfiguration.hpp>
#include <com/sun/star/ui/XUIConfigurationListener.hpp>
@@ -760,15 +760,13 @@ SfxTabPage *CreateSvxEventConfigPage( Window *pParent, const SfxItemSet& rSet )
sal_Bool impl_showKeyConfigTabPage( const css::uno::Reference< css::frame::XFrame >& xFrame )
{
- static ::rtl::OUString SERVICENAME_DESKTOP ("com.sun.star.frame.Desktop" );
static ::rtl::OUString MODULEID_STARTMODULE ("com.sun.star.frame.StartModule" );
try
{
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
- css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
- css::uno::Reference< css::frame::XFramesSupplier > xDesktop(xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::frame::XModuleManager2 > xMM (css::frame::ModuleManager::create(xContext));
+ css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+ css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( xContext );
+ css::uno::Reference< css::frame::XModuleManager2 > xMM = css::frame::ModuleManager::create(xContext);
if (xFrame.is())
{
@@ -1650,8 +1648,6 @@ void SvxConfigPage::Reset( const SfxItemSet& )
uno::Reference < css::ui::XUIConfigurationManager > xCfgMgr;
uno::Reference < css::ui::XUIConfigurationManager > xDocCfgMgr;
- uno::Reference< lang::XMultiServiceFactory > xServiceManager(
- ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
uno::Reference< uno::XComponentContext > xContext(
::comphelper::getProcessComponentContext(), uno::UNO_QUERY_THROW );
@@ -1780,10 +1776,8 @@ void SvxConfigPage::Reset( const SfxItemSet& )
uno::Sequence< uno::Reference< frame::XFrame > > aFrameList;
try
{
- uno::Reference< frame::XFramesSupplier > xFramesSupplier(
- xServiceManager->createInstance(
- OUString( "com.sun.star.frame.Desktop" ) ),
- uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XDesktop2 > xFramesSupplier = frame::Desktop::create(
+ xContext );
uno::Reference< frame::XFrames > xFrames =
xFramesSupplier->getFrames();
@@ -1876,20 +1870,17 @@ void SvxConfigPage::Reset( const SfxItemSet& )
::rtl::OUString sModuleID;
try
{
- uno::Reference< lang::XMultiServiceFactory > xServiceManager(
- ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+ uno::Reference< uno::XComponentContext > xContext(
+ ::comphelper::getProcessComponentContext() );
- uno::Reference< frame::XFramesSupplier > xFramesSupplier(
- xServiceManager->createInstance(
- OUString( "com.sun.star.frame.Desktop" ) ),
- uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create(
+ xContext );
if ( !_inout_rxFrame.is() )
- _inout_rxFrame = xFramesSupplier->getActiveFrame();
+ _inout_rxFrame = xDesktop->getActiveFrame();
if ( !_inout_rxFrame.is() )
{
- uno::Reference< frame::XDesktop > xDesktop( xFramesSupplier, uno::UNO_QUERY_THROW );
_inout_rxFrame = xDesktop->getCurrentFrame();
}
@@ -1903,7 +1894,7 @@ void SvxConfigPage::Reset( const SfxItemSet& )
}
uno::Reference< css::frame::XModuleManager2 > xModuleManager(
- css::frame::ModuleManager::create( comphelper::getComponentContext(xServiceManager) ) );
+ css::frame::ModuleManager::create( xContext ) );
try
{
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 4043252a4967..3b0344c1a3f0 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -30,7 +30,7 @@
#include <com/sun/star/script/browse/XBrowseNodeFactory.hpp>
#include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/container/XEnumeration.hpp>
#include <com/sun/star/document/XScriptInvocationContext.hpp>
@@ -802,12 +802,7 @@ Reference< XInterface >
SfxConfigGroupListBox_Impl::getDocumentModel( Reference< XComponentContext >& xCtx, ::rtl::OUString& docName )
{
Reference< XInterface > xModel;
- Reference< lang::XMultiComponentFactory > mcf =
- xCtx->getServiceManager();
- Reference< frame::XDesktop > desktop (
- mcf->createInstanceWithContext(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop") ), xCtx ),
- UNO_QUERY );
+ Reference< frame::XDesktop2 > desktop = frame::Desktop::create( xCtx );
Reference< container::XEnumerationAccess > componentsAccess =
desktop->getComponents();
diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx
index 8020deb3ecd6..fa994c25cad6 100644
--- a/cui/source/customize/eventdlg.cxx
+++ b/cui/source/customize/eventdlg.cxx
@@ -20,6 +20,7 @@
#include <svtools/svmedit.hxx>
#include <tools/diagnose_ex.h>
#include <com/sun/star/document/XEventsSupplier.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/GlobalEventBroadcaster.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
@@ -179,10 +180,8 @@ IMPL_LINK( SvxEventConfigPage, SelectHdl_Impl, ListBox *, pBox )
{
bool isReadonly = sal_False;
- uno::Reference< frame::XFramesSupplier > xFramesSupplier(
- ::comphelper::getProcessServiceFactory()->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" )) ),
- uno::UNO_QUERY );
+ uno::Reference< frame::XDesktop2 > xFramesSupplier = frame::Desktop::create(
+ ::comphelper::getProcessComponentContext() );
uno::Reference< frame::XFrame > xFrame =
xFramesSupplier->getActiveFrame();
diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx
index dfa8af78f897..658c81a822f4 100644
--- a/cui/source/customize/selector.cxx
+++ b/cui/source/customize/selector.cxx
@@ -44,7 +44,7 @@
#include <com/sun/star/script/browse/XBrowseNodeFactory.hpp>
#include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/container/XEnumeration.hpp>
#include <com/sun/star/document/XEmbeddedScripts.hpp>
@@ -591,12 +591,7 @@ SvxConfigGroupListBox::getDocumentModel(
Reference< XComponentContext >& xCtx, OUString& docName )
{
Reference< XInterface > xModel;
- Reference< lang::XMultiComponentFactory > mcf =
- xCtx->getServiceManager();
- Reference< frame::XDesktop > desktop (
- mcf->createInstanceWithContext(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")), xCtx ),
- UNO_QUERY );
+ Reference< frame::XDesktop2 > desktop = Desktop::create(xCtx);
Reference< container::XEnumerationAccess > componentsAccess =
desktop->getComponents();