From 32680923221e1eec9020c2a21b51125f735e4a32 Mon Sep 17 00:00:00 2001 From: Maxim Monastirsky Date: Wed, 26 Apr 2017 03:09:41 +0300 Subject: Fix the copy-paste Use m_xUrlTransformer, and drop the now unneeded m_xContext.is() check. Here is the history of this: - commit ef8f9cfb262a7 (CWS docking1) introduced this code in ToolboxController::execute. - commit a2bbbc5130b80 (CWS docking3) copy-pasted this into GenericToolbarController::execute. - commit 0fc90c8a064f7 (CWS insight02) changed the original code, but not the copy-pasted one. - commit d7afd8e128177 (CWS toolbars2) That CWS didn't have the above change yet, and copy-pasted the old code to yet another place (GenericToolboxController::execute). Change-Id: I7f4e8dfb52b96ea5285ea7b2bb3083847dd84932 --- svtools/source/uno/generictoolboxcontroller.cxx | 9 +++------ svtools/source/uno/toolboxcontroller.cxx | 2 -- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'svtools') diff --git a/svtools/source/uno/generictoolboxcontroller.cxx b/svtools/source/uno/generictoolboxcontroller.cxx index dd03972489b1..0ab20dc6a20e 100644 --- a/svtools/source/uno/generictoolboxcontroller.cxx +++ b/svtools/source/uno/generictoolboxcontroller.cxx @@ -81,7 +81,6 @@ void SAL_CALL GenericToolboxController::dispose() void SAL_CALL GenericToolboxController::execute( sal_Int16 /*KeyModifier*/ ) { Reference< XDispatch > xDispatch; - Reference< XURLTransformer > xURLTransformer; OUString aCommandURL; { @@ -92,11 +91,8 @@ void SAL_CALL GenericToolboxController::execute( sal_Int16 /*KeyModifier*/ ) if ( m_bInitialized && m_xFrame.is() && - m_xContext.is() && !m_aCommandURL.isEmpty() ) { - xURLTransformer = URLTransformer::create( m_xContext ); - aCommandURL = m_aCommandURL; URLToDispatchMap::iterator pIter = m_aListenerMap.find( m_aCommandURL ); if ( pIter != m_aListenerMap.end() ) @@ -104,13 +100,14 @@ void SAL_CALL GenericToolboxController::execute( sal_Int16 /*KeyModifier*/ ) } } - if ( xDispatch.is() && xURLTransformer.is() ) + if ( xDispatch.is() ) { css::util::URL aTargetURL; Sequence aArgs; aTargetURL.Complete = aCommandURL; - xURLTransformer->parseStrict( aTargetURL ); + if ( m_xUrlTransformer.is() ) + m_xUrlTransformer->parseStrict( aTargetURL ); // Execute dispatch asynchronously ExecuteInfo* pExecuteInfo = new ExecuteInfo; diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index 32ce1a781764..4d802f1d7763 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -324,10 +324,8 @@ void SAL_CALL ToolboxController::execute( sal_Int16 KeyModifier ) if ( m_bInitialized && m_xFrame.is() && - m_xContext.is() && !m_aCommandURL.isEmpty() ) { - aCommandURL = m_aCommandURL; URLToDispatchMap::iterator pIter = m_aListenerMap.find( m_aCommandURL ); if ( pIter != m_aListenerMap.end() ) -- cgit