summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx12
-rw-r--r--sd/source/ui/dlg/tpoption.cxx12
-rw-r--r--sd/source/ui/remotecontrol/Communicator.cxx6
-rw-r--r--sd/source/ui/remotecontrol/Receiver.cxx6
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPageContainer.cxx8
5 files changed, 13 insertions, 31 deletions
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 45155eeae38f..902001c76ecb 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -47,7 +47,7 @@
#include "ViewShellBase.hxx"
#include <com/sun/star/embed/XEmbedPersist.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/XFramesSupplier.hpp>
#include <svtools/embedtransfer.hxx>
#include "svtools/treelistentry.hxx"
@@ -1383,15 +1383,9 @@ void SdPageObjsTLB::AddShapeToTransferable (
try
{
// Get a component enumeration from the desktop and search it for documents.
- uno::Reference<lang::XMultiServiceFactory> xFactory (
- ::comphelper::getProcessServiceFactory ());
- if ( ! xFactory.is())
- return NULL;
+ uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext());
- uno::Reference<frame::XDesktop> xDesktop (xFactory->createInstance (
- ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), uno::UNO_QUERY);
- if ( ! xDesktop.is())
- return NULL;
+ uno::Reference<frame::XDesktop2> xDesktop = frame::Desktop::create(xContext);
uno::Reference<frame::XFramesSupplier> xFrameSupplier (xDesktop, uno::UNO_QUERY);
if ( ! xFrameSupplier.is())
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index 8e819662efee..ecb7d9efa5e6 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -24,7 +24,7 @@
#include <com/sun/star/document/PrinterIndependentLayout.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <comphelper/processfactory.hxx>
@@ -721,16 +721,10 @@ void SdTpOptionsMisc::UpdateCompatibilityControls (void)
try
{
// Get a component enumeration from the desktop and search it for documents.
- Reference<lang::XMultiServiceFactory> xFactory (
- ::comphelper::getProcessServiceFactory ());
+ Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext());
do
{
- if ( ! xFactory.is())
- break;
-
- Reference<frame::XDesktop> xDesktop (xFactory->createInstance ("com.sun.star.frame.Desktop"), UNO_QUERY);
- if ( ! xDesktop.is())
- break;
+ Reference<frame::XDesktop2> xDesktop = frame::Desktop::create(xContext);
Reference<container::XEnumerationAccess> xComponents (
xDesktop->getComponents(), UNO_QUERY);
diff --git a/sd/source/ui/remotecontrol/Communicator.cxx b/sd/source/ui/remotecontrol/Communicator.cxx
index f567b106ff8d..ebe5627e2442 100644
--- a/sd/source/ui/remotecontrol/Communicator.cxx
+++ b/sd/source/ui/remotecontrol/Communicator.cxx
@@ -9,6 +9,7 @@
#include <algorithm>
#include <vector>
+#include <com/sun/star/frame/Desktop.hpp>
#include <comphelper/processfactory.hxx>
#include "Communicator.hxx"
@@ -43,10 +44,7 @@ void Communicator::execute()
Transmitter::PRIORITY_HIGH );
Receiver aReceiver( pTransmitter );
try {
- uno::Reference< lang::XMultiServiceFactory > xServiceManager(
- ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
- uno::Reference< frame::XFramesSupplier > xFramesSupplier( xServiceManager->createInstance(
- "com.sun.star.frame.Desktop" ) , uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XDesktop2 > xFramesSupplier = frame::Desktop::create( ::comphelper::getProcessComponentContext() );
uno::Reference< frame::XFrame > xFrame ( xFramesSupplier->getActiveFrame(), uno::UNO_QUERY_THROW );
uno::Reference<presentation::XPresentationSupplier> xPS ( xFrame->getController()->getModel(), uno::UNO_QUERY_THROW);
uno::Reference<presentation::XPresentation2> xPresentation(
diff --git a/sd/source/ui/remotecontrol/Receiver.cxx b/sd/source/ui/remotecontrol/Receiver.cxx
index 968fbb4e4ee7..e0d05b0b09ea 100644
--- a/sd/source/ui/remotecontrol/Receiver.cxx
+++ b/sd/source/ui/remotecontrol/Receiver.cxx
@@ -11,6 +11,7 @@
#include <com/sun/star/presentation/XSlideShowController.hpp>
#include <com/sun/star/presentation/XPresentationSupplier.hpp>
#include <com/sun/star/presentation/XPresentation2.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/XFramesSupplier.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
@@ -41,10 +42,7 @@ void Receiver::parseCommand( std::vector<OString> aCommand )
uno::Reference<presentation::XSlideShowController> xSlideShowController;
uno::Reference<presentation::XPresentation2> xPresentation;
try {
- uno::Reference< lang::XMultiServiceFactory > xServiceManager(
- ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
- uno::Reference< frame::XFramesSupplier > xFramesSupplier( xServiceManager->createInstance(
- "com.sun.star.frame.Desktop" ) , uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XDesktop2 > xFramesSupplier = frame::Desktop::create( ::comphelper::getProcessComponentContext() );
uno::Reference< frame::XFrame > xFrame ( xFramesSupplier->getActiveFrame(), uno::UNO_QUERY_THROW );
uno::Reference<presentation::XPresentationSupplier> xPS ( xFrame->getController()->getModel(), uno::UNO_QUERY_THROW);
xPresentation = uno::Reference<presentation::XPresentation2>(
diff --git a/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx b/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx
index c35e08bc3555..f5bd19d90e52 100644
--- a/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx
+++ b/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx
@@ -31,6 +31,7 @@
#include <set>
#include "unomodel.hxx"
+#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/io/XStream.hpp>
#include <com/sun/star/io/XInputStream.hpp>
@@ -990,11 +991,8 @@ Reference<frame::XModel> MasterPageContainer::Implementation::GetModel (void)
if ( ! mxModel.is())
{
// Get the desktop a s service factory.
- ::rtl::OUString sDesktopServiceName ( "com.sun.star.frame.Desktop");
- uno::Reference<frame::XComponentLoader> xDesktop (
- ::comphelper::getProcessServiceFactory()->createInstance(
- sDesktopServiceName),
- uno::UNO_QUERY);
+ uno::Reference<frame::XDesktop2> xDesktop = frame::Desktop::create(
+ ::comphelper::getProcessComponentContext() );
// Create a new model.
::rtl::OUString sModelServiceName ( "com.sun.star.presentation.PresentationDocument");