sfx2/source/view/viewsh.cxx | 41 ----------------------------------------- 1 file changed, 41 deletions(-)
New commits: commit 73e9e027e9978cf5136731118f18b832bd361181 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat Dec 11 14:53:11 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Dec 12 13:33:01 2021 +0100 remove menu "Change id" hack this was introduced with the cryptic: commit e52717eefb2cbf94b70e4620652c1e8848a30c82 Date: Mon May 26 07:30:41 2003 +0000 INTEGRATION: CWS fwk03 (1.34.20); FILE MERGED 2003/05/16 09:58:43 mba 1.34.20.1: #109534#: change in unoctitm.cxx revealed another problem - after ContextMenuInterception slotids might have vanished, so no Controllers can be created in the two remaining uses currently in. sw/source/uibase/docvw/edtwin.cxx and sw/source/uibase/uiview/viewling.cxx I can't see that this could do anything useful anymore. There were other uses in the past however. Change-Id: Ic707566e603bb3b3f6e70bf3fc2581e799828253 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126665 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 8f112ec2a593..860310b73667 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1850,45 +1850,6 @@ void SfxViewShell::RemoveContextMenuInterceptor_Impl( const uno::Reference< ui:: pImpl->aInterceptorContainer.removeInterface( xInterceptor ); } -static void Change( Menu* pMenu, SfxViewShell* pView ) -{ - SfxDispatcher *pDisp = pView->GetViewFrame()->GetDispatcher(); - sal_uInt16 nCount = pMenu->GetItemCount(); - for ( sal_uInt16 nPos=0; nPos<nCount; ++nPos ) - { - sal_uInt16 nId = pMenu->GetItemId(nPos); - OUString aCmd = pMenu->GetItemCommand(nId); - PopupMenu* pPopup = pMenu->GetPopupMenu(nId); - if ( pPopup ) - { - Change( pPopup, pView ); - } - else if ( nId < 5000 ) - { - if ( aCmd.startsWith(".uno:") ) - { - for (sal_uInt16 nIdx=0;;) - { - SfxShell *pShell=pDisp->GetShell(nIdx++); - if (pShell == nullptr) - break; - const SfxInterface *pIFace = pShell->GetInterface(); - const SfxSlot* pSlot = pIFace->GetSlot( aCmd ); - if ( pSlot ) - { - pMenu->InsertItem( pSlot->GetSlotId(), pMenu->GetItemText( nId ), - pMenu->GetItemBits( nId ), OString(), nPos ); - pMenu->SetItemCommand( pSlot->GetSlotId(), aCmd ); - pMenu->RemoveItem( nPos+1 ); - break; - } - } - } - } - } -} - - bool SfxViewShell::TryContextMenuInterception(const Menu& rIn, const OUString& rMenuIdentifier, css::uno::Reference<css::awt::XPopupMenu>& rOut, ui::ContextMenuExecuteEvent aEvent) @@ -1957,8 +1918,6 @@ bool SfxViewShell::TryContextMenuInterception(const Menu& rIn, const OUString& r assert(pVCLMenu); ::framework::ActionTriggerHelper::CreateMenuFromActionTriggerContainer(pVCLMenu, aEvent.ActionTriggerContainer); - - Change(pVCLMenu, this); } return true;