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 /sfx2/source/doc | |
parent | 8a95074eaefd01621dc55db8567b19c8e6157f95 (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/source/doc')
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/doc/iframe.cxx | 4 |
2 files changed, 7 insertions, 6 deletions
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); |