diff options
author | Noel Grandin <noel@peralex.com> | 2012-12-14 12:58:00 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2012-12-21 10:57:09 +0200 |
commit | bb121c864cc3c101ef733a4088c7ba3e36eced14 (patch) | |
tree | 2d528ca830aace6e563b7cdc93eb8f8d6c4f70cf /sd | |
parent | 6d818ed651aaafcfb12ebc21449d35947d2e85a9 (diff) |
fdo#46808, Convert frame::Desktop to new style service.
I had to drop XEventBroadcaster from the merged interface
because it introduced method name conflicts (addEventListener).
Shouldn't be an issue since it was scheduled to be dropped anyhow,
and the service implementation still implements it, so existing clients
will be fine.
I dropped the interface XPropertySet from the combined IDL because nobody
seems to be using it, and it's primary purpose appears to be to set weird
flags.
I dropped the optional interfaces
XStatusIndicatorFactory
XDispatchInformationProvider
from the combined IDL because the service does not implement them, and
nobody seems to be using them. I suspect they were mistakenly copied
from XFrame.
I also did not convert the Title, UserDefinedAttributes and LayoutManager
properties to attributes, again because no-one is using them.
Change-Id: I678a00006ed2cca2d6c37c4e39465811442c33af
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/dlg/sdtreelb.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/dlg/tpoption.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/remotecontrol/Communicator.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/remotecontrol/Receiver.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/toolpanel/controls/MasterPageContainer.cxx | 8 |
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"); |