diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-01 15:15:25 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-06-06 10:53:34 +0200 |
commit | 0fcd1a73f0e1ec564f3c6da1ccd890183d3c18db (patch) | |
tree | 3895ecd6f804b8f3ef3a8f03f1739e17918feeef /extensions | |
parent | fdo#46808, Adapt UNO services to new style, Part 7, updating ::create (diff) | |
download | core-0fcd1a73f0e1ec564f3c6da1ccd890183d3c18db.tar.gz core-0fcd1a73f0e1ec564f3c6da1ccd890183d3c18db.zip |
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 'extensions')
-rw-r--r-- | extensions/source/bibliography/toolbar.cxx | 9 | ||||
-rw-r--r-- | extensions/source/propctrlr/genericpropertyhandler.cxx | 3 | ||||
-rw-r--r-- | extensions/source/propctrlr/unourl.cxx | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx index b1607395b4d9..152a41b23355 100644 --- a/extensions/source/bibliography/toolbar.cxx +++ b/extensions/source/bibliography/toolbar.cxx @@ -29,6 +29,7 @@ #include <comphelper/processfactory.hxx> #include <com/sun/star/frame/XDispatch.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/frame/FrameSearchFlag.hpp> #include <datman.hxx> @@ -261,10 +262,8 @@ void BibToolBar::InitListener() { sal_uInt16 nCount=GetItemCount(); - uno::Reference< lang::XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory(); uno::Reference< frame::XDispatch > xDisp(xController,UNO_QUERY); - - uno::Reference< util::XURLTransformer > xTrans ( xMgr->createInstance( C2U("com.sun.star.util.URLTransformer") ), UNO_QUERY ); + uno::Reference< util::XURLTransformer > xTrans( util::URLTransformer::create(comphelper::getProcessComponentContext()) ); if( xTrans.is() ) { util::URL aQueryURL; @@ -345,9 +344,7 @@ void BibToolBar::SendDispatch(sal_uInt16 nId, const Sequence< PropertyValue >& r if( xDSP.is() && !aCommand.isEmpty()) { - uno::Reference< lang::XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory(); - - uno::Reference< util::XURLTransformer > xTrans ( xMgr->createInstance( C2U("com.sun.star.util.URLTransformer") ), UNO_QUERY ); + uno::Reference< util::XURLTransformer > xTrans( util::URLTransformer::create(comphelper::getProcessComponentContext()) ); if( xTrans.is() ) { // Datei laden diff --git a/extensions/source/propctrlr/genericpropertyhandler.cxx b/extensions/source/propctrlr/genericpropertyhandler.cxx index f593fa0f76d5..5389c9b47a8d 100644 --- a/extensions/source/propctrlr/genericpropertyhandler.cxx +++ b/extensions/source/propctrlr/genericpropertyhandler.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/inspection/PropertyControlType.hpp> #include <com/sun/star/inspection/XHyperlinkControl.hpp> #include <com/sun/star/awt/XActionListener.hpp> +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> /** === end UNO includes === **/ @@ -290,7 +291,7 @@ namespace pcr //-------------------------------------------------------------------- void UrlClickHandler::impl_dispatch_throw( const ::rtl::OUString& _rURL ) { - Reference< XURLTransformer > xTransformer( m_aContext.createComponent( "com.sun.star.util.URLTransformer" ), UNO_QUERY_THROW ); + Reference< XURLTransformer > xTransformer( URLTransformer::create(m_aContext.getUNOContext()) ); URL aURL; aURL.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:OpenHyperlink" ) ); xTransformer->parseStrict( aURL ); diff --git a/extensions/source/propctrlr/unourl.cxx b/extensions/source/propctrlr/unourl.cxx index 946091e2c4dc..b0c02f7861c4 100644 --- a/extensions/source/propctrlr/unourl.cxx +++ b/extensions/source/propctrlr/unourl.cxx @@ -27,7 +27,9 @@ ************************************************************************/ #include "unourl.hxx" +#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> +#include <comphelper/componentcontext.hxx> //........................................................................ namespace pcr @@ -51,7 +53,7 @@ namespace pcr { if ( _rxORB.is() ) { - xTransform = xTransform.query( _rxORB->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ) ) ) ); + xTransform.set( URLTransformer::create(comphelper::ComponentContext(_rxORB).getUNOContext()) ); OSL_ENSURE( xTransform.is(), "UnoURL::UnoURL: could not create an URL transformer!" ); if ( xTransform.is() ) xTransform->parseStrict( m_aURL ); |