summaryrefslogtreecommitdiff
path: root/sfx2
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 /sfx2
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 'sfx2')
-rw-r--r--sfx2/source/appl/appopen.cxx6
-rw-r--r--sfx2/source/appl/newhelp.cxx4
-rw-r--r--sfx2/source/appl/sfxhelp.cxx4
-rw-r--r--sfx2/source/appl/shutdownicon.cxx36
-rw-r--r--sfx2/source/control/bindings.cxx3
-rw-r--r--sfx2/source/control/querystatus.cxx4
-rw-r--r--sfx2/source/control/request.cxx6
-rw-r--r--sfx2/source/control/sfxstatuslistener.cxx4
-rw-r--r--sfx2/source/control/unoctitm.cxx5
-rw-r--r--sfx2/source/dialog/mailmodel.cxx20
-rw-r--r--sfx2/source/doc/guisaveas.cxx9
-rw-r--r--sfx2/source/doc/iframe.cxx4
-rw-r--r--sfx2/source/notify/eventsupplier.cxx8
-rw-r--r--sfx2/source/statbar/stbitem.cxx4
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx11
-rw-r--r--sfx2/source/view/viewfrm.cxx5
16 files changed, 61 insertions, 72 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 3c619e76eee0..31e96945c13d 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -38,6 +38,7 @@
#include <com/sun/star/frame/DispatchResultState.hpp>
#include <com/sun/star/frame/XDispatchResultListener.hpp>
#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/system/SystemShellExecuteException.hpp>
#include <com/sun/star/document/XTypeDetection.hpp>
@@ -936,8 +937,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
::rtl::OUString aTypeName;
aURL.Complete = aFileName;
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString("com.sun.star.util.URLTransformer")), UNO_QUERY );
+ Reference< util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict( aURL );
INetProtocol aINetProtocol = INetURLObject( aURL.Complete ).GetProtocol();
@@ -1209,7 +1209,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
{
URL aURL;
aURL.Complete = aFileName;
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString("com.sun.star.util.URLTransformer")), UNO_QUERY );
+ Reference< util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict( aURL );
Reference < XDispatchProvider > xProv( xTargetFrame, UNO_QUERY );
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index bc7900f29488..1f4c69e2ef5c 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -84,6 +84,7 @@
#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/util/XSearchable.hpp>
#include <com/sun/star/util/XSearchDescriptor.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/view/XViewSettingsSupplier.hpp>
@@ -170,8 +171,7 @@ using namespace ::comphelper;
#define KEY_UI_NAME DEFINE_CONST_OUSTRING("ooSetupFactoryUIName")
#define PARSE_URL( aURL ) \
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( \
- DEFINE_CONST_UNICODE("com.sun.star.util.URLTransformer" )), UNO_QUERY ); \
+ Reference< util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); \
xTrans->parseStrict( aURL )
//.........................................................................
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index cabfc39e8e47..5f6244696eb6 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -39,6 +39,7 @@
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
@@ -839,8 +840,7 @@ void SfxHelp::OpenHelpAgent( const rtl::OString& sHelpId )
{
URL aURL;
aURL.Complete = CreateHelpURL_Impl( rtl::OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), GetHelpModuleName_Impl() );
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString("com.sun.star.util.URLTransformer") ), UNO_QUERY );
+ Reference< XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict(aURL);
Reference < XFrame > xCurrentFrame;
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 391286db89b9..d240f3746ebf 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -39,6 +39,7 @@
#include <com/sun/star/frame/XFramesSupplier.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
@@ -296,27 +297,22 @@ void ShutdownIcon::OpenURL( const ::rtl::OUString& aURL, const ::rtl::OUString&
com::sun::star::util::URL aDispatchURL;
aDispatchURL.Complete = aURL;
- Reference < com::sun::star::util::XURLTransformer > xURLTransformer(
- ::comphelper::getProcessServiceFactory()->createInstance( OUString("com.sun.star.util.URLTransformer") ),
- com::sun::star::uno::UNO_QUERY );
- if ( xURLTransformer.is() )
+ Reference< util::XURLTransformer > xURLTransformer( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
+ try
{
- try
- {
- Reference< com::sun::star::frame::XDispatch > xDispatch;
+ Reference< com::sun::star::frame::XDispatch > xDispatch;
- xURLTransformer->parseStrict( aDispatchURL );
- xDispatch = xDispatchProvider->queryDispatch( aDispatchURL, rTarget, 0 );
- if ( xDispatch.is() )
- xDispatch->dispatch( aDispatchURL, aArgs );
- }
- catch ( com::sun::star::uno::RuntimeException& )
- {
- throw;
- }
- catch ( com::sun::star::uno::Exception& )
- {
- }
+ xURLTransformer->parseStrict( aDispatchURL );
+ xDispatch = xDispatchProvider->queryDispatch( aDispatchURL, rTarget, 0 );
+ if ( xDispatch.is() )
+ xDispatch->dispatch( aDispatchURL, aArgs );
+ }
+ catch ( com::sun::star::uno::RuntimeException& )
+ {
+ throw;
+ }
+ catch ( com::sun::star::uno::Exception& )
+ {
}
}
}
@@ -347,7 +343,7 @@ void ShutdownIcon::FromTemplate()
URL aTargetURL;
aTargetURL.Complete = OUString( "slot:5500" );
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString("com.sun.star.util.URLTransformer")), UNO_QUERY );
+ Reference< util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict( aTargetURL );
Reference < ::com::sun::star::frame::XDispatchProvider > xProv( xFrame, UNO_QUERY );
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index e18b564ad406..442065d4d3c7 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -39,6 +39,7 @@
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
#include <svl/visitem.hxx>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
@@ -2189,7 +2190,7 @@ sal_Bool SfxBindings::ExecuteCommand_Impl( const String& rCommand )
{
::com::sun::star::util::URL aURL;
aURL.Complete = rCommand;
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString("com.sun.star.util.URLTransformer")), UNO_QUERY );
+ Reference< util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict( aURL );
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDisp = pImp->xProv->queryDispatch( aURL, ::rtl::OUString(), 0 );
if ( xDisp.is() )
diff --git a/sfx2/source/control/querystatus.cxx b/sfx2/source/control/querystatus.cxx
index 76f985bdccc1..4c40279578a3 100644
--- a/sfx2/source/control/querystatus.cxx
+++ b/sfx2/source/control/querystatus.cxx
@@ -38,6 +38,7 @@
#include <comphelper/processfactory.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/status/ItemStatus.hpp>
#include <com/sun/star/frame/status/ItemState.hpp>
@@ -95,8 +96,7 @@ SfxQueryStatus_Impl::SfxQueryStatus_Impl( const Reference< XDispatchProvider >&
m_nSlotID( nSlotId )
{
m_aCommand.Complete = rCommand;
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString("com.sun.star.util.URLTransformer")), UNO_QUERY );
+ Reference< XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict( m_aCommand );
if ( rDispatchProvider.is() )
m_xDispatch = rDispatchProvider->queryDispatch( m_aCommand, rtl::OUString(), 0 );
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
index 78f0a7da6bca..296690b54d36 100644
--- a/sfx2/source/control/request.cxx
+++ b/sfx2/source/control/request.cxx
@@ -33,6 +33,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchRecorderSupplier.hpp>
#include <svl/itemiter.hxx>
@@ -40,6 +41,7 @@
#include <svl/itempool.hxx>
#include <svtools/itemdel.hxx>
+#include <comphelper/componentcontext.hxx>
#include <comphelper/processfactory.hxx>
#include <svl/smplhint.hxx>
@@ -373,9 +375,7 @@ void SfxRequest_Impl::Record
::comphelper::getProcessServiceFactory(),
com::sun::star::uno::UNO_QUERY);
- com::sun::star::uno::Reference< com::sun::star::util::XURLTransformer > xTransform(
- xFactory->createInstance(rtl::OUString("com.sun.star.util.URLTransformer")),
- com::sun::star::uno::UNO_QUERY);
+ uno::Reference< util::XURLTransformer > xTransform( util::URLTransformer::create( ::comphelper::ComponentContext(xFactory).getUNOContext() ) );
com::sun::star::util::URL aURL;
aURL.Complete = aCmd;
diff --git a/sfx2/source/control/sfxstatuslistener.cxx b/sfx2/source/control/sfxstatuslistener.cxx
index 8d4d2e58f762..9c580f47fae6 100644
--- a/sfx2/source/control/sfxstatuslistener.cxx
+++ b/sfx2/source/control/sfxstatuslistener.cxx
@@ -38,6 +38,7 @@
#include <comphelper/processfactory.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/frame/status/ItemStatus.hpp>
@@ -66,8 +67,7 @@ SfxStatusListener::SfxStatusListener( const Reference< XDispatchProvider >& rDis
m_xDispatchProvider( rDispatchProvider )
{
m_aCommand.Complete = rCommand;
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString("com.sun.star.util.URLTransformer")), UNO_QUERY );
+ Reference< XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict( m_aCommand );
if ( rDispatchProvider.is() )
m_xDispatch = rDispatchProvider->queryDispatch( m_aCommand, rtl::OUString(), 0 );
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index aa537a6a5304..a738a882e8ac 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -36,6 +36,7 @@
#include <svtools/javacontext.hxx>
#include <svl/itempool.hxx>
#include <tools/urlobj.hxx>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XFrameActionListener.hpp>
@@ -108,7 +109,7 @@ SfxUnoControllerItem::SfxUnoControllerItem( SfxControllerItem *pItem, SfxBinding
DBG_ASSERT( !pCtrlItem || !pCtrlItem->IsBound(), "ControllerItem is incorrect!" );
aCommand.Complete = rCmd;
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString("com.sun.star.util.URLTransformer")), UNO_QUERY );
+ Reference< XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict( aCommand );
pBindings->RegisterUnoController_Impl( this );
}
@@ -464,7 +465,7 @@ SfxDispatchController_Impl::SfxDispatchController_Impl(
rtl::OStringBuffer aTmp(RTL_CONSTASCII_STRINGPARAM(".uno:"));
aTmp.append(pUnoName);
aDispatchURL.Complete = ::rtl::OStringToOUString(aTmp.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US);
- Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString("com.sun.star.util.URLTransformer")), UNO_QUERY );
+ Reference< XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict( aDispatchURL );
}
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index a6362bdb6cd8..8e2c6d8f9f67 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -34,6 +34,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ucb/CommandAbortedException.hpp>
#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/system/XSimpleMailClientSupplier.hpp>
#include <com/sun/star/system/SimpleMailClientFlags.hpp>
@@ -72,6 +73,7 @@
#include <tools/urlobj.hxx>
#include <unotools/useroptions.hxx>
#include <comphelper/extract.hxx>
+#include <comphelper/componentcontext.hxx>
#include <comphelper/mediadescriptor.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/sequenceashashmap.hxx>
@@ -570,20 +572,15 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
css::util::URL aPrepareURL;
css::uno::Reference< css::frame::XDispatch > xPrepareDispatch;
css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( xFrame, css::uno::UNO_QUERY );
- css::uno::Reference< css::util::XURLTransformer > xURLTransformer(
- xSMGR->createInstance( rtl::OUString( "com.sun.star.util.URLTransformer" )),
- css::uno::UNO_QUERY );
+ css::uno::Reference< css::util::XURLTransformer > xURLTransformer( css::util::URLTransformer::create( ::comphelper::ComponentContext(xSMGR).getUNOContext() ) );
if( !bSendAsPDF )
{
try
{
// check if the document needs to be prepared for sending as mail (embedding of links, removal of invisible content)
- if ( xURLTransformer.is() )
- {
- aPrepareURL.Complete = rtl::OUString( ".uno:PrepareMailExport" );
- xURLTransformer->parseStrict( aPrepareURL );
- }
+ aPrepareURL.Complete = rtl::OUString( ".uno:PrepareMailExport" );
+ xURLTransformer->parseStrict( aPrepareURL );
if ( xDispatchProvider.is() )
{
@@ -651,11 +648,8 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
{
css::util::URL aURL;
// #i30432# notify that export is finished - the Writer may want to restore removed content
- if ( xURLTransformer.is() )
- {
- aURL.Complete = rtl::OUString( ".uno:MailExportFinished" );
- xURLTransformer->parseStrict( aURL );
- }
+ aURL.Complete = rtl::OUString( ".uno:MailExportFinished" );
+ xURLTransformer->parseStrict( aURL );
if ( xDispatchProvider.is() )
{
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 3231bdea1a6a..a9fdd5bf673f 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -42,6 +42,7 @@
#include <com/sun/star/document/XDocumentInfo.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/frame/XStorable2.hpp>
@@ -68,6 +69,7 @@
#include <svtools/miscopt.hxx>
#include <tools/debug.hxx>
#include <tools/urlobj.hxx>
+#include <comphelper/componentcontext.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/configurationhelper.hxx>
#include <comphelper/mimeconfighelper.hxx>
@@ -1118,11 +1120,8 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog()
util::URL aURL;
aURL.Complete = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:SetDocumentProperties"));
- uno::Reference< util::XURLTransformer > xTransformer(
- m_pOwner->GetServiceFactory()->createInstance(
- DEFINE_CONST_UNICODE("com.sun.star.util.URLTransformer") ),
- uno::UNO_QUERY );
- if ( xTransformer.is() && xTransformer->parseStrict( aURL ) )
+ uno::Reference < util::XURLTransformer > xTransformer( util::URLTransformer::create( ::comphelper::ComponentContext(m_pOwner->GetServiceFactory()).getUNOContext() ) );
+ if ( xTransformer->parseStrict( aURL ) )
{
uno::Reference< frame::XDispatch > xDispatch = xFrameDispatch->queryDispatch(
aURL,
diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx
index 9d60fb6a8168..8e0a03029013 100644
--- a/sfx2/source/doc/iframe.cxx
+++ b/sfx2/source/doc/iframe.cxx
@@ -33,8 +33,10 @@
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XFramesSupplier.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
+#include <comphelper/componentcontext.hxx>
#include <tools/urlobj.hxx>
#include <tools/debug.hxx>
#include <rtl/ustring.hxx>
@@ -154,7 +156,7 @@ throw( uno::RuntimeException )
util::URL aTargetURL;
aTargetURL.Complete = ::rtl::OUString( maFrmDescr.GetURL().GetMainURL( INetURLObject::NO_DECODE ) );
- uno::Reference < util::XURLTransformer > xTrans( mxFact->createInstance( "com.sun.star.util.URLTransformer"), uno::UNO_QUERY );
+ uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::ComponentContext(mxFact).getUNOContext() ) );
xTrans->parseStrict( aTargetURL );
uno::Sequence < beans::PropertyValue > aProps(2);
diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx
index 039f03dbd3d9..9f617ebfdc84 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <tools/urlobj.hxx>
#include <svl/macitem.hxx>
@@ -239,12 +240,7 @@ static void Execute( ANY& aEventData, const css::document::DocumentEvent& aTrigg
SfxViewFrame::GetFirst( pDoc ) :
SfxViewFrame::Current();
- ::com::sun::star::uno::Reference
- < ::com::sun::star::util::XURLTransformer > xTrans(
- ::comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString(
- "com.sun.star.util.URLTransformer" ) ),
- UNO_QUERY );
+ ::com::sun::star::uno::Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::com::sun::star::util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
::com::sun::star::util::URL aURL;
aURL.Complete = aScript;
diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx
index 7c7254f8f99c..9c993eaea2ad 100644
--- a/sfx2/source/statbar/stbitem.cxx
+++ b/sfx2/source/statbar/stbitem.cxx
@@ -28,6 +28,7 @@
#include <svl/stritem.hxx>
#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
@@ -86,8 +87,7 @@ svt::StatusbarController* SAL_CALL SfxStatusBarControllerFactory(
util::URL aTargetURL;
aTargetURL.Complete = aCommandURL;
- uno::Reference < util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString("com.sun.star.util.URLTransformer")), uno::UNO_QUERY );
+ uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict( aTargetURL );
SfxObjectShell* pObjShell = NULL;
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index d220e71c7770..1e458ed912d3 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -36,6 +36,7 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
@@ -143,7 +144,7 @@ svt::ToolboxController* SAL_CALL SfxToolBoxControllerFactory( const Reference< X
URL aTargetURL;
aTargetURL.Complete = aCommandURL;
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString("com.sun.star.util.URLTransformer")), UNO_QUERY );
+ Reference < XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict( aTargetURL );
if ( !aTargetURL.Arguments.isEmpty() )
return NULL;
@@ -437,9 +438,7 @@ void SfxToolBoxControl::Dispatch(
{
::com::sun::star::util::URL aTargetURL;
aTargetURL.Complete = rCommand;
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString("com.sun.star.util.URLTransformer")),
- UNO_QUERY );
+ Reference < XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict( aTargetURL );
Reference < XDispatch > xDispatch = rProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
@@ -1650,9 +1649,7 @@ long Select_Impl( void* /*pHdl*/, void* pVoid )
URL aTargetURL;
aTargetURL.Complete = aURL;
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString("com.sun.star.util.URLTransformer")),
- UNO_QUERY );
+ Reference < XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict( aTargetURL );
Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY );
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 72da247620a9..09351f11f48a 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -58,6 +58,7 @@
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XModel2.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/XDispatchRecorderSupplier.hpp>
@@ -3150,7 +3151,9 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest &rReq )
{
::com::sun::star::util::URL aTargetURL;
aTargetURL.Complete = ::rtl::OUString(".component:DB/DataSourceBrowser");
- Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString("com.sun.star.util.URLTransformer")), UNO_QUERY );
+ Reference < ::com::sun::star::util::XURLTransformer > xTrans(
+ ::com::sun::star::util::URLTransformer::create(
+ ::comphelper::getProcessComponentContext() ) );
xTrans->parseStrict( aTargetURL );
Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY );