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 /sdext/source/minimizer/informationdialog.cxx | |
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 'sdext/source/minimizer/informationdialog.cxx')
-rw-r--r-- | sdext/source/minimizer/informationdialog.cxx | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/sdext/source/minimizer/informationdialog.cxx b/sdext/source/minimizer/informationdialog.cxx index c74599f57bab..b09f1ab90d5c 100644 --- a/sdext/source/minimizer/informationdialog.cxx +++ b/sdext/source/minimizer/informationdialog.cxx @@ -36,6 +36,7 @@ #include <rtl/ustrbuf.hxx> #include <sal/macros.h> #include "com/sun/star/util/URL.hpp" +#include "com/sun/star/util/URLTransformer.hpp" #include "com/sun/star/util/XURLTransformer.hpp" #define DIALOG_WIDTH 240 @@ -300,21 +301,17 @@ void InformationDialog::InitDialog() rtl::OUString aTitle; if ( !maSaveAsURL.isEmpty() ) { - Reference< XURLTransformer > xURLTransformer( mxMSF->getServiceManager()->createInstanceWithContext( - OUString( "com.sun.star.util.URLTransformer" ), mxMSF ), UNO_QUERY ); - if ( xURLTransformer.is() ) - { - util::URL aURL, aPresentationURL; - aURL.Complete = maSaveAsURL; - xURLTransformer->parseSmart( aURL, rtl::OUString() ); + Reference< XURLTransformer > xURLTransformer( URLTransformer::create(mxMSF) ); + util::URL aURL, aPresentationURL; + aURL.Complete = maSaveAsURL; + xURLTransformer->parseSmart( aURL, rtl::OUString() ); - const OUString sFileProtocol( "file:///" ); - aPresentationURL.Complete = sFileProtocol.concat( aURL.Name ); - aTitle = xURLTransformer->getPresentation( aPresentationURL, sal_False ); + const OUString sFileProtocol( "file:///" ); + aPresentationURL.Complete = sFileProtocol.concat( aURL.Name ); + aTitle = xURLTransformer->getPresentation( aPresentationURL, sal_False ); - if ( aTitle.match( sFileProtocol, 0 ) ) - aTitle = aTitle.replaceAt( 0, sFileProtocol.getLength(), rtl::OUString() ); - } + if ( aTitle.match( sFileProtocol, 0 ) ) + aTitle = aTitle.replaceAt( 0, sFileProtocol.getLength(), rtl::OUString() ); } OUString aInfoString( getString( eInfoString ) ); |