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 /svx | |
parent | Updated core (diff) | |
download | core-bb121c864cc3c101ef733a4088c7ba3e36eced14.tar.gz core-bb121c864cc3c101ef733a4088c7ba3e36eced14.zip |
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 'svx')
-rw-r--r-- | svx/source/inc/docrecovery.hxx | 1 | ||||
-rw-r--r-- | svx/source/inc/recoveryui.hxx | 5 | ||||
-rw-r--r-- | svx/source/unodraw/recoveryui.cxx | 17 |
3 files changed, 10 insertions, 13 deletions
diff --git a/svx/source/inc/docrecovery.hxx b/svx/source/inc/docrecovery.hxx index f3e47e0cbc89..e4f7acd6a335 100644 --- a/svx/source/inc/docrecovery.hxx +++ b/svx/source/inc/docrecovery.hxx @@ -51,7 +51,6 @@ #define RECOVERY_CMD_DO_ENTRY_CLEANUP rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.autorecovery:/doEntryCleanUp" )) #define SERVICENAME_PROGRESSFACTORY rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.StatusIndicatorFactory")) -#define SERVICENAME_DESKTOP rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" )) #define PROP_PARENTWINDOW rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Window" )) #define PROP_STATUSINDICATOR rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "StatusIndicator" )) diff --git a/svx/source/inc/recoveryui.hxx b/svx/source/inc/recoveryui.hxx index c94271774b37..33c5e431cc2a 100644 --- a/svx/source/inc/recoveryui.hxx +++ b/svx/source/inc/recoveryui.hxx @@ -20,7 +20,6 @@ #ifndef _RECOVERYUI_HXX #define _RECOVERYUI_HXX -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/frame/XSynchronousDispatch.hpp> #include <com/sun/star/task/XStatusIndicatorFactory.hpp> @@ -56,7 +55,7 @@ class RecoveryUI : public ::cppu::WeakImplHelper2< css::lang::XServiceInfo private: /** @short TODO */ - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > m_xContext; /** @short TODO */ Window* m_pParentWindow; @@ -73,7 +72,7 @@ class RecoveryUI : public ::cppu::WeakImplHelper2< css::lang::XServiceInfo //--------------------------------------- /** @short TODO */ - RecoveryUI(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); + RecoveryUI(const css::uno::Reference< css::uno::XComponentContext >& xContext); //--------------------------------------- /** @short TODO */ diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx index c3e7c45be034..0c6ae0de7c4e 100644 --- a/svx/source/unodraw/recoveryui.cxx +++ b/svx/source/unodraw/recoveryui.cxx @@ -20,6 +20,7 @@ #include "recoveryui.hxx" #include "docrecovery.hxx" #include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XFramesSupplier.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <osl/file.hxx> @@ -45,8 +46,8 @@ using namespace ::rtl; using namespace ::osl; //=============================================== -RecoveryUI::RecoveryUI(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) - : m_xSMGR (xSMGR ) +RecoveryUI::RecoveryUI(const css::uno::Reference< css::uno::XComponentContext >& xContext) + : m_xContext (xContext ) , m_pParentWindow(0 ) , m_eJob (RecoveryUI::E_JOB_UNKNOWN) { @@ -164,7 +165,7 @@ css::uno::Sequence< ::rtl::OUString > RecoveryUI::st_getSupportedServiceNames() //=============================================== css::uno::Reference< css::uno::XInterface > SAL_CALL RecoveryUI::st_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) { - RecoveryUI* pNew = new RecoveryUI(xSMGR); + RecoveryUI* pNew = new RecoveryUI(comphelper::getComponentContext(xSMGR)); return css::uno::Reference< css::uno::XInterface >(static_cast< css::lang::XServiceInfo* >(pNew)); } @@ -252,7 +253,7 @@ RecoveryUI::EJob RecoveryUI::impl_classifyJob(const css::util::URL& aURL) sal_Bool RecoveryUI::impl_doEmergencySave() { // create core service, which implements the real "emergency save" algorithm. - svxdr::RecoveryCore* pCore = new svxdr::RecoveryCore(comphelper::getComponentContext(m_xSMGR), sal_True); + svxdr::RecoveryCore* pCore = new svxdr::RecoveryCore(m_xContext, sal_True); css::uno::Reference< css::frame::XStatusListener > xCore(pCore); // create all needed dialogs for this operation @@ -281,7 +282,7 @@ void RecoveryUI::impl_doRecovery() sal_Bool bCrashRepEnabled(sal_False); css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey( - comphelper::getComponentContext(m_xSMGR), + m_xContext, CFG_PACKAGE_RECOVERY, CFG_PATH_CRASHREPORTER, CFG_ENTRY_ENABLED, @@ -290,7 +291,7 @@ void RecoveryUI::impl_doRecovery() bRecoveryOnly = !bCrashRepEnabled; // create core service, which implements the real "emergency save" algorithm. - svxdr::RecoveryCore* pCore = new svxdr::RecoveryCore(comphelper::getComponentContext(m_xSMGR), sal_False); + svxdr::RecoveryCore* pCore = new svxdr::RecoveryCore(m_xContext, sal_False); css::uno::Reference< css::frame::XStatusListener > xCore(pCore); // create all needed dialogs for this operation @@ -347,9 +348,7 @@ void RecoveryUI::impl_doCrashReport() //=============================================== void RecoveryUI::impl_showAllRecoveredDocs() { - css::uno::Reference< css::frame::XFramesSupplier > xDesktop( - m_xSMGR->createInstance(SERVICENAME_DESKTOP), - css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( m_xContext ); css::uno::Reference< css::container::XIndexAccess > xTaskContainer( xDesktop->getFrames(), |