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 /embedserv/source | |
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 'embedserv/source')
-rw-r--r-- | embedserv/source/embed/ed_ipersiststr.cxx | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/embedserv/source/embed/ed_ipersiststr.cxx b/embedserv/source/embed/ed_ipersiststr.cxx index 8eadce0a9158..72153757fc22 100644 --- a/embedserv/source/embed/ed_ipersiststr.cxx +++ b/embedserv/source/embed/ed_ipersiststr.cxx @@ -42,9 +42,10 @@ #include <com/sun/star/util/XModifiable.hpp> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> -#include <com/sun/star/util/XUrlTransformer.hpp> - +#include <com/sun/star/util/URLTransformer.hpp> +#include <com/sun/star/util/XURLTransformer.hpp> +#include <comphelper/componentcontext.hxx> #include <osl/mutex.hxx> #include <osl/diagnose.h> @@ -228,18 +229,13 @@ uno::Sequence< beans::PropertyValue > EmbedDocument_Impl::fillArgsForLoading_Imp rtl::OUString sDocUrl; if ( pFilePath ) { - ::rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.util.URLTransformer" ) ); - uno::Reference< util::XURLTransformer > aTransformer( m_xFactory->createInstance( aServiceName ), - uno::UNO_QUERY ); - if ( aTransformer.is() ) - { - util::URL aURL; + uno::Reference< util::XURLTransformer > aTransformer( util::URLTransformer::create(comphelper::ComponentContext(m_xFactory).getUNOContext()) ); + util::URL aURL; - aURL.Complete = ::rtl::OUString( reinterpret_cast<const sal_Unicode*>(pFilePath) ); + aURL.Complete = ::rtl::OUString( reinterpret_cast<const sal_Unicode*>(pFilePath) ); - if ( aTransformer->parseSmart( aURL, ::rtl::OUString() ) ) - sDocUrl = aURL.Complete; - } + if ( aTransformer->parseSmart( aURL, ::rtl::OUString() ) ) + sDocUrl = aURL.Complete; } aArgs[nInd++].Value <<= sDocUrl; @@ -894,9 +890,7 @@ STDMETHODIMP EmbedDocument_Impl::Save( LPCOLESTR pszFileName, BOOL fRemember ) util::URL aURL; aURL.Complete = ::rtl::OUString( reinterpret_cast<const sal_Unicode*>( pszFileName ) ); - ::rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.util.URLTransformer" ) ); - uno::Reference< util::XURLTransformer > aTransformer( m_xFactory->createInstance( aServiceName ), - uno::UNO_QUERY_THROW ); + uno::Reference< util::XURLTransformer > aTransformer( util::URLTransformer::create(comphelper::ComponentContext(m_xFactory).getUNOContext()) ); if ( aTransformer->parseSmart( aURL, ::rtl::OUString() ) && aURL.Complete.getLength() ) { |