summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-01 15:15:25 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-06-06 10:53:34 +0200
commit0fcd1a73f0e1ec564f3c6da1ccd890183d3c18db (patch)
tree3895ecd6f804b8f3ef3a8f03f1739e17918feeef /desktop
parent8a95074eaefd01621dc55db8567b19c8e6157f95 (diff)
fdo#46808, Adapt UNO services to new style, Part 7, updating ::create
Update code to use factory method URLTransformer::create Change-Id: I3fd2e838497bcfd8fc949615c0e7d60a6ea47118 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, added some tweaks.
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/app.cxx19
-rw-r--r--desktop/source/app/dispatchwatcher.cxx5
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx4
3 files changed, 13 insertions, 15 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 7f037c11a7e7..7374ea322f2e 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -50,6 +50,7 @@
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/view/XPrintable.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
+#include "com/sun/star/util/URLTransformer.hpp"
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
@@ -1186,20 +1187,18 @@ sal_Bool impl_callRecoveryUI(sal_Bool bEmergencySave ,
sal_Bool bExistsRecoveryData)
{
static ::rtl::OUString SERVICENAME_RECOVERYUI("com.sun.star.comp.svx.RecoveryUI");
- static ::rtl::OUString SERVICENAME_URLPARSER("com.sun.star.util.URLTransformer");
static ::rtl::OUString COMMAND_EMERGENCYSAVE("vnd.sun.star.autorecovery:/doEmergencySave");
static ::rtl::OUString COMMAND_RECOVERY("vnd.sun.star.autorecovery:/doAutoRecovery");
static ::rtl::OUString COMMAND_CRASHREPORT("vnd.sun.star.autorecovery:/doCrashReport");
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
- css::uno::Reference< css::frame::XSynchronousDispatch > xRecoveryUI(
+ Reference< css::frame::XSynchronousDispatch > xRecoveryUI(
xSMGR->createInstance(SERVICENAME_RECOVERYUI),
css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::util::XURLTransformer > xURLParser(
- xSMGR->createInstance(SERVICENAME_URLPARSER),
- css::uno::UNO_QUERY_THROW);
+ Reference< css::util::XURLTransformer > xURLParser(
+ css::util::URLTransformer::create(::comphelper::getProcessComponentContext()) );
css::util::URL aURL;
if (bEmergencySave)
@@ -2459,9 +2458,7 @@ void Desktop::OpenClients()
::comphelper::getProcessServiceFactory()->createInstance( OUString("com.sun.star.frame.AutoRecovery") ),
::com::sun::star::uno::UNO_QUERY_THROW );
- Reference< XURLTransformer > xParser(
- ::comphelper::getProcessServiceFactory()->createInstance( OUString("com.sun.star.util.URLTransformer") ),
- ::com::sun::star::uno::UNO_QUERY_THROW );
+ Reference< css::util::XURLTransformer > xParser( css::util::URLTransformer::create(::comphelper::getProcessComponentContext()) );
css::util::URL aCmd;
aCmd.Complete = ::rtl::OUString("vnd.sun.star.autorecovery:/disableRecovery");
@@ -2886,9 +2883,9 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
// The user will try it again, in case nothing happens .-)
try
{
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
+ Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
- com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >
+ Reference< css::frame::XDispatchProvider >
xDesktop( xSMGR->createInstance( OUString("com.sun.star.frame.Desktop") ),
::com::sun::star::uno::UNO_QUERY );
@@ -2896,7 +2893,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
if ( ! xDesktop.is())
return;
- css::uno::Reference< css::util::XURLTransformer > xParser(xSMGR->createInstance(rtl::OUString("com.sun.star.util.URLTransformer")), css::uno::UNO_QUERY_THROW);
+ Reference< css::util::XURLTransformer > xParser( css::util::URLTransformer::create(::comphelper::getProcessComponentContext()) );
css::util::URL aCommand;
if( rAppEvent.GetData() == ::rtl::OUString("PREFERENCES") )
aCommand.Complete = rtl::OUString( ".uno:OptionsTreeDialog" );
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index 7536a90c607e..b2c817d71e3f 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -51,6 +51,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/view/XPrintable.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/document/MacroExecMode.hpp>
#include <com/sun/star/document/UpdateDocMode.hpp>
@@ -284,7 +285,7 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
Reference < XDispatch > xDispatcher ;
Reference < XDispatchProvider > xProvider ( xDesktop, UNO_QUERY );
- Reference < XURLTransformer > xParser ( ::comphelper::getProcessServiceFactory()->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer")) ), ::com::sun::star::uno::UNO_QUERY );
+ Reference < XURLTransformer > xParser ( URLTransformer::create(::comphelper::getProcessComponentContext()) );
if( xParser.is() == sal_True )
xParser->parseStrict( aURL );
@@ -314,7 +315,7 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
Reference < XDispatch > xDispatcher ;
Reference < XDispatchProvider > xProvider ( xDesktop, UNO_QUERY );
- Reference < XURLTransformer > xParser ( ::comphelper::getProcessServiceFactory()->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer")) ), ::com::sun::star::uno::UNO_QUERY );
+ Reference < XURLTransformer > xParser ( URLTransformer::create(::comphelper::getProcessComponentContext()) );
if( xParser.is() == sal_True )
xParser->parseStrict( aURL );
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index f7dbd0405560..6704da10192b 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -79,6 +79,7 @@
#include "com/sun/star/uno/XInterface.hpp"
#include "com/sun/star/util/URL.hpp"
#include "com/sun/star/util/XChangesBatch.hpp"
+#include "com/sun/star/util/URLTransformer.hpp"
#include "com/sun/star/util/XURLTransformer.hpp"
#include "com/sun/star/xml/dom/XElement.hpp"
#include "com/sun/star/xml/dom/XNode.hpp"
@@ -859,8 +860,7 @@ void UpdateDialog::createNotifyJob( bool bPrepareOnly,
xNameAccess->getByName(OUSTR("URL")) >>= aURL.Complete;
uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- uno::Reference < util::XURLTransformer > xTransformer( xFactory->createInstance( OUSTR( "com.sun.star.util.URLTransformer" ) ),
- uno::UNO_QUERY_THROW );
+ uno::Reference < util::XURLTransformer > xTransformer( util::URLTransformer::create(::comphelper::getProcessComponentContext()) );
xTransformer->parseStrict(aURL);