summaryrefslogtreecommitdiff
path: root/svx
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 /svx
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 'svx')
-rw-r--r--svx/source/dialog/docrecovery.cxx8
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx7
-rw-r--r--svx/source/fmcomp/fmgridif.cxx12
-rw-r--r--svx/source/form/fmtextcontrolshell.cxx4
-rw-r--r--svx/source/inc/docrecovery.hxx1
-rw-r--r--svx/source/tbxctrls/layctrl.cxx5
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx26
7 files changed, 28 insertions, 35 deletions
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index 4c0c96ab1eff..a7e09d212189 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -34,6 +34,7 @@
#include "docrecovery.hxx"
#include "docrecovery.hrc"
+#include <comphelper/componentcontext.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/configurationhelper.hxx>
@@ -56,6 +57,7 @@
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <osl/file.hxx>
#include <osl/security.hxx>
#include <rtl/bootstrap.hxx>
@@ -583,7 +585,7 @@ void RecoveryCore::impl_startListening()
aURL.Complete = RECOVERY_CMD_DO_EMERGENCY_SAVE;
else
aURL.Complete = RECOVERY_CMD_DO_RECOVERY;
- css::uno::Reference< css::util::XURLTransformer > xParser(m_xSMGR->createInstance(SERVICENAME_URLTRANSFORMER), css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(::comphelper::ComponentContext(m_xSMGR).getUNOContext()));
xParser->parseStrict(aURL);
/* Note: addStatusListener() call us synchronous back ... so we
@@ -603,7 +605,7 @@ void RecoveryCore::impl_stopListening()
aURL.Complete = RECOVERY_CMD_DO_EMERGENCY_SAVE;
else
aURL.Complete = RECOVERY_CMD_DO_RECOVERY;
- css::uno::Reference< css::util::XURLTransformer > xParser(m_xSMGR->createInstance(SERVICENAME_URLTRANSFORMER), css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(::comphelper::ComponentContext(m_xSMGR).getUNOContext()));
xParser->parseStrict(aURL);
m_xRealCore->removeStatusListener(static_cast< css::frame::XStatusListener* >(this), aURL);
@@ -616,7 +618,7 @@ css::util::URL RecoveryCore::impl_getParsedURL(const ::rtl::OUString& sURL)
css::util::URL aURL;
aURL.Complete = sURL;
- css::uno::Reference< css::util::XURLTransformer > xParser(m_xSMGR->createInstance(SERVICENAME_URLTRANSFORMER), css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(::comphelper::ComponentContext(m_xSMGR).getUNOContext()));
xParser->parseStrict(aURL);
return aURL;
diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index 4d387b0458ac..c4119fd1fbc2 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -60,6 +60,7 @@
#include <com/sun/star/uno/XNamingService.hpp>
#include <com/sun/star/util/XNumberFormats.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <svl/svstdarr.hxx>
@@ -1161,10 +1162,8 @@ void FmGridControl::DeleteSelectedRows()
aUrl.Complete = FMURL_CONFIRM_DELETION;
// #100312# ------------
Reference< ::com::sun::star::util::XURLTransformer > xTransformer(
- ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY);
- if( xTransformer.is() )
- xTransformer->parseStrict( aUrl );
+ ::com::sun::star::util::URLTransformer::create(::comphelper::getProcessComponentContext()) );
+ xTransformer->parseStrict( aUrl );
Reference< ::com::sun::star::frame::XDispatch > xDispatch = xDispatcher->queryDispatch(aUrl, rtl::OUString(), 0);
Reference< ::com::sun::star::form::XConfirmDeleteListener > xConfirm(xDispatch, UNO_QUERY);
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index ae3d0b0fae33..a19ecc49fd61 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -48,6 +48,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/sdbc/ResultSetType.hpp>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/sdbcx/XRowLocate.hpp>
@@ -2794,15 +2795,10 @@ Sequence< ::com::sun::star::util::URL>& FmXGridPeer::getSupportedURLs()
// let an ::com::sun::star::util::URL-transformer normalize the URLs
Reference< ::com::sun::star::util::XURLTransformer > xTransformer(
- ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString("com.sun.star.util.URLTransformer")),
- UNO_QUERY);
+ util::URLTransformer::create(::comphelper::getProcessComponentContext()) );
pSupported = aSupported.getArray();
- if (xTransformer.is())
- {
- for (i=0; i<aSupported.getLength(); ++i)
- xTransformer->parseStrict(pSupported[i]);
- }
+ for (i=0; i<aSupported.getLength(); ++i)
+ xTransformer->parseStrict(pSupported[i]);
}
return aSupported;
diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx
index 154ebe5215a7..4ffc6f89704b 100644
--- a/svx/source/form/fmtextcontrolshell.cxx
+++ b/svx/source/form/fmtextcontrolshell.cxx
@@ -49,6 +49,7 @@
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/awt/XFocusListener.hpp>
#include <com/sun/star/awt/XMouseListener.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
/** === end UNO includes === **/
#include <comphelper/componentcontext.hxx>
@@ -1316,8 +1317,7 @@ namespace svx
{
if ( !m_xURLTransformer.is() )
{
- ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
- aContext.createComponent( "com.sun.star.util.URLTransformer", m_xURLTransformer );
+ m_xURLTransformer = util::URLTransformer::create( ::comphelper::getProcessComponentContext() );
}
if ( m_xURLTransformer.is() )
m_xURLTransformer->parseStrict( _rURL );
diff --git a/svx/source/inc/docrecovery.hxx b/svx/source/inc/docrecovery.hxx
index 1159f0153056..1daee038f223 100644
--- a/svx/source/inc/docrecovery.hxx
+++ b/svx/source/inc/docrecovery.hxx
@@ -61,7 +61,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_URLTRANSFORMER rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))
#define SERVICENAME_RECOVERYCORE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.AutoRecovery" ))
#define SERVICENAME_FOLDERPICKER rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FolderPicker" ))
#define SERVICENAME_DESKTOP rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))
diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index b723139efe37..68b4e214ec9c 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -42,6 +42,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#include <svtools/colorcfg.hxx>
+#include <com/sun/star/util/URLTransformer.hpp>
// namespaces
using namespace ::com::sun::star::uno;
@@ -377,9 +378,7 @@ void TableWindow::TableDialog( const Sequence< PropertyValue >& rArgs )
if ( xDispatchProvider.is() )
{
com::sun::star::util::URL aTargetURL;
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString("com.sun.star.util.URLTransformer")),
- UNO_QUERY );
+ Reference < XURLTransformer > xTrans( URLTransformer::create(::comphelper::getProcessComponentContext()) );
aTargetURL.Complete = maCommand;
xTrans->parseStrict( aTargetURL );
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 5fddc89c48a5..e58bd7fa5d69 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -31,11 +31,13 @@
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
+#include <comphelper/componentcontext.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/ui/XUIElement.hpp>
#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/toolbox.hxx>
@@ -56,25 +58,21 @@ static const char COMMAND_DOWNSEARCH[] = ".uno:DownSearch";
static const char COMMAND_UPSEARCH[] = ".uno:UpSearch";
static const char COMMAND_APPENDSEARCHHISTORY[] = "AppendSearchHistory";
-static const char SERVICENAME_URLTRANSFORMER[] = "com.sun.star.util.URLTransformer";
static const sal_Int32 REMEMBER_SIZE = 10;
void impl_executeSearch( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr, const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Sequence< css::beans::PropertyValue >& lArgs )
{
- css::uno::Reference< css::util::XURLTransformer > xURLTransformer( rSMgr->createInstance(rtl::OUString(SERVICENAME_URLTRANSFORMER)), css::uno::UNO_QUERY );
- if ( xURLTransformer.is() )
- {
- css::util::URL aURL;
- aURL.Complete = rtl::OUString(COMMAND_EXECUTESEARCH);
- xURLTransformer->parseStrict(aURL);
+ css::uno::Reference< css::util::XURLTransformer > xURLTransformer( css::util::URLTransformer::create(::comphelper::ComponentContext(rSMgr).getUNOContext()) );
+ css::util::URL aURL;
+ aURL.Complete = rtl::OUString(COMMAND_EXECUTESEARCH);
+ xURLTransformer->parseStrict(aURL);
- css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider(xFrame, css::uno::UNO_QUERY);
- if ( xDispatchProvider.is() )
- {
- css::uno::Reference< css::frame::XDispatch > xDispatch = xDispatchProvider->queryDispatch( aURL, ::rtl::OUString(), 0 );
- if ( xDispatch.is() && !aURL.Complete.isEmpty() )
- xDispatch->dispatch( aURL, lArgs );
- }
+ css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider(xFrame, css::uno::UNO_QUERY);
+ if ( xDispatchProvider.is() )
+ {
+ css::uno::Reference< css::frame::XDispatch > xDispatch = xDispatchProvider->queryDispatch( aURL, ::rtl::OUString(), 0 );
+ if ( xDispatch.is() && !aURL.Complete.isEmpty() )
+ xDispatch->dispatch( aURL, lArgs );
}
}