From 0fcd1a73f0e1ec564f3c6da1ccd890183d3c18db Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 1 Jun 2012 15:15:25 +0200 Subject: 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 , added some tweaks. --- UnoControls/Library_ctl.mk | 1 + UnoControls/source/controls/framecontrol.cxx | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'UnoControls') 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 +#include #include #include #include #include +#include #include #include @@ -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 ) ; } } -- cgit v1.2.3