From f789715a414bd1115401f93d11f09260f891956c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 23 Aug 2012 15:43:05 +0200 Subject: fdo#46808, Use factory methods for frame::DispatchHelper instances Change-Id: I7bdf16fc6d042e5ecd404c604a8b7c31c1ac7bc1 --- .../controller/main/ChartController_Window.cxx | 25 +++++++++------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'chart2') diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index 23a6eafdc3c0..16709ef22df2 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -51,7 +51,7 @@ #include #include -#include +#include #include #include #include @@ -1550,20 +1550,15 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt ) if( ! bReturn && nCode == KEY_ESCAPE ) { - uno::Reference< frame::XDispatchHelper > xDispatchHelper( - m_xCC->getServiceManager()->createInstanceWithContext( - C2U("com.sun.star.frame.DispatchHelper"), m_xCC ), uno::UNO_QUERY ); - if( xDispatchHelper.is()) - { - uno::Sequence< beans::PropertyValue > aArgs; - xDispatchHelper->executeDispatch( - uno::Reference< frame::XDispatchProvider >( m_xFrame, uno::UNO_QUERY ), - C2U(".uno:TerminateInplaceActivation"), - C2U("_parent"), - frame::FrameSearchFlag::PARENT, - aArgs ); - bReturn = true; - } + uno::Reference< frame::XDispatchHelper > xDispatchHelper( frame::DispatchHelper::create(m_xCC) ); + uno::Sequence< beans::PropertyValue > aArgs; + xDispatchHelper->executeDispatch( + uno::Reference< frame::XDispatchProvider >( m_xFrame, uno::UNO_QUERY ), + C2U(".uno:TerminateInplaceActivation"), + C2U("_parent"), + frame::FrameSearchFlag::PARENT, + aArgs ); + bReturn = true; } if( ! bReturn && -- cgit