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 | |
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')
-rw-r--r-- | sdext/source/minimizer/impoptimizer.cxx | 7 | ||||
-rw-r--r-- | sdext/source/minimizer/informationdialog.cxx | 23 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterController.cxx | 7 |
3 files changed, 16 insertions, 21 deletions
diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx index 8afd16f93c75..95b35ff0d887 100644 --- a/sdext/source/minimizer/impoptimizer.cxx +++ b/sdext/source/minimizer/impoptimizer.cxx @@ -69,6 +69,8 @@ #include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/util/URL.hpp> +#include <com/sun/star/util/URLTransformer.hpp> +#include <comphelper/componentcontext.hxx> using namespace ::std; using namespace ::rtl; @@ -586,12 +588,11 @@ sal_Bool ImpOptimizer::Optimize() return sal_True; } -static void DispatchURL( Reference< XComponentContext > xMSF, OUString sURL, Reference< XFrame > xFrame ) +static void DispatchURL( Reference< XComponentContext > xContext, OUString sURL, Reference< XFrame > xFrame ) { try { - Reference< XURLTransformer > xURLTransformer( xMSF->getServiceManager()->createInstanceWithContext( - OUString( "com.sun.star.util.URLTransformer" ), xMSF ), UNO_QUERY_THROW ); + Reference< XURLTransformer > xURLTransformer( URLTransformer::create(xContext) ); util::URL aUrl; aUrl.Complete = sURL; xURLTransformer->parseStrict( aUrl ); 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 ) ); diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx index 2b1c3e46ac0e..1418d5a3b793 100644 --- a/sdext/source/presenter/PresenterController.cxx +++ b/sdext/source/presenter/PresenterController.cxx @@ -61,6 +61,7 @@ #include <com/sun/star/presentation/XPresentationSupplier.hpp> #include <com/sun/star/rendering/CompositeOperation.hpp> #include <com/sun/star/rendering/TextDirection.hpp> +#include <com/sun/star/util/URLTransformer.hpp> #include <rtl/ustrbuf.hxx> @@ -194,11 +195,7 @@ PresenterController::PresenterController ( // Create a URLTransformer. if (xFactory.is()) { - mxUrlTransformer = Reference<util::XURLTransformer>( - xFactory->createInstanceWithContext( - A2S("com.sun.star.util.URLTransformer"), - mxComponentContext), - UNO_QUERY); + mxUrlTransformer = Reference<util::XURLTransformer>(util::URLTransformer::create(mxComponentContext)); } } |