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 /UnoControls | |
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 'UnoControls')
-rw-r--r-- | UnoControls/Library_ctl.mk | 1 | ||||
-rw-r--r-- | UnoControls/source/controls/framecontrol.cxx | 25 |
2 files changed, 14 insertions, 12 deletions
diff --git a/UnoControls/Library_ctl.mk b/UnoControls/Library_ctl.mk index 9e7fc16f6d70..1bedad8f1fcc 100644 --- a/UnoControls/Library_ctl.mk +++ b/UnoControls/Library_ctl.mk @@ -39,6 +39,7 @@ $(eval $(call gb_Library_use_api,ctl,\ )) $(eval $(call gb_Library_use_libraries,ctl,\ + comphelper \ cppu \ cppuhelper \ sal \ diff --git a/UnoControls/source/controls/framecontrol.cxx b/UnoControls/source/controls/framecontrol.cxx index 0504a11a354a..1f9838cda3f8 100644 --- a/UnoControls/source/controls/framecontrol.cxx +++ b/UnoControls/source/controls/framecontrol.cxx @@ -37,10 +37,12 @@ // includes of other projects //______________________________________________________________________________________________________________ #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/XDispatch.hpp> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> +#include <comphelper/componentcontext.hxx> #include <cppuhelper/typeprovider.hxx> #include <osl/diagnose.h> @@ -497,20 +499,19 @@ void FrameControl::impl_createFrame( const Reference< XWindowPeer >& xPee // option //xFrame->setName( "WhatYouWant" ); - Reference< XURLTransformer > xTrans ( impl_getMultiServiceFactory()->createInstance ( "com.sun.star.util.URLTransformer" ), UNO_QUERY ) ; - if(xTrans.is()) - { - // load file - URL aURL ; + Reference< XURLTransformer > xTrans ( + URLTransformer::create( + ::comphelper::ComponentContext( impl_getMultiServiceFactory() ).getUNOContext() ) ); + // load file + URL aURL ; - aURL.Complete = rURL ; - xTrans->parseStrict( aURL ) ; + aURL.Complete = rURL ; + xTrans->parseStrict( aURL ) ; - Reference< XDispatch > xDisp = xDSP->queryDispatch ( aURL, OUString (), FrameSearchFlag::SELF ) ; - if (xDisp.is()) - { - xDisp->dispatch ( aURL, rArguments ) ; - } + Reference< XDispatch > xDisp = xDSP->queryDispatch ( aURL, OUString (), FrameSearchFlag::SELF ) ; + if (xDisp.is()) + { + xDisp->dispatch ( aURL, rArguments ) ; } } |