diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-14 14:33:10 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-05-15 10:05:02 +0200 |
commit | 4f4cff08aac32db6fa580423b5fde661c8b0743a (patch) | |
tree | cf91ac27509e32e724b87387bf07d6c8d35b695b | |
parent | 24181bfb0b49a011e201ecc111bac3b48ad5a1ff (diff) |
convert POPUPMENU_ constants to scoped enum
Change-Id: I4cdaf36581d1e1daa39929e621070d18a9996852
23 files changed, 52 insertions, 42 deletions
diff --git a/dbaccess/source/ui/control/toolboxcontroller.cxx b/dbaccess/source/ui/control/toolboxcontroller.cxx index 079e4a5f61e8..b6a3fd152f9c 100644 --- a/dbaccess/source/ui/control/toolboxcontroller.cxx +++ b/dbaccess/source/ui/control/toolboxcontroller.cxx @@ -231,7 +231,7 @@ namespace dbaui VclPtr< ToolBox > pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent()).get()); ::std::unique_ptr<PopupMenu> pMenu = getMenu(); - sal_uInt16 nSelected = pMenu->Execute(pToolBox, pToolBox->GetItemRect( m_nToolBoxId ),POPUPMENU_EXECUTE_DOWN); + sal_uInt16 nSelected = pMenu->Execute(pToolBox, pToolBox->GetItemRect( m_nToolBoxId ),PopupMenuFlags::ExecuteDown); // "cleanup" the toolbox state Point aPoint = pToolBox->GetItemRect( m_nToolBoxId ).TopLeft(); MouseEvent aLeave( aPoint, 0, MouseEventModifiers::LEAVEWINDOW | MouseEventModifiers::SYNTHETIC ); diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index a1db68fca13e..aaa457eee2ac 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -931,7 +931,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<>* pCallBack ) aScreenPos = pImpEditView->GetWindow()->OutputToScreenPixel( aScreenPos ); aTempRect = pImpEditView->GetWindow()->LogicToPixel( Rectangle(aScreenPos, aTempRect.GetSize() )); - sal_uInt16 nId = aPopupMenu.Execute( pImpEditView->GetWindow(), aTempRect, POPUPMENU_NOMOUSEUPCLOSE ); + sal_uInt16 nId = aPopupMenu.Execute( pImpEditView->GetWindow(), aTempRect, PopupMenuFlags::NoMouseUpClose ); if ( nId == MN_IGNORE ) { OUString aWord = pImpEditView->SpellIgnoreOrAddWord( false ); diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx index 22af8489ca84..8b372826a869 100644 --- a/framework/source/uielement/generictoolbarcontroller.cxx +++ b/framework/source/uielement/generictoolbarcontroller.cxx @@ -361,7 +361,7 @@ MenuToolbarController::createPopupWindow() throw (::com::sun::star::uno::Runtime OSL_ENSURE ( pMenu->GetItemCount(), "Empty PopupMenu!" ); ::Rectangle aRect( m_pToolbar->GetItemRect( m_nID ) ); - pMenu->Execute( m_pToolbar, aRect, POPUPMENU_EXECUTE_DOWN ); + pMenu->Execute( m_pToolbar, aRect, PopupMenuFlags::ExecuteDown ); return NULL; } diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index 4899455eb3de..b2a73963e4a2 100644 --- a/include/vcl/menu.hxx +++ b/include/vcl/menu.hxx @@ -31,6 +31,7 @@ #include <vcl/vclevent.hxx> #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/uno/Reference.hxx> +#include <o3tl/typed_flags_set.hxx> struct ImplSVEvent; struct MenuItemData; @@ -66,17 +67,26 @@ namespace vcl { struct MenuLayoutData; } #define MENU_APPEND ((sal_uInt16)0xFFFF) #define MENU_ITEM_NOTFOUND ((sal_uInt16)0xFFFF) -#define POPUPMENU_EXECUTE_DOWN ((sal_uInt16)0x0001) -#define POPUPMENU_EXECUTE_UP ((sal_uInt16)0x0002) -#define POPUPMENU_EXECUTE_LEFT ((sal_uInt16)0x0004) -#define POPUPMENU_EXECUTE_RIGHT ((sal_uInt16)0x0008) -#define POPUPMENU_NOMOUSEUPCLOSE ((sal_uInt16)0x0010) +// Must match the definitions in css::awt::PopupMenuDirection.idl +enum class PopupMenuFlags +{ + NONE = 0x0000, + ExecuteDown = 0x0001, + ExecuteUp = 0x0002, + ExecuteLeft = 0x0004, + ExecuteRight = 0x0008, + NoMouseUpClose = 0x0010, //If there isn't enough space to put the menu where it wants //to go, then they will be autoplaced. Toggle this bit //on to force menus to be placed either above or below //the starting rectangle and shrunk to fit and then scroll rather than place //the menu beside that rectangle -#define POPUPMENU_NOHORZ_PLACEMENT ((sal_uInt16)0x0020) + NoHorzPlacement = 0x0020, +}; +namespace o3tl +{ + template<> struct typed_flags<PopupMenuFlags> : is_typed_flags<PopupMenuFlags, 0x003f> {}; +} #define MENU_FLAG_NOAUTOMNEMONICS 0x0001 #define MENU_FLAG_HIDEDISABLEDENTRIES 0x0002 @@ -526,8 +536,8 @@ public: void SetText( const OUString& rTitle ) { aTitleText = rTitle; } const OUString& GetText() const { return aTitleText; } - sal_uInt16 Execute( vcl::Window* pWindow, const Point& rPopupPos ); - sal_uInt16 Execute( vcl::Window* pWindow, const Rectangle& rRect, sal_uInt16 nFlags = 0 ); + sal_uInt16 Execute( vcl::Window* pWindow, const Point& rPopupPos ); + sal_uInt16 Execute( vcl::Window* pWindow, const Rectangle& rRect, PopupMenuFlags nFlags = PopupMenuFlags::NONE ); // Fuer das TestTool void EndExecute( sal_uInt16 nSelect = 0 ); diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index b96b505bef27..77bf5a495731 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -392,7 +392,7 @@ IMPL_LINK_NOARG_TYPED(CommandToolBox, ToolBoxDropdownClickHdl, ToolBox *, void) { ScPopupMenu aPop( ScResId( RID_POPUP_DROPMODE ) ); aPop.CheckItem( RID_DROPMODE_URL + rDlg.GetDropMode() ); - aPop.Execute( this, GetItemRect(IID_DROPMODE), POPUPMENU_EXECUTE_DOWN ); + aPop.Execute( this, GetItemRect(IID_DROPMODE), PopupMenuFlags::ExecuteDown ); sal_uInt16 nId = aPop.GetSelected(); EndSelection(); // bevore SetDropMode (SetDropMode calls SetItemImage) diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 1835d444bc3a..36bf3318ac21 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -997,7 +997,7 @@ void AnnotationManagerImpl::ExecuteAnnotationContextMenu( Reference< XAnnotation } } - nId = pMenu->Execute( pParent, rContextRect, POPUPMENU_EXECUTE_DOWN|POPUPMENU_NOMOUSEUPCLOSE ); + nId = pMenu->Execute( pParent, rContextRect, PopupMenuFlags::ExecuteDown|PopupMenuFlags::NoMouseUpClose ); switch( nId ) { case SID_REPLYTO_POSTIT: diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 4b1a8b922259..016f9a10720f 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -361,7 +361,7 @@ IMPL_LINK_TYPED( SdNavigatorWin, DropdownClickToolBoxHdl, ToolBox*, pBox, void ) pMenu->CheckItem( (sal_uInt16)meDragType ); pMenu->SetSelectHdl( LINK( this, SdNavigatorWin, MenuSelectHdl ) ); - pMenu->Execute( this, maToolbox->GetItemRect( nId ), POPUPMENU_EXECUTE_DOWN ); + pMenu->Execute( this, maToolbox->GetItemRect( nId ), PopupMenuFlags::ExecuteDown ); pBox->EndSelection(); delete pMenu; } @@ -384,7 +384,7 @@ IMPL_LINK_TYPED( SdNavigatorWin, DropdownClickToolBoxHdl, ToolBox*, pBox, void ) pMenu->CheckItem(nShowNamedShapesFilter); pMenu->SetSelectHdl( LINK( this, SdNavigatorWin, ShapeFilterCallback ) ); - pMenu->Execute( this, maToolbox->GetItemRect( nId ), POPUPMENU_EXECUTE_DOWN ); + pMenu->Execute( this, maToolbox->GetItemRect( nId ), PopupMenuFlags::ExecuteDown ); pBox->EndSelection(); delete pMenu; } diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx index a60245646130..dd440ad449fc 100644 --- a/sd/source/ui/sidebar/LayoutMenu.cxx +++ b/sd/source/ui/sidebar/LayoutMenu.cxx @@ -626,7 +626,7 @@ void LayoutMenu::Command (const CommandEvent& rEvent) pMenu->EnableItem(SID_INSERTPAGE_LAYOUT_MENU, false); // Show the menu. - pMenu->Execute(this, Rectangle(aMenuPosition,Size(1,1)), POPUPMENU_EXECUTE_DOWN); + pMenu->Execute(this, Rectangle(aMenuPosition,Size(1,1)), PopupMenuFlags::ExecuteDown); } break; diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx index c91ea088e96e..0ac4680fbf5d 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx @@ -235,7 +235,7 @@ void MasterPagesSelector::Command (const CommandEvent& rEvent) ProcessPopupMenu(*pMenu); // Show the menu. - pMenu->Execute(this, Rectangle(aPosition,Size(1,1)), POPUPMENU_EXECUTE_DOWN); + pMenu->Execute(this, Rectangle(aPosition,Size(1,1)), PopupMenuFlags::ExecuteDown); } } break; diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 8e157e0ed122..e87de5b09b68 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -924,7 +924,7 @@ void DrawViewShell::ShowSnapLineContextMenu ( const sal_uInt16 nResult = pMenu->Execute( GetActiveWindow(), Rectangle(rMouseLocation, Size(10,10)), - POPUPMENU_EXECUTE_DOWN); + PopupMenuFlags::ExecuteDown); switch (nResult) { case SID_SET_SNAPITEM: diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index 1a735738471e..d7f822d028a7 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -975,7 +975,7 @@ namespace sfx2 // pass toolbox button rect so the menu can stay open on button up Rectangle aMenuRect( i_pToolBox->GetItemRect( m_nViewMenuID ) ); aMenuRect.SetPos( i_pToolBox->GetPosPixel() ); - pMenu->Execute( &m_rDockingWindow, aMenuRect, POPUPMENU_EXECUTE_DOWN ); + pMenu->Execute( &m_rDockingWindow, aMenuRect, PopupMenuFlags::ExecuteDown ); } } diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index ea8fe4dd369a..43a186a620ce 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -2502,7 +2502,7 @@ IMPL_LINK_TYPED( SfxTemplateDialog_Impl, ToolBoxRClick, ToolBox *, pBox, void ) pMenu->SetSelectHdl(LINK(this, SfxTemplateDialog_Impl, MenuSelectHdl)); pMenu->Execute( pBox, pBox->GetItemRect(nEntry), - POPUPMENU_EXECUTE_DOWN ); + PopupMenuFlags::ExecuteDown ); pBox->EndSelection(); } catch(uno::Exception&) diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index a2f01b66b57d..d86ffc0b09fe 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -508,7 +508,7 @@ IMPL_LINK_TYPED(SfxTemplateManagerDlg, TBXDropdownHdl, ToolBox*, pBox, void) { pBox->SetItemDown( nCurItemId, true ); - mpActionMenu->Execute(pBox, pBox->GetItemRect(nCurItemId), POPUPMENU_EXECUTE_DOWN); + mpActionMenu->Execute(pBox, pBox->GetItemRect(nCurItemId), PopupMenuFlags::ExecuteDown); pBox->SetItemDown( nCurItemId, false ); pBox->EndSelection(); @@ -533,7 +533,7 @@ IMPL_LINK_TYPED(SfxTemplateManagerDlg, TBXDropdownHdl, ToolBox*, pBox, void) pMoveMenu->InsertItem(MNI_MOVE_NEW, SfxResId(STR_MOVE_NEW)); - pMoveMenu->Execute(pBox, pBox->GetItemRect(nCurItemId), POPUPMENU_EXECUTE_DOWN); + pMoveMenu->Execute(pBox, pBox->GetItemRect(nCurItemId), PopupMenuFlags::ExecuteDown); delete pMoveMenu; @@ -545,7 +545,7 @@ IMPL_LINK_TYPED(SfxTemplateManagerDlg, TBXDropdownHdl, ToolBox*, pBox, void) { pBox->SetItemDown( nCurItemId, true ); - mpRepositoryMenu->Execute(pBox, pBox->GetItemRect(nCurItemId), POPUPMENU_EXECUTE_DOWN); + mpRepositoryMenu->Execute(pBox, pBox->GetItemRect(nCurItemId), PopupMenuFlags::ExecuteDown); pBox->SetItemDown( nCurItemId, false ); pBox->EndSelection(); diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index b7a32b013790..4115e884e5c5 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -816,7 +816,7 @@ void SidebarController::ShowPopupMenu ( // pass toolbox button rect so the menu can stay open on button up Rectangle aBox (rButtonBox); aBox.Move(mpTabBar->GetPosPixel().X(), 0); - pMenu->Execute(mpParentWindow, aBox, POPUPMENU_EXECUTE_DOWN); + pMenu->Execute(mpParentWindow, aBox, PopupMenuFlags::ExecuteDown); } ::boost::shared_ptr<PopupMenu> SidebarController::CreatePopupMenu ( diff --git a/svx/source/mnuctrls/clipboardctl.cxx b/svx/source/mnuctrls/clipboardctl.cxx index 6d183d81ded1..5b7255bff356 100644 --- a/svx/source/mnuctrls/clipboardctl.cxx +++ b/svx/source/mnuctrls/clipboardctl.cxx @@ -87,7 +87,7 @@ VclPtr<SfxPopupWindow> SvxClipBoardControl::CreatePopupWindow() pPopup->Execute( &rBox, rBox.GetItemRect( nId ), (rBox.GetAlign() == WINDOWALIGN_TOP || rBox.GetAlign() == WINDOWALIGN_BOTTOM) ? - POPUPMENU_EXECUTE_DOWN : POPUPMENU_EXECUTE_RIGHT ); + PopupMenuFlags::ExecuteDown : PopupMenuFlags::ExecuteRight ); rBox.SetItemDown( nId, false ); diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index 94a6f2777beb..cf96bd7cf800 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -256,7 +256,7 @@ IMPL_LINK( SwOutlineTabDialog, FormHdl, Button *, pBtn ) } pFormMenu->SetSelectHdl(LINK(this, SwOutlineTabDialog, MenuSelectHdl)); - pFormMenu->Execute(pBtn, Rectangle(Point(0,0), pBtn->GetSizePixel()), POPUPMENU_EXECUTE_DOWN); + pFormMenu->Execute(pBtn, Rectangle(Point(0,0), pBtn->GetSizePixel()), PopupMenuFlags::ExecuteDown); return 0; } diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx index 77fd2c321dbb..6456d6ecdc9d 100644 --- a/sw/source/uibase/ribbar/inputwin.cxx +++ b/sw/source/uibase/ribbar/inputwin.cxx @@ -348,7 +348,7 @@ IMPL_LINK_NOARG_TYPED(SwInputWindow, DropdownClickHdl, ToolBox *, void) { case FN_FORMULA_CALC : { - aPopMenu.Execute( this, GetItemRect( FN_FORMULA_CALC ), POPUPMENU_NOMOUSEUPCLOSE ); + aPopMenu.Execute( this, GetItemRect( FN_FORMULA_CALC ), PopupMenuFlags::NoMouseUpClose ); break; default: break; diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index 6bd6b5bd3da8..96a073a94620 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -216,7 +216,7 @@ VclPtr<SfxPopupWindow> SwTbxAutoTextCtrl::CreatePopupWindow() pPopup->Execute( pToolBox, pToolBox->GetItemRect( nId ), (pToolBox->GetAlign() == WINDOWALIGN_TOP || pToolBox->GetAlign() == WINDOWALIGN_BOTTOM) ? - POPUPMENU_EXECUTE_DOWN : POPUPMENU_EXECUTE_RIGHT ); + PopupMenuFlags::ExecuteDown : PopupMenuFlags::ExecuteRight ); pToolBox->SetItemDown( nId, false ); } @@ -313,7 +313,7 @@ VclPtr<SfxPopupWindow> SwTbxFieldCtrl::CreatePopupWindow() pPopup->Execute( pToolBox, pToolBox->GetItemRect( nId ), (pToolBox->GetAlign() == WINDOWALIGN_TOP || pToolBox->GetAlign() == WINDOWALIGN_BOTTOM) ? - POPUPMENU_EXECUTE_DOWN : POPUPMENU_EXECUTE_RIGHT ); + PopupMenuFlags::ExecuteDown : PopupMenuFlags::ExecuteRight ); pToolBox->SetItemDown( nId, false ); } diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index eae2d9d0f7b9..85c9c835d1d8 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -378,7 +378,7 @@ IMPL_LINK_TYPED( SwNavigationPI, ToolBoxDropdownClickHdl, ToolBox*, pBox, void ) pBox->SetItemDown( nCurrItemId, true ); pMenu->Execute( pBox, pBox->GetItemRect(FN_DROP_REGION), - POPUPMENU_EXECUTE_DOWN ); + PopupMenuFlags::ExecuteDown ); pBox->SetItemDown( nCurrItemId, false ); pBox->EndSelection(); pMenu.reset(); @@ -398,7 +398,7 @@ IMPL_LINK_TYPED( SwNavigationPI, ToolBoxDropdownClickHdl, ToolBox*, pBox, void ) pBox->SetItemDown( nCurrItemId, true ); pMenu->Execute( pBox, pBox->GetItemRect(FN_OUTLINE_LEVEL), - POPUPMENU_EXECUTE_DOWN ); + PopupMenuFlags::ExecuteDown ); pBox->SetItemDown( nCurrItemId, false ); pMenu.reset(); pBox->EndSelection(); diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index bd76ce30d7bd..e6a93f27b62d 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -539,7 +539,7 @@ throw(css::uno::RuntimeException, std::exception) { nRet = static_cast<PopupMenu*>(mpMenu)->Execute( VCLUnoHelper::GetWindow( rxWindowPeer ), VCLRectangle( rPos ), - nFlags | POPUPMENU_NOMOUSEUPCLOSE ); + static_cast<PopupMenuFlags>(nFlags) | PopupMenuFlags::NoMouseUpClose ); } return nRet; } diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx index 9e4525690825..c77663fb8a11 100644 --- a/vcl/source/control/menubtn.cxx +++ b/vcl/source/control/menubtn.cxx @@ -57,7 +57,7 @@ void MenuButton::ExecuteMenu() Rectangle aRect( aPos, aSize ); SetPressed( true ); EndSelection(); - mnCurItemId = mpMenu->Execute( this, aRect, POPUPMENU_EXECUTE_DOWN ); + mnCurItemId = mpMenu->Execute( this, aRect, PopupMenuFlags::ExecuteDown ); SetPressed( false ); if ( mnCurItemId ) { diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index f3defdd42943..d2d45d7b9d8d 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2867,29 +2867,29 @@ void PopupMenu::SetSelectedEntry( sal_uInt16 nId ) sal_uInt16 PopupMenu::Execute( vcl::Window* pExecWindow, const Point& rPopupPos ) { - return Execute( pExecWindow, Rectangle( rPopupPos, rPopupPos ), POPUPMENU_EXECUTE_DOWN ); + return Execute( pExecWindow, Rectangle( rPopupPos, rPopupPos ), PopupMenuFlags::ExecuteDown ); } -sal_uInt16 PopupMenu::Execute( vcl::Window* pExecWindow, const Rectangle& rRect, sal_uInt16 nFlags ) +sal_uInt16 PopupMenu::Execute( vcl::Window* pExecWindow, const Rectangle& rRect, PopupMenuFlags nFlags ) { ENSURE_OR_RETURN( pExecWindow, "PopupMenu::Execute: need a non-NULL window!", 0 ); FloatWinPopupFlags nPopupModeFlags = FloatWinPopupFlags::NONE; - if ( nFlags & POPUPMENU_EXECUTE_DOWN ) + if ( nFlags & PopupMenuFlags::ExecuteDown ) nPopupModeFlags = FloatWinPopupFlags::Down; - else if ( nFlags & POPUPMENU_EXECUTE_UP ) + else if ( nFlags & PopupMenuFlags::ExecuteUp ) nPopupModeFlags = FloatWinPopupFlags::Up; - else if ( nFlags & POPUPMENU_EXECUTE_LEFT ) + else if ( nFlags & PopupMenuFlags::ExecuteLeft ) nPopupModeFlags = FloatWinPopupFlags::Left; - else if ( nFlags & POPUPMENU_EXECUTE_RIGHT ) + else if ( nFlags & PopupMenuFlags::ExecuteRight ) nPopupModeFlags = FloatWinPopupFlags::Right; else nPopupModeFlags = FloatWinPopupFlags::Down; - if (nFlags & POPUPMENU_NOMOUSEUPCLOSE ) // allow popup menus to stay open on mouse button up + if (nFlags & PopupMenuFlags::NoMouseUpClose ) // allow popup menus to stay open on mouse button up nPopupModeFlags |= FloatWinPopupFlags::NoMouseUpClose; // useful if the menu was opened on mousebutton down (eg toolbox configuration) - if (nFlags & POPUPMENU_NOHORZ_PLACEMENT) + if (nFlags & PopupMenuFlags::NoHorzPlacement) nPopupModeFlags |= FloatWinPopupFlags::NoHorzPlacement; return ImplExecute( pExecWindow, rRect, nPopupModeFlags, 0, false ); diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index d06291c46f24..f6f3dab8790f 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -1913,7 +1913,7 @@ void ToolBox::ImplExecuteCustomMenu() } sal_uInt16 uId = GetMenu()->Execute( pWin, Rectangle( ImplGetPopupPosition( aMenuRect, Size() ), Size() ), - POPUPMENU_EXECUTE_DOWN | POPUPMENU_NOMOUSEUPCLOSE ); + PopupMenuFlags::ExecuteDown | PopupMenuFlags::NoMouseUpClose ); if ( aDelData.IsDead() ) return; |