From 789055bc2acb4c71483fd60ea258d158bd5aec10 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 12 Apr 2016 16:39:03 +0200 Subject: clang-tidy performance-unnecessary-copy-initialization probably not much performance benefit, but it sure is good at identifying leftover intermediate variables from previous refactorings. Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657 Reviewed-on: https://gerrit.libreoffice.org/24026 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- framework/inc/uielement/toolbarmerger.hxx | 12 +++---- framework/source/dispatch/dispatchprovider.cxx | 22 ++++++------- framework/source/fwe/classes/addonsoptions.cxx | 14 +++----- framework/source/fwe/xml/menudocumenthandler.cxx | 15 ++++----- framework/source/layoutmanager/layoutmanager.cxx | 10 ++---- .../source/layoutmanager/toolbarlayoutmanager.cxx | 11 +++---- framework/source/services/pathsettings.cxx | 3 +- framework/source/uielement/menubarmanager.cxx | 3 +- framework/source/uielement/toolbarmanager.cxx | 6 ++-- framework/source/uielement/toolbarmerger.cxx | 38 ++++------------------ 10 files changed, 43 insertions(+), 91 deletions(-) (limited to 'framework') diff --git a/framework/inc/uielement/toolbarmerger.hxx b/framework/inc/uielement/toolbarmerger.hxx index 4ad1467bbe64..683af8635d5e 100644 --- a/framework/inc/uielement/toolbarmerger.hxx +++ b/framework/inc/uielement/toolbarmerger.hxx @@ -87,8 +87,7 @@ class ToolBarMerger static ReferenceToolbarPathInfo FindReferencePoint( ToolBox* pToolbar, const OUString& rReferencePoint ); - static bool ProcessMergeOperation( const css::uno::Reference< css::frame::XFrame >& xFrame, - ToolBox* pToolbar, + static bool ProcessMergeOperation( ToolBox* pToolbar, sal_uInt16 nPos, sal_uInt16& rItemId, CommandToInfoMap& rCommandMap, @@ -97,8 +96,7 @@ class ToolBarMerger const OUString& rMergeCommandParameter, const AddonToolbarItemContainer& rItems ); - static bool ProcessMergeFallback( const css::uno::Reference< css::frame::XFrame >& xFrame, - ToolBox* pToolbar, + static bool ProcessMergeFallback( ToolBox* pToolbar, sal_uInt16 nPos, sal_uInt16& rItemId, CommandToInfoMap& rCommandMap, @@ -107,8 +105,7 @@ class ToolBarMerger const OUString& rMergeFallback, const AddonToolbarItemContainer& rItems ); - static bool MergeItems( const css::uno::Reference< css::frame::XFrame >& xFrame, - ToolBox* pToolbar, + static bool MergeItems( ToolBox* pToolbar, sal_uInt16 nPos, sal_uInt16 nModIndex, sal_uInt16& rItemId, @@ -116,8 +113,7 @@ class ToolBarMerger const OUString& rModuleIdentifier, const AddonToolbarItemContainer& rAddonToolbarItems ); - static bool ReplaceItem( const css::uno::Reference< css::frame::XFrame >& xFrame, - ToolBox* pToolbar, + static bool ReplaceItem( ToolBox* pToolbar, sal_uInt16 nPos, sal_uInt16& rItemId, CommandToInfoMap& rCommandMap, diff --git a/framework/source/dispatch/dispatchprovider.cxx b/framework/source/dispatch/dispatchprovider.cxx index 28ab6e4a5ce1..846b12146dec 100644 --- a/framework/source/dispatch/dispatchprovider.cxx +++ b/framework/source/dispatch/dispatchprovider.cxx @@ -251,8 +251,6 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryFrame // 0) Some URLs are dispatched in a generic way (e.g. by the menu) using the default target "". // But they are specified to use her own fix target. Detect such URLs here and use the correct target. - OUString sTargetName = sTargetFrameName; - // I) handle special cases which not right for using findFrame() first // I.I) "_blank", "_default" @@ -261,20 +259,20 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryFrame // here. Thats why we must "intercept" here. if ( - (sTargetName==SPECIALTARGET_BLANK ) || - (sTargetName==SPECIALTARGET_DEFAULT) + (sTargetFrameName==SPECIALTARGET_BLANK ) || + (sTargetFrameName==SPECIALTARGET_DEFAULT) ) { css::uno::Reference< css::frame::XDispatchProvider > xParent( xFrame->getCreator(), css::uno::UNO_QUERY ); if (xParent.is()) - xDispatcher = xParent->queryDispatch(aURL, sTargetName, 0); // it's a special target - ignore search flags + xDispatcher = xParent->queryDispatch(aURL, sTargetFrameName, 0); // it's a special target - ignore search flags } // I.II) "_beamer" // Special sub frame of a top frame only. Search or create it. ... OK it's currently a little bit HACKI. // Only the sfx (means the controller) can create it. - else if (sTargetName==SPECIALTARGET_BEAMER) + else if (sTargetFrameName==SPECIALTARGET_BEAMER) { css::uno::Reference< css::frame::XDispatchProvider > xBeamer( xFrame->findFrame( SPECIALTARGET_BEAMER, css::frame::FrameSearchFlag::CHILDREN | css::frame::FrameSearchFlag::SELF ), css::uno::UNO_QUERY ); if (xBeamer.is()) @@ -294,7 +292,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryFrame // I.IV) "_parent" // Our parent frame (if it exist) should handle this URL. - else if (sTargetName==SPECIALTARGET_PARENT) + else if (sTargetFrameName==SPECIALTARGET_PARENT) { css::uno::Reference< css::frame::XDispatchProvider > xParent( xFrame->getCreator(), css::uno::UNO_QUERY ); if (xParent.is()) @@ -306,7 +304,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryFrame // This request must be forwarded to any parent frame, till we reach a top frame. // If no parent exist, we can handle itself. - else if (sTargetName==SPECIALTARGET_TOP) + else if (sTargetFrameName==SPECIALTARGET_TOP) { if (xFrame->isTop()) { @@ -332,8 +330,8 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryFrame // we load it into the frame by returning specilized dispatch object. else if ( - (sTargetName==SPECIALTARGET_SELF) || - (sTargetName.isEmpty()) + (sTargetFrameName==SPECIALTARGET_SELF) || + (sTargetFrameName.isEmpty()) ) { // There exist a hard coded interception for special URLs. @@ -396,7 +394,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryFrame nRightFlags &= ~css::frame::FrameSearchFlag::CREATE; // try to find any existing target and ask him for his dispatcher - css::uno::Reference< css::frame::XFrame > xFoundFrame = xFrame->findFrame(sTargetName, nRightFlags); + css::uno::Reference< css::frame::XFrame > xFoundFrame = xFrame->findFrame(sTargetFrameName, nRightFlags); if (xFoundFrame.is()) { // Attention: Found target is our own owner frame! @@ -423,7 +421,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryFrame { css::uno::Reference< css::frame::XDispatchProvider > xParent( xFrame->getCreator(), css::uno::UNO_QUERY ); if (xParent.is()) - xDispatcher = xParent->queryDispatch(aURL, sTargetName, css::frame::FrameSearchFlag::CREATE); + xDispatcher = xParent->queryDispatch(aURL, sTargetFrameName, css::frame::FrameSearchFlag::CREATE); } } diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx index 82a519b6244f..406e4663bcf1 100644 --- a/framework/source/fwe/classes/addonsoptions.cxx +++ b/framework/source/fwe/classes/addonsoptions.cxx @@ -771,16 +771,15 @@ void AddonsOptions_Impl::ReadMenuMergeInstructions( MergeMenuInstructionContaine const OUString aMenuMergeRootName( "AddonUI/OfficeMenuBarMerging/" ); Sequence< OUString > aAddonMergeNodesSeq = GetNodeNames( aMenuMergeRootName ); - OUString aAddonMergeNode( aMenuMergeRootName ); - sal_uInt32 nCount = aAddonMergeNodesSeq.getLength(); + sal_uInt32 nCount = aAddonMergeNodesSeq.getLength(); // Init the property value sequence Sequence< OUString > aNodePropNames( 5 ); for ( sal_uInt32 i = 0; i < nCount; i++ ) { - OUString aMergeAddonInstructions( aAddonMergeNode + aAddonMergeNodesSeq[i] ); + OUString aMergeAddonInstructions( aMenuMergeRootName + aAddonMergeNodesSeq[i] ); Sequence< OUString > aAddonInstMergeNodesSeq = GetNodeNames( aMergeAddonInstructions ); sal_uInt32 nCountAddons = aAddonInstMergeNodesSeq.getLength(); @@ -849,16 +848,14 @@ void AddonsOptions_Impl::ReadToolbarMergeInstructions( ToolbarMergingInstruction const OUString aToolbarMergeRootName( "AddonUI/OfficeToolbarMerging/" ); Sequence< OUString > aAddonMergeNodesSeq = GetNodeNames( aToolbarMergeRootName ); - OUString aAddonMergeNode( aToolbarMergeRootName ); - - sal_uInt32 nCount = aAddonMergeNodesSeq.getLength(); + sal_uInt32 nCount = aAddonMergeNodesSeq.getLength(); // Init the property value sequence Sequence< OUString > aNodePropNames( 6 ); for ( sal_uInt32 i = 0; i < nCount; i++ ) { - OUString aMergeAddonInstructions( aAddonMergeNode + aAddonMergeNodesSeq[i] ); + OUString aMergeAddonInstructions( aToolbarMergeRootName + aAddonMergeNodesSeq[i] ); Sequence< OUString > aAddonInstMergeNodesSeq = GetNodeNames( aMergeAddonInstructions ); sal_uInt32 nCountAddons = aAddonInstMergeNodesSeq.getLength(); @@ -929,14 +926,13 @@ void AddonsOptions_Impl::ReadStatusbarMergeInstructions( MergeStatusbarInstructi const ::rtl::OUString aStatusbarMergeRootName( "AddonUI/OfficeStatusbarMerging/" ); Sequence< ::rtl::OUString > aAddonMergeNodesSeq = GetNodeNames( aStatusbarMergeRootName ); - ::rtl::OUString aAddonMergeNode( aStatusbarMergeRootName ); sal_uInt32 nCount = aAddonMergeNodesSeq.getLength(); Sequence< ::rtl::OUString > aNodePropNames( 5 ); for ( sal_uInt32 i = 0; i < nCount; i++ ) { - ::rtl::OUString aMergeAddonInstructions( aAddonMergeNode + aAddonMergeNodesSeq[i] ); + ::rtl::OUString aMergeAddonInstructions( aStatusbarMergeRootName + aAddonMergeNodesSeq[i] ); Sequence< ::rtl::OUString > aAddonInstMergeNodesSeq = GetNodeNames( aMergeAddonInstructions ); sal_uInt32 nCountAddons = aAddonInstMergeNodesSeq.getLength(); diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx index e3cb6b54f176..8055034ad041 100644 --- a/framework/source/fwe/xml/menudocumenthandler.cxx +++ b/framework/source/fwe/xml/menudocumenthandler.cxx @@ -362,7 +362,7 @@ throw( SAXException, RuntimeException, std::exception ) for ( sal_Int16 i=0; i< xAttrList->getLength(); i++ ) { OUString aName = xAttrList->getNameByIndex( i ); - OUString aValue = xAttrList->getValueByIndex( i ); + const OUString aValue = xAttrList->getValueByIndex( i ); if ( aName == ATTRIBUTE_ID ) aCommandId = aValue; else if ( aName == ATTRIBUTE_LABEL ) @@ -371,11 +371,10 @@ throw( SAXException, RuntimeException, std::exception ) aHelpId = aValue; else if ( aName == ATTRIBUTE_STYLE ) { - OUString aTemp( aValue ); sal_Int32 nIndex = 0; do { - OUString aToken = aTemp.getToken( 0, '+', nIndex ); + OUString aToken = aValue.getToken( 0, '+', nIndex ); if ( !aToken.isEmpty() ) { if ( aToken == ATTRIBUTE_ITEMSTYLE_TEXT ) @@ -573,7 +572,7 @@ throw( SAXException, RuntimeException, std::exception ) for ( sal_Int16 i=0; i< xAttrList->getLength(); i++ ) { OUString aName = xAttrList->getNameByIndex( i ); - OUString aValue = xAttrList->getValueByIndex( i ); + const OUString aValue = xAttrList->getValueByIndex( i ); if ( aName == ATTRIBUTE_ID ) aCommandId = aValue; else if ( aName == ATTRIBUTE_LABEL ) @@ -582,11 +581,10 @@ throw( SAXException, RuntimeException, std::exception ) aHelpId = aValue; else if ( aName == ATTRIBUTE_STYLE ) { - OUString aTemp( aValue ); sal_Int32 nIndex = 0; do { - OUString aToken = aTemp.getToken( 0, '+', nIndex ); + OUString aToken = aValue.getToken( 0, '+', nIndex ); if ( !aToken.isEmpty() ) { if ( aToken == ATTRIBUTE_ITEMSTYLE_TEXT ) @@ -630,7 +628,7 @@ throw( SAXException, RuntimeException, std::exception ) for ( sal_Int16 i=0; i< xAttrList->getLength(); i++ ) { OUString aName = xAttrList->getNameByIndex( i ); - OUString aValue = xAttrList->getValueByIndex( i ); + const OUString aValue = xAttrList->getValueByIndex( i ); if ( aName == ATTRIBUTE_ID ) aCommandId = aValue; else if ( aName == ATTRIBUTE_LABEL ) @@ -639,11 +637,10 @@ throw( SAXException, RuntimeException, std::exception ) aHelpId = aValue; else if ( aName == ATTRIBUTE_STYLE ) { - OUString aTemp( aValue ); sal_Int32 nIndex = 0; do { - OUString aToken = aTemp.getToken( 0, '+', nIndex ); + OUString aToken = aValue.getToken( 0, '+', nIndex ); if ( !aToken.isEmpty() ) { if ( aToken == ATTRIBUTE_ITEMSTYLE_TEXT ) diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index f2c598a9efc2..4dede28936c1 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -490,15 +490,11 @@ bool LayoutManager::readWindowStateData( const OUString& aName, UIElement& rElem GlobalSettings* &rGlobalSettings, bool &bInGlobalSettings, const Reference< XComponentContext > &rComponentContext ) { - SolarMutexResettableGuard aWriteLock; - Reference< XNameAccess > xPersistentWindowState( rPersistentWindowState ); - aWriteLock.clear(); - - if ( xPersistentWindowState.is() ) + if ( rPersistentWindowState.is() ) { bool bGetSettingsState( false ); - aWriteLock.reset(); + SolarMutexResettableGuard aWriteLock; bool bGlobalSettings( bInGlobalSettings ); GlobalSettings* pGlobalSettings( nullptr ); if ( rGlobalSettings == nullptr ) @@ -512,7 +508,7 @@ bool LayoutManager::readWindowStateData( const OUString& aName, UIElement& rElem try { Sequence< PropertyValue > aWindowState; - if ( xPersistentWindowState->hasByName( aName ) && (xPersistentWindowState->getByName( aName ) >>= aWindowState) ) + if ( rPersistentWindowState->hasByName( aName ) && (rPersistentWindowState->getByName( aName ) >>= aWindowState) ) { bool bValue( false ); for ( sal_Int32 n = 0; n < aWindowState.getLength(); n++ ) diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index 9dff9b9c1fd3..785ca6f9ca81 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -1406,13 +1406,12 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno bool bShowElement( rElement.m_bVisible && !rElement.m_bMasterHide && implts_isParentWindowVisible() ); aReadLock.clear(); - uno::Reference< awt::XDockableWindow > xDockWindow( rDockWindow ); - uno::Reference< awt::XWindow2 > xWindow( xDockWindow, uno::UNO_QUERY ); + uno::Reference< awt::XWindow2 > xWindow( rDockWindow, uno::UNO_QUERY ); vcl::Window* pWindow( nullptr ); ToolBox* pToolBox( nullptr ); - if ( xDockWindow.is() && xWindow.is() ) + if ( rDockWindow.is() && xWindow.is() ) { { SolarMutexGuard aGuard; @@ -1450,7 +1449,7 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno bool bUndefPos = hasDefaultPosValue( rElement.m_aFloatingData.m_aPos ); bool bSetSize = ( rElement.m_aFloatingData.m_aSize.Width != 0 && rElement.m_aFloatingData.m_aSize.Height != 0 ); - xDockWindow->setFloatingMode( sal_True ); + rDockWindow->setFloatingMode( sal_True ); if ( bUndefPos ) { aPos = implts_findNextCascadeFloatingPos(); @@ -1501,9 +1500,9 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno SolarMutexGuard aGuard; pToolBox->SetAlign( ImplConvertAlignment(rElement.m_aDockedData.m_nDockedArea ) ); pToolBox->SetLineCount( 1 ); - xDockWindow->setFloatingMode( sal_False ); + rDockWindow->setFloatingMode( sal_False ); if ( rElement.m_aDockedData.m_bLocked ) - xDockWindow->lock(); + rDockWindow->lock(); aSize = pToolBox->CalcWindowSizePixel(); bSetSize = true; diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx index befd73f17dbc..8172e015f907 100644 --- a/framework/source/services/pathsettings.cxx +++ b/framework/source/services/pathsettings.cxx @@ -840,7 +840,6 @@ PathSettings::EChangeOp PathSettings::impl_updatePath(const OUString& sPath css::uno::Sequence< sal_Int32 > PathSettings::impl_mapPathName2IDList(const OUString& sPath) { - OUString sOldStyleProp = sPath; OUString sInternalProp = sPath+POSTFIX_INTERNAL_PATHS; OUString sUserProp = sPath+POSTFIX_USER_PATHS; OUString sWriteProp = sPath+POSTFIX_WRITE_PATH; @@ -865,7 +864,7 @@ css::uno::Sequence< sal_Int32 > PathSettings::impl_mapPathName2IDList(const OUSt { const css::beans::Property& rProp = m_lPropDesc[i]; - if (rProp.Name.equals(sOldStyleProp)) + if (rProp.Name.equals(sPath)) lIDs[IDGROUP_OLDSTYLE] = rProp.Handle; else if (rProp.Name.equals(sInternalProp)) diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 3c7493619477..902e277afffb 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -1293,8 +1293,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF // Set image for the addon popup menu item if ( bItemShowMenuImages && !pPopup->GetItemImage( ITEMID_ADDONLIST )) { - Reference< XFrame > xTemp( rFrame ); - Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( aItemCommand, false, xTemp ); + Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( aItemCommand, false, rFrame ); if ( !!aImage ) pPopup->SetItemImage( ITEMID_ADDONLIST, aImage ); } diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 09f754b73da0..f0ae7ef86e4c 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -1109,8 +1109,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine if ( aRefPoint.bResult ) { - ToolBarMerger::ProcessMergeOperation( m_xFrame, - m_pToolBar, + ToolBarMerger::ProcessMergeOperation( m_pToolBar, aRefPoint.nPos, nItemId, m_aCommandMap, @@ -1121,8 +1120,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine } else { - ToolBarMerger::ProcessMergeFallback( m_xFrame, - m_pToolBar, + ToolBarMerger::ProcessMergeFallback( m_pToolBar, aRefPoint.nPos, nItemId, m_aCommandMap, diff --git a/framework/source/uielement/toolbarmerger.cxx b/framework/source/uielement/toolbarmerger.cxx index 0a7fb0299a58..db77987a0f17 100644 --- a/framework/source/uielement/toolbarmerger.cxx +++ b/framework/source/uielement/toolbarmerger.cxx @@ -263,11 +263,6 @@ ReferenceToolbarPathInfo ToolBarMerger::FindReferencePoint( /** Processes a merge operation. - @param - xFrame - - Must be a valid reference to a frame. - @param pToolbar @@ -312,7 +307,6 @@ ReferenceToolbarPathInfo ToolBarMerger::FindReferencePoint( false. */ bool ToolBarMerger::ProcessMergeOperation( - const uno::Reference< frame::XFrame >& xFrame, ToolBox* pToolbar, sal_uInt16 nPos, sal_uInt16& rItemId, @@ -323,11 +317,11 @@ bool ToolBarMerger::ProcessMergeOperation( const AddonToolbarItemContainer& rItems ) { if ( rMergeCommand == MERGECOMMAND_ADDAFTER ) - return MergeItems( xFrame, pToolbar, nPos, 1, rItemId, rCommandMap, rModuleIdentifier, rItems ); + return MergeItems( pToolbar, nPos, 1, rItemId, rCommandMap, rModuleIdentifier, rItems ); else if ( rMergeCommand == MERGECOMMAND_ADDBEFORE ) - return MergeItems( xFrame, pToolbar, nPos, 0, rItemId, rCommandMap, rModuleIdentifier, rItems ); + return MergeItems( pToolbar, nPos, 0, rItemId, rCommandMap, rModuleIdentifier, rItems ); else if ( rMergeCommand == MERGECOMMAND_REPLACE ) - return ReplaceItem( xFrame, pToolbar, nPos, rItemId, rCommandMap, rModuleIdentifier, rItems ); + return ReplaceItem( pToolbar, nPos, rItemId, rCommandMap, rModuleIdentifier, rItems ); else if ( rMergeCommand == MERGECOMMAND_REMOVE ) return RemoveItems( pToolbar, nPos, rMergeCommandParameter ); @@ -337,11 +331,6 @@ bool ToolBarMerger::ProcessMergeOperation( /** Processes a merge fallback operation. - @param - xFrame - - Must be a valid reference to a frame. - @param pToolbar @@ -381,7 +370,6 @@ bool ToolBarMerger::ProcessMergeOperation( false. */ bool ToolBarMerger::ProcessMergeFallback( - const css::uno::Reference< css::frame::XFrame >& xFrame, ToolBox* pToolbar, sal_uInt16 /*nPos*/, sal_uInt16& rItemId, @@ -401,9 +389,9 @@ bool ToolBarMerger::ProcessMergeFallback( ( rMergeCommand == MERGECOMMAND_ADDAFTER ) ) { if ( rMergeFallback == MERGEFALLBACK_ADDFIRST ) - return MergeItems( xFrame, pToolbar, 0, 0, rItemId, rCommandMap, rModuleIdentifier, rItems ); + return MergeItems( pToolbar, 0, 0, rItemId, rCommandMap, rModuleIdentifier, rItems ); else if ( rMergeFallback == MERGEFALLBACK_ADDLAST ) - return MergeItems( xFrame, pToolbar, TOOLBOX_APPEND, 0, rItemId, rCommandMap, rModuleIdentifier, rItems ); + return MergeItems( pToolbar, TOOLBOX_APPEND, 0, rItemId, rCommandMap, rModuleIdentifier, rItems ); } return false; @@ -412,11 +400,6 @@ bool ToolBarMerger::ProcessMergeFallback( /** Merges (adds) toolbar items into an existing toolbar. - @param - xFrame - - Must be a valid reference to a frame. - @param pToolbar @@ -451,7 +434,6 @@ bool ToolBarMerger::ProcessMergeFallback( false. */ bool ToolBarMerger::MergeItems( - const uno::Reference< frame::XFrame >& rFrame, ToolBox* pToolbar, sal_uInt16 nPos, sal_uInt16 nModIndex, @@ -462,8 +444,6 @@ bool ToolBarMerger::MergeItems( { const sal_Int32 nSize( rAddonToolbarItems.size() ); - uno::Reference< frame::XFrame > xFrame( rFrame ); - sal_uInt16 nIndex( 0 ); for ( sal_Int32 i = 0; i < nSize; i++ ) { @@ -506,11 +486,6 @@ bool ToolBarMerger::MergeItems( Replaces a toolbar item with new items for an existing toolbar. - @param - xFrame - - Must be a valid reference to a frame. - @param pToolbar @@ -545,7 +520,6 @@ bool ToolBarMerger::MergeItems( false. */ bool ToolBarMerger::ReplaceItem( - const uno::Reference< frame::XFrame >& xFrame, ToolBox* pToolbar, sal_uInt16 nPos, sal_uInt16& rItemId, @@ -554,7 +528,7 @@ bool ToolBarMerger::ReplaceItem( const AddonToolbarItemContainer& rAddonToolbarItems ) { pToolbar->RemoveItem( nPos ); - return MergeItems( xFrame, pToolbar, nPos, 0, rItemId, rCommandMap, rModuleIdentifier, rAddonToolbarItems ); + return MergeItems( pToolbar, nPos, 0, rItemId, rCommandMap, rModuleIdentifier, rAddonToolbarItems ); } /** -- cgit