diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2016-01-20 14:39:22 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2016-01-20 17:44:00 +0200 |
commit | ad236a3e1b456531ea758c2a3c5075860d823109 (patch) | |
tree | 9e0b12e26e85c06a25c14368845429b34fc8b21c /sfx2 | |
parent | c5a1278fa2bcc193a82d78ee408ea7a913420675 (diff) |
i#107205 Remove SfxDispatcher::Popup and SfxPopupMenuManager::Popup
Change-Id: I1a8bee75a2dbfb039ec32faf001b75b26ea1f3fe
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/dispatch.cxx | 24 | ||||
-rw-r--r-- | sfx2/source/menu/mnumgr.cxx | 56 |
2 files changed, 0 insertions, 80 deletions
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 12444ef21559..a4d73d5415d2 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -1849,30 +1849,6 @@ bool SfxDispatcher::_FillState(const SfxSlotServer& rSvr, SfxItemSet& rState, return false; } -SfxPopupMenuManager* SfxDispatcher::Popup( sal_uInt16 nConfigId, vcl::Window *pWin, const Point *pPos ) -{ - SfxDispatcher &rDisp = *SfxGetpApp()->GetDispatcher_Impl(); - sal_uInt16 nShLevel = 0; - SfxShell *pSh; - - if ( rDisp.xImp->bQuiet ) - { - nConfigId = 0; - nShLevel = rDisp.xImp->aStack.size(); - } - - vcl::Window *pWindow = pWin ? pWin : rDisp.xImp->pFrame->GetFrame().GetWorkWindow_Impl()->GetWindow(); - for ( pSh = rDisp.GetShell(nShLevel); pSh; ++nShLevel, pSh = rDisp.GetShell(nShLevel) ) - { - const ResId& rResId = pSh->GetInterface()->GetPopupMenuResId(); - if ( ( nConfigId == 0 && rResId.GetId() ) || ( nConfigId != 0 && rResId.GetId() == nConfigId ) ) - { - return SfxPopupMenuManager::Popup( rResId, rDisp.GetFrame(), pPos ? *pPos : pWindow->GetPointerPosPixel(), pWindow ); - } - } - return nullptr; -} - void SfxDispatcher::ExecutePopup( vcl::Window *pWin, const Point *pPos ) { SfxDispatcher &rDisp = *SfxGetpApp()->GetDispatcher_Impl(); diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx index 31a304d47c23..ef2d375eb4e2 100644 --- a/sfx2/source/menu/mnumgr.cxx +++ b/sfx2/source/menu/mnumgr.cxx @@ -64,9 +64,6 @@ #include <sfx2/objface.hxx> #include "thessubmenu.hxx" -// static member initialization -PopupMenu * SfxPopupMenuManager::pStaticThesSubMenu = nullptr; - using namespace com::sun::star; void TryToHideDisabledEntries_Impl( Menu* pMenu ) @@ -254,7 +251,6 @@ void SfxPopupMenuManager::RemoveDisabledEntries() void SfxPopupMenuManager::Execute( const Point& rPos, vcl::Window* pWindow ) { static_cast<PopupMenu*>( GetMenu()->GetSVMenu() )->Execute( pWindow, rPos ); - delete pStaticThesSubMenu; pStaticThesSubMenu = nullptr; } @@ -274,58 +270,6 @@ SfxPopupMenuManager::SfxPopupMenuManager( PopupMenu* pMenuArg, SfxBindings& rBin { } -SfxPopupMenuManager* SfxPopupMenuManager::Popup( const ResId& rResId, SfxViewFrame* pFrame,const Point& rPoint, vcl::Window* pWindow ) -{ - PopupMenu *pSVMenu = new PopupMenu( rResId ); - sal_uInt16 n, nCount = pSVMenu->GetItemCount(); - for ( n=0; n<nCount; n++ ) - { - sal_uInt16 nId = pSVMenu->GetItemId( n ); - if ( nId == SID_COPY || nId == SID_CUT || nId == SID_PASTE ) - break; - } - - PopupMenu* pThesSubMenu = InsertThesaurusSubmenu_Impl( &pFrame->GetBindings(), pSVMenu ); - // #i107205# (see comment in header file) - pStaticThesSubMenu = pThesSubMenu; - - if ( n == nCount ) - { - PopupMenu aPop( SfxResId( MN_CLIPBOARDFUNCS ) ); - nCount = aPop.GetItemCount(); - for ( n=0; n<nCount; n++ ) - { - sal_uInt16 nId = aPop.GetItemId( n ); - pSVMenu->InsertItem( nId, aPop.GetItemText( nId ), aPop.GetItemBits( nId ), OString(), n ); - pSVMenu->SetHelpId( nId, aPop.GetHelpId( nId )); - } - pSVMenu->InsertSeparator( OString(), n ); - } - - InsertVerbs_Impl( &pFrame->GetBindings(), pFrame->GetViewShell()->GetVerbs(), pSVMenu ); - Menu* pMenu = nullptr; - css::ui::ContextMenuExecuteEvent aEvent; - aEvent.SourceWindow = VCLUnoHelper::GetInterface( pWindow ); - aEvent.ExecutePosition.X = rPoint.X(); - aEvent.ExecutePosition.Y = rPoint.Y(); - OUString sDummyMenuName; - if ( pFrame->GetViewShell()->TryContextMenuInterception( *pSVMenu, sDummyMenuName, pMenu, aEvent ) ) - { - if ( pMenu ) - { - delete pSVMenu; - pSVMenu = static_cast<PopupMenu*>( pMenu ); - } - - SfxPopupMenuManager* aMgr = new SfxPopupMenuManager( pSVMenu, pFrame->GetBindings()); - aMgr->RemoveDisabledEntries(); - return aMgr; - } - - return nullptr; -} - - void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFrame, const Point& rPoint, vcl::Window* pWindow ) { PopupMenu *pSVMenu = new PopupMenu( rResId ); |