Fix the copy-paste
Use m_xUrlTransformer, and drop the now unneeded m_xContext.is() check. Here is the history of this: - commitef8f9cfb26
(CWS docking1) introduced this code in ToolboxController::execute. - commita2bbbc5130
(CWS docking3) copy-pasted this into GenericToolbarController::execute. - commit0fc90c8a06
(CWS insight02) changed the original code, but not the copy-pasted one. - commitd7afd8e128
(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
This commit is contained in:
@@ -123,7 +123,6 @@ void SAL_CALL GenericToolbarController::dispose()
|
||||
void SAL_CALL GenericToolbarController::execute( sal_Int16 KeyModifier )
|
||||
{
|
||||
Reference< XDispatch > xDispatch;
|
||||
Reference< XURLTransformer > xURLTransformer;
|
||||
OUString aCommandURL;
|
||||
|
||||
{
|
||||
@@ -136,8 +135,6 @@ void SAL_CALL GenericToolbarController::execute( sal_Int16 KeyModifier )
|
||||
m_xFrame.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() )
|
||||
@@ -145,7 +142,7 @@ void SAL_CALL GenericToolbarController::execute( sal_Int16 KeyModifier )
|
||||
}
|
||||
}
|
||||
|
||||
if ( xDispatch.is() && xURLTransformer.is() )
|
||||
if ( xDispatch.is() )
|
||||
{
|
||||
css::util::URL aTargetURL;
|
||||
Sequence<PropertyValue> aArgs( 1 );
|
||||
@@ -155,7 +152,8 @@ void SAL_CALL GenericToolbarController::execute( sal_Int16 KeyModifier )
|
||||
aArgs[0].Value <<= KeyModifier;
|
||||
|
||||
aTargetURL.Complete = aCommandURL;
|
||||
xURLTransformer->parseStrict( aTargetURL );
|
||||
if ( m_xUrlTransformer.is() )
|
||||
m_xUrlTransformer->parseStrict( aTargetURL );
|
||||
|
||||
// Execute dispatch asynchronously
|
||||
ExecuteInfo* pExecuteInfo = new ExecuteInfo;
|
||||
|
@@ -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<PropertyValue> aArgs;
|
||||
|
||||
aTargetURL.Complete = aCommandURL;
|
||||
xURLTransformer->parseStrict( aTargetURL );
|
||||
if ( m_xUrlTransformer.is() )
|
||||
m_xUrlTransformer->parseStrict( aTargetURL );
|
||||
|
||||
// Execute dispatch asynchronously
|
||||
ExecuteInfo* pExecuteInfo = new ExecuteInfo;
|
||||
|
@@ -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() )
|
||||
|
Reference in New Issue
Block a user