[Libreoffice-commits] core.git: 2 commits - extensions/source include/vcl sc/source sd/source sfx2/source svtools/source svx/source sw/source vcl/inc vcl/source vcl/unx

Noel Grandin noel at peralex.com
Wed May 13 00:26:22 PDT 2015


 extensions/source/propctrlr/standardcontrol.cxx       |    2 
 include/vcl/dockwin.hxx                               |    4 
 include/vcl/floatwin.hxx                              |   81 ++++++----
 include/vcl/menu.hxx                                  |    3 
 sc/source/ui/cctrl/checklistmenu.cxx                  |   14 -
 sc/source/ui/view/gridwin.cxx                         |    4 
 sd/source/ui/annotations/annotationtag.cxx            |    2 
 sd/source/ui/sidebar/LayoutMenu.cxx                   |    2 
 sd/source/ui/sidebar/MasterPagesSelector.cxx          |    2 
 sfx2/source/dialog/taskpane.cxx                       |    2 
 sfx2/source/sidebar/SidebarController.cxx             |    2 
 svtools/source/control/calendar.cxx                   |    4 
 svtools/source/uno/popupwindowcontroller.cxx          |    8 -
 svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx |    2 
 svx/source/sidebar/tools/Popup.cxx                    |    4 
 svx/source/tbxctrls/layctrl.cxx                       |   26 +--
 svx/source/tbxctrls/lboxctrl.cxx                      |    6 
 svx/source/tbxctrls/linectrl.cxx                      |    6 
 svx/source/tbxctrls/tbcontrl.cxx                      |   14 -
 sw/source/uibase/ribbar/workctrl.cxx                  |    2 
 sw/source/uibase/uiview/viewling.cxx                  |    2 
 sw/source/uibase/utlui/navipi.cxx                     |    4 
 vcl/inc/salmenu.hxx                                   |    2 
 vcl/source/app/salvtables.cxx                         |    2 
 vcl/source/control/ilstbox.cxx                        |    4 
 vcl/source/window/brdwin.cxx                          |    2 
 vcl/source/window/dockmgr.cxx                         |   18 +-
 vcl/source/window/floatwin.cxx                        |  141 +++++++++---------
 vcl/source/window/menu.cxx                            |   36 ++--
 vcl/source/window/menubarwindow.cxx                   |    2 
 vcl/source/window/menufloatingwindow.cxx              |   12 -
 vcl/source/window/toolbox.cxx                         |    4 
 vcl/source/window/winproc.cxx                         |   38 ++--
 vcl/unx/generic/window/salframe.cxx                   |    8 -
 vcl/unx/gtk/window/gtksalframe.cxx                    |    4 
 35 files changed, 244 insertions(+), 225 deletions(-)

New commits:
commit 666f42854e04141541227d88130ff3338aff07b6
Author: Noel Grandin <noel at peralex.com>
Date:   Wed May 13 08:44:58 2015 +0200

    convert FLOATWIN_POPUPMODEEND constants to scoped enum
    
    Change-Id: I36fea4608c744c941bdff401b649fa46302b4dbd

diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx
index d02b191..2a35d6e 100644
--- a/include/vcl/floatwin.hxx
+++ b/include/vcl/floatwin.hxx
@@ -58,10 +58,18 @@ namespace o3tl
     template<> struct typed_flags<FloatWinPopupFlags> : is_typed_flags<FloatWinPopupFlags, 0x03ffff> {};
 }
 
-#define FLOATWIN_POPUPMODEEND_CANCEL            ((sal_uInt16)0x0001)
-#define FLOATWIN_POPUPMODEEND_TEAROFF           ((sal_uInt16)0x0002)
-#define FLOATWIN_POPUPMODEEND_DONTCALLHDL       ((sal_uInt16)0x0004)
-#define FLOATWIN_POPUPMODEEND_CLOSEALL          ((sal_uInt16)0x0008)
+enum class FloatWinPopupEndFlags
+{
+    NONE              = 0x00,
+    Cancel            = 0x01,
+    TearOff           = 0x02,
+    DontCallHdl       = 0x04,
+    CloseAll          = 0x08,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<FloatWinPopupEndFlags> : is_typed_flags<FloatWinPopupEndFlags, 0x0f> {};
+}
 
 #define FLOATWIN_TITLE_NORMAL                   ((sal_uInt16)0x0001)
 #define FLOATWIN_TITLE_TEAROFF                  ((sal_uInt16)0x0002)
@@ -121,7 +129,7 @@ public:
     SAL_DLLPRIVATE static Point     ImplCalcPos( vcl::Window* pWindow,
                                                  const Rectangle& rRect, FloatWinPopupFlags nFlags,
                                                  sal_uInt16& rArrangeIndex );
-    SAL_DLLPRIVATE void             ImplEndPopupMode( sal_uInt16 nFlags = 0, sal_uLong nFocusId = 0 );
+    SAL_DLLPRIVATE void             ImplEndPopupMode( FloatWinPopupEndFlags nFlags = FloatWinPopupEndFlags::NONE, sal_uLong nFocusId = 0 );
     SAL_DLLPRIVATE Rectangle&       ImplGetItemEdgeClipRect();
     SAL_DLLPRIVATE bool             ImplIsInPrivatePopupMode() const { return mbInPopupMode; }
     virtual        void             doDeferredInit(WinBits nBits) SAL_OVERRIDE;
@@ -144,7 +152,7 @@ public:
 
     void            StartPopupMode( const Rectangle& rRect, FloatWinPopupFlags nFlags = FloatWinPopupFlags::NONE );
     void            StartPopupMode( ToolBox* pBox, FloatWinPopupFlags nFlags = FloatWinPopupFlags::NONE  );
-    void            EndPopupMode( sal_uInt16 nFlags = 0 );
+    void            EndPopupMode( FloatWinPopupEndFlags nFlags = FloatWinPopupEndFlags::NONE );
     void            AddPopupModeWindow( vcl::Window* pWindow );
     FloatWinPopupFlags GetPopupModeFlags() const { return mnPopupModeFlags; }
     void            SetPopupModeFlags( FloatWinPopupFlags nFlags ) { mnPopupModeFlags = nFlags; }
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index 74fb59f..24f5e6a 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -2365,7 +2365,7 @@ bool CalendarField::ShowDropDown( bool bShow )
     }
     else
     {
-        mpFloatWin->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL );
+        mpFloatWin->EndPopupMode( FloatWinPopupEndFlags::Cancel );
         mpCalendar->EndSelection();
         EndDropDown();
     }
diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index cf47480..40e1951 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -203,7 +203,7 @@ void TableWindow::KeyInput( const KeyEvent& rKEvt )
                 if ( nNewLine > 1 )
                     nNewLine--;
                 else
-                    EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL );
+                    EndPopupMode( FloatWinPopupEndFlags::Cancel );
                 break;
             case KEY_DOWN:
                 if ( nNewLine < TABLE_CELLS_VERT )
@@ -215,7 +215,7 @@ void TableWindow::KeyInput( const KeyEvent& rKEvt )
                 if ( nNewCol > 1 )
                     nNewCol--;
                 else
-                    EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL );
+                    EndPopupMode( FloatWinPopupEndFlags::Cancel );
                 break;
             case KEY_RIGHT:
                 if ( nNewCol < TABLE_CELLS_HORIZ )
@@ -224,10 +224,10 @@ void TableWindow::KeyInput( const KeyEvent& rKEvt )
                     CloseAndShowTableDialog();
                 break;
             case KEY_ESCAPE:
-                EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL );
+                EndPopupMode( FloatWinPopupEndFlags::Cancel );
                 break;
             case KEY_RETURN:
-                EndPopupMode( FLOATWIN_POPUPMODEEND_CLOSEALL );
+                EndPopupMode( FloatWinPopupEndFlags::CloseAll );
                 break;
             case KEY_TAB:
                 CloseAndShowTableDialog();
@@ -252,7 +252,7 @@ void TableWindow::KeyInput( const KeyEvent& rKEvt )
     else if(KEY_MOD1 == nModifier && KEY_RETURN == nKey)
     {
         m_bMod1 = true;
-        EndPopupMode( FLOATWIN_POPUPMODEEND_CLOSEALL );
+        EndPopupMode( FloatWinPopupEndFlags::CloseAll );
     }
 
     if(!bHandled)
@@ -264,7 +264,7 @@ void TableWindow::KeyInput( const KeyEvent& rKEvt )
 void TableWindow::MouseButtonUp( const MouseEvent& rMEvt )
 {
     SfxPopupWindow::MouseButtonUp( rMEvt );
-    EndPopupMode( FLOATWIN_POPUPMODEEND_CLOSEALL );
+    EndPopupMode( FloatWinPopupEndFlags::CloseAll );
 }
 
 
@@ -401,7 +401,7 @@ void TableWindow::TableDialog( const Sequence< PropertyValue >& rArgs )
 void TableWindow::CloseAndShowTableDialog()
 {
     // close the toolbar tool
-    EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL );
+    EndPopupMode( FloatWinPopupEndFlags::Cancel );
 
     // and open the table dialog instead
     TableDialog( Sequence< PropertyValue >() );
@@ -595,11 +595,11 @@ void ColumnsWindow::KeyInput( const KeyEvent& rKEvt )
                 case KEY_RETURN :
                     if(IsMouseCaptured())
                         ReleaseMouse();
-                    EndPopupMode(FLOATWIN_POPUPMODEEND_CLOSEALL );
+                    EndPopupMode(FloatWinPopupEndFlags::CloseAll );
                 break;
                 case KEY_ESCAPE :
                 case KEY_UP :
-                    EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL);
+                    EndPopupMode( FloatWinPopupEndFlags::Cancel);
                 break;
             }
             //make sure that a table can initially be created
@@ -617,7 +617,7 @@ void ColumnsWindow::KeyInput( const KeyEvent& rKEvt )
         m_bMod1 = true;
         if(IsMouseCaptured())
             ReleaseMouse();
-        EndPopupMode(FLOATWIN_POPUPMODEEND_CLOSEALL );
+        EndPopupMode(FloatWinPopupEndFlags::CloseAll );
     }
     if(!bHandled)
         SfxPopupWindow::KeyInput(rKEvt);
@@ -631,7 +631,7 @@ void ColumnsWindow::MouseButtonUp( const MouseEvent& rMEvt )
     ReleaseMouse();
 
     if ( IsInPopupMode() )
-        EndPopupMode( FLOATWIN_POPUPMODEEND_CLOSEALL );
+        EndPopupMode( FloatWinPopupEndFlags::CloseAll );
 }
 
 
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index d83a587..b4f0921 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -225,7 +225,7 @@ IMPL_LINK_NOARG(SvxListBoxControl, SelectHdl)
         else
         {
             pPopupWin->SetUserSelected( true );
-            pPopupWin->EndPopupMode( 0 );
+            pPopupWin->EndPopupMode();
         }
     }
     return 0;
diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index 142a174..6bd6b5b 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -524,7 +524,7 @@ void SwScrollNaviToolBox::MouseButtonUp( const MouseEvent& rMEvt )
 {
     ToolBox::MouseButtonUp(rMEvt);
     if (m_pNaviPopup->IsInPopupMode())
-        m_pNaviPopup->EndPopupMode(FLOATWIN_POPUPMODEEND_CLOSEALL);
+        m_pNaviPopup->EndPopupMode(FloatWinPopupEndFlags::CloseAll);
 }
 
 void  SwScrollNaviToolBox::RequestHelp( const HelpEvent& rHEvt )
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 2bbacde..eae2d9d 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -437,7 +437,7 @@ void SwNavigationPI::CreateNavigationTool(const Rectangle& rRect, bool bSetFocus
     SetPopupWindow( pPopup );
     if(bSetFocus)
     {
-        pPopup->EndPopupMode(FLOATWIN_POPUPMODEEND_TEAROFF);
+        pPopup->EndPopupMode(FloatWinPopupEndFlags::TearOff);
         pPopup->GrabFocus();
     }
 }
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 38fd84c..1548757 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -595,7 +595,7 @@ bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const Track
                 if ( pBorderWindow->ImplGetClientWindow()->ImplIsFloatingWindow() )
                 {
                     if ( static_cast<FloatingWindow*>(pBorderWindow->ImplGetClientWindow())->IsInPopupMode() )
-                        static_cast<FloatingWindow*>(pBorderWindow->ImplGetClientWindow())->EndPopupMode( FLOATWIN_POPUPMODEEND_TEAROFF );
+                        static_cast<FloatingWindow*>(pBorderWindow->ImplGetClientWindow())->EndPopupMode( FloatWinPopupEndFlags::TearOff );
                 }
             }
         }
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index 2d8d937..1931592d 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -778,7 +778,7 @@ void ImplPopupFloatWin::Tracking( const TrackingEvent& rTEvt )
         if ( rTEvt.IsTrackingEnded() )
         {
             mbMoving = false;
-            EndPopupMode( FLOATWIN_POPUPMODEEND_TEAROFF );
+            EndPopupMode( FloatWinPopupEndFlags::TearOff );
         }
         else if ( !rTEvt.GetMouseEvent().IsSynthetic() )
         {
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index f66f92e..34d1023 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -203,7 +203,7 @@ void FloatingWindow::dispose()
             SetDialogControlFlags( GetDialogControlFlags() | WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL );
 
         if ( IsInPopupMode() )
-            EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL | FLOATWIN_POPUPMODEEND_DONTCALLHDL );
+            EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll | FloatWinPopupEndFlags::DontCallHdl );
 
         if ( mnPostId )
             Application::RemoveUserEvent( mnPostId );
@@ -745,7 +745,7 @@ void FloatingWindow::StartPopupMode( ToolBox* pBox, FloatWinPopupFlags nFlags )
     StartPopupMode( aRect, nFlags );
 }
 
-void FloatingWindow::ImplEndPopupMode( sal_uInt16 nFlags, sal_uLong nFocusId )
+void FloatingWindow::ImplEndPopupMode( FloatWinPopupEndFlags nFlags, sal_uLong nFocusId )
 {
     if ( !mbInPopupMode )
         return;
@@ -756,7 +756,7 @@ void FloatingWindow::ImplEndPopupMode( sal_uInt16 nFlags, sal_uLong nFocusId )
 
     // stop the PopupMode also for all following PopupMode windows
     while ( pSVData->maWinData.mpFirstFloat && pSVData->maWinData.mpFirstFloat.get() != this )
-        pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL );
+        pSVData->maWinData.mpFirstFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel );
 
     // delete window from the list
     pSVData->maWinData.mpFirstFloat = mpNextFloat;
@@ -765,7 +765,7 @@ void FloatingWindow::ImplEndPopupMode( sal_uInt16 nFlags, sal_uLong nFocusId )
     FloatWinPopupFlags nPopupModeFlags = mnPopupModeFlags;
 
     // hide window again if it was not deleted
-    if ( !(nFlags & FLOATWIN_POPUPMODEEND_TEAROFF) ||
+    if ( !(nFlags & FloatWinPopupEndFlags::TearOff) ||
          !(nPopupModeFlags & FloatWinPopupFlags::AllowTearOff) )
     {
         Show( false, SHOW_NOFOCUSCHANGE );
@@ -786,7 +786,7 @@ void FloatingWindow::ImplEndPopupMode( sal_uInt16 nFlags, sal_uLong nFocusId )
     }
     EnableSaveBackground( mbOldSaveBackMode );
 
-    mbPopupModeCanceled = (nFlags & FLOATWIN_POPUPMODEEND_CANCEL) != 0;
+    mbPopupModeCanceled = bool(nFlags & FloatWinPopupEndFlags::Cancel);
 
     // redo title
     SetTitleType( mnOldTitle );
@@ -799,18 +799,18 @@ void FloatingWindow::ImplEndPopupMode( sal_uInt16 nFlags, sal_uLong nFocusId )
     }
 
     // call PopupModeEnd-Handler depending on parameter
-    if ( !(nFlags & FLOATWIN_POPUPMODEEND_DONTCALLHDL) )
+    if ( !(nFlags & FloatWinPopupEndFlags::DontCallHdl) )
         ImplCallPopupModeEnd();
 
     // close all other windows depending on parameter
-    if ( nFlags & FLOATWIN_POPUPMODEEND_CLOSEALL )
+    if ( nFlags & FloatWinPopupEndFlags::CloseAll )
     {
         if ( !(nPopupModeFlags & FloatWinPopupFlags::NewLevel) )
         {
             if ( pSVData->maWinData.mpFirstFloat )
             {
                 FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
-                pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
+                pLastLevelFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
             }
         }
     }
@@ -818,7 +818,7 @@ void FloatingWindow::ImplEndPopupMode( sal_uInt16 nFlags, sal_uLong nFocusId )
     mbInCleanUp = false;
 }
 
-void FloatingWindow::EndPopupMode( sal_uInt16 nFlags )
+void FloatingWindow::EndPopupMode( FloatWinPopupEndFlags nFlags )
 {
     ImplEndPopupMode( nFlags );
 }
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 762eaa2..0731254 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2857,7 +2857,7 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, Floa
     {
         // assure that only one menu is open at a time
         if (pStartedFrom->IsMenuBar() && pSVData->maWinData.mpFirstFloat)
-            pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
+            pSVData->maWinData.mpFirstFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
     }
 
     DBG_ASSERT( !ImplGetWindow(), "Win?!" );
@@ -3060,7 +3060,7 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, Floa
             pWin->SetFocusId( 0 );
             pSVData->maWinData.mbNoDeactivate = false;
         }
-        pWin->ImplEndPopupMode( 0, nFocusId );
+        pWin->ImplEndPopupMode( FloatWinPopupEndFlags::NONE, nFocusId );
 
         if ( nSelectedId )  // then clean up .. ( otherwise done by TH )
         {
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx
index 4345e16..3221294 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -392,7 +392,7 @@ void MenuFloatingWindow::StopExecute( sal_uLong nFocusId )
             ImplGetSVData()->maWinData.mbNoDeactivate = false;
         }
     }
-    ImplEndPopupMode( 0, nFocusId );
+    ImplEndPopupMode( FloatWinPopupEndFlags::NONE, nFocusId );
 
     aHighlightChangedTimer.Stop();
     bInExecute = false;
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index ca0eca0..34f3d0e 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1588,7 +1588,7 @@ void ToolBox::dispose()
     // terminate popupmode if the floating window is
     // still connected
     if ( mpFloatWin )
-        mpFloatWin->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL );
+        mpFloatWin->EndPopupMode( FloatWinPopupEndFlags::Cancel );
     mpFloatWin = NULL;
 
     // delete private data
@@ -4988,7 +4988,7 @@ bool ImplCloseLastPopup( vcl::Window *pParent )
         // only close the floater if it is not our direct parent, which would kill ourself
         if( pLastLevelFloat && pLastLevelFloat != pParent )
         {
-            pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
+            pLastLevelFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
             return true;
         }
     }
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 2f5d8b5..ccbbb62 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -100,7 +100,7 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
                     {
                         pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
                         nPopupFlags = pLastLevelFloat->GetPopupModeFlags();
-                        pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
+                        pLastLevelFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
                         return true;
                     }
                     else if ( nHitTest == HITTEST_RECT )
@@ -117,7 +117,7 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
                         if ( nHitTest == HITTEST_RECT )
                         {
                             if ( pFloat->ImplIsMouseDown() )
-                                pFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL );
+                                pFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel );
                             return true;
                         }
                     }
@@ -127,7 +127,7 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
                         nPopupFlags = pLastLevelFloat->GetPopupModeFlags();
                         if ( !(nPopupFlags & FloatWinPopupFlags::NoMouseUpClose) )
                         {
-                            pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
+                            pLastLevelFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
                             return true;
                         }
                     }
@@ -144,7 +144,7 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
                         if ( (nPopupFlags & FloatWinPopupFlags::NoMouseUpClose) &&
                              (nSVEvent == MouseNotifyEvent::MOUSEBUTTONUP) )
                             return true;
-                        pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
+                        pLastLevelFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
                         return true;
                     }
                     else
@@ -958,7 +958,7 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent,
                         sal_uInt16 nEscCode = aKeyCode.GetCode();
 
                         if ( nEscCode == KEY_ESCAPE )
-                            pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
+                            pLastLevelFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
                     }
                 }
                 return true;
@@ -982,7 +982,7 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent,
 
                 if ( (nCode == KEY_ESCAPE) || bCtrlF6)
                 {
-                    pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
+                    pLastLevelFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
                     if( !bCtrlF6 )
                         return true;
                 }
@@ -1652,7 +1652,7 @@ static void KillOwnPopups( vcl::Window* pWindow )
     if ( pChild && pParent->ImplIsWindowOrChild( pChild, true ) )
     {
         if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoAppFocusClose) )
-            pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
+            pSVData->maWinData.mpFirstFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
     }
 }
 
@@ -1727,7 +1727,7 @@ static void ImplHandleMove( vcl::Window* pWindow )
 {
     if( pWindow->ImplGetWindowImpl()->mbFrame && pWindow->ImplIsFloatingWindow() && pWindow->IsReallyVisible() )
     {
-        static_cast<FloatingWindow*>(pWindow)->EndPopupMode( FLOATWIN_POPUPMODEEND_TEAROFF );
+        static_cast<FloatingWindow*>(pWindow)->EndPopupMode( FloatWinPopupEndFlags::TearOff );
         pWindow->ImplCallMove();
     }
 
@@ -1917,7 +1917,7 @@ static void ImplHandleLoseFocus( vcl::Window* pWindow )
     if ( pSVData->maWinData.mpFirstFloat )
     {
         if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoAppFocusClose) )
-            pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
+            pSVData->maWinData.mpFirstFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
     }
 
     pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = false;
@@ -1975,7 +1975,7 @@ void ImplHandleClose( vcl::Window* pWindow )
     {
         FloatingWindow* pLastLevelFloat;
         pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
-        pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
+        pLastLevelFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
     }
     if ( pSVData->maHelpData.mbExtHelpMode )
         Help::EndExtHelp();
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 06d4748..610314a 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -2989,7 +2989,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
         {
             static const char* pEnv = getenv( "SAL_FLOATWIN_NOAPPFOCUSCLOSE" );
             if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoAppFocusClose) && !(pEnv && *pEnv) )
-                pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
+                pSVData->maWinData.mpFirstFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
         }
     }
 
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index e349aa1..7fea4a9 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -3293,7 +3293,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
             {
                 static const char* pEnv = getenv( "SAL_FLOATWIN_NOAPPFOCUSCLOSE" );
                 if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoAppFocusClose) && !(pEnv && *pEnv) )
-                    pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
+                    pSVData->maWinData.mpFirstFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
             }
         }
 
commit facc91ab4a3f25b3290408c7083ed4c09dd8d759
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 12 15:30:22 2015 +0200

    convert FLOATWIN_POPUPMODE constants to scoped enum
    
    Change-Id: I744d430ef6a506977eb10b892582c8969ec27524

diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index 6a69e92..2f14daf 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -1217,7 +1217,7 @@ namespace pcr
             ::Rectangle aRect(aMePos,aSize);
             aSize.Height() = STD_HEIGHT;
             m_pFloatingEdit->SetOutputSizePixel(aSize);
-            m_pFloatingEdit->StartPopupMode( aRect, FLOATWIN_POPUPMODE_DOWN );
+            m_pFloatingEdit->StartPopupMode( aRect, FloatWinPopupFlags::Down );
 
             m_pFloatingEdit->Show();
             m_pFloatingEdit->getEdit().GrabFocus();
diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx
index a1617d1..9965ebd 100644
--- a/include/vcl/dockwin.hxx
+++ b/include/vcl/dockwin.hxx
@@ -143,7 +143,7 @@ public:
     void            Unlock();
     bool            IsLocked() const { return mbLocked;}
 
-    void            StartPopupMode( ToolBox* pParentToolBox, sal_uLong nPopupModeFlags );
+    void            StartPopupMode( ToolBox* pParentToolBox, FloatWinPopupFlags nPopupModeFlags );
     bool            IsInPopupMode() const;
 
     void            TitleButtonClick( sal_uInt16 nButton );
@@ -202,7 +202,7 @@ public:
     bool IsLocked( const vcl::Window *pWin );
 
     void    StartPopupMode( ToolBox *pParentToolBox, const vcl::Window *pWin );
-    void    StartPopupMode( ToolBox *pParentToolBox, const vcl::Window *pWin, sal_uLong nPopupModeFlags );
+    void    StartPopupMode( ToolBox *pParentToolBox, const vcl::Window *pWin, FloatWinPopupFlags nPopupModeFlags );
 
     bool    IsInPopupMode( const vcl::Window *pWin );
     void    EndPopupMode( const vcl::Window *pWin );
diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx
index fb542dd..d02b191 100644
--- a/include/vcl/floatwin.hxx
+++ b/include/vcl/floatwin.hxx
@@ -23,6 +23,7 @@
 #include <tools/solar.h>
 #include <vcl/dllapi.h>
 #include <vcl/syswin.hxx>
+#include <o3tl/typed_flags_set.hxx>
 
 class ToolBox;
 
@@ -30,24 +31,32 @@ class ToolBox;
 // - FloatingWindow-Types -
 
 
-#define FLOATWIN_POPUPMODE_ALLOWTEAROFF         ((sal_uLong)0x00000001)
-#define FLOATWIN_POPUPMODE_ANIMATIONSLIDE       ((sal_uLong)0x00000002)
-#define FLOATWIN_POPUPMODE_NOAUTOARRANGE        ((sal_uLong)0x00000004)
-#define FLOATWIN_POPUPMODE_NOANIMATION          ((sal_uLong)0x00000008)
-#define FLOATWIN_POPUPMODE_DOWN                 ((sal_uLong)0x00000010)
-#define FLOATWIN_POPUPMODE_UP                   ((sal_uLong)0x00000020)
-#define FLOATWIN_POPUPMODE_LEFT                 ((sal_uLong)0x00000040)
-#define FLOATWIN_POPUPMODE_RIGHT                ((sal_uLong)0x00000080)
-#define FLOATWIN_POPUPMODE_NOFOCUSCLOSE         ((sal_uLong)0x00000100)
-#define FLOATWIN_POPUPMODE_NOKEYCLOSE           ((sal_uLong)0x00000200)
-#define FLOATWIN_POPUPMODE_NOMOUSECLOSE         ((sal_uLong)0x00000400)
-#define FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE     ((sal_uLong)0x00000800)
-#define FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE  ((sal_uLong)0x00001000)
-#define FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE      ((sal_uLong)0x00002000)
-#define FLOATWIN_POPUPMODE_NEWLEVEL             ((sal_uLong)0x00004000)
-#define FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE       ((sal_uLong)0x00008000)
-#define FLOATWIN_POPUPMODE_GRABFOCUS            ((sal_uLong)0x00010000)
-#define FLOATWIN_POPUPMODE_NOHORZPLACEMENT      ((sal_uLong)0x00020000)
+enum class FloatWinPopupFlags
+{
+    NONE                 = 0x000000,
+    AllowTearOff         = 0x000001,
+    AnimationSlide       = 0x000002,
+    NoAutoArrange        = 0x000004,
+    NoAnimation          = 0x000008,
+    Down                 = 0x000010,
+    Up                   = 0x000020,
+    Left                 = 0x000040,
+    Right                = 0x000080,
+    NoFocusClose         = 0x000100,
+    NoKeyClose           = 0x000200,
+    NoMouseClose         = 0x000400,
+    NoMouseRectClose     = 0x000800,
+    AllMouseButtonClose  = 0x001000,
+    NoAppFocusClose      = 0x002000,
+    NewLevel             = 0x004000,
+    NoMouseUpClose       = 0x008000,
+    GrabFocus            = 0x010000,
+    NoHorzPlacement      = 0x020000,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<FloatWinPopupFlags> : is_typed_flags<FloatWinPopupFlags, 0x03ffff> {};
+}
 
 #define FLOATWIN_POPUPMODEEND_CANCEL            ((sal_uInt16)0x0001)
 #define FLOATWIN_POPUPMODEEND_TEAROFF           ((sal_uInt16)0x0002)
@@ -78,7 +87,7 @@ private:
     ImplData*       mpImplData;
     Rectangle       maFloatRect;
     ImplSVEvent *   mnPostId;
-    sal_uLong           mnPopupModeFlags;
+    FloatWinPopupFlags   mnPopupModeFlags;
     sal_uInt16          mnTitle;
     sal_uInt16          mnOldTitle;
     bool            mbInPopupMode;
@@ -110,7 +119,7 @@ public:
     SAL_DLLPRIVATE void             ImplSetMouseDown() { mbMouseDown = true; }
     SAL_DLLPRIVATE bool             ImplIsMouseDown() const  { return mbMouseDown; }
     SAL_DLLPRIVATE static Point     ImplCalcPos( vcl::Window* pWindow,
-                                                 const Rectangle& rRect, sal_uLong nFlags,
+                                                 const Rectangle& rRect, FloatWinPopupFlags nFlags,
                                                  sal_uInt16& rArrangeIndex );
     SAL_DLLPRIVATE void             ImplEndPopupMode( sal_uInt16 nFlags = 0, sal_uLong nFocusId = 0 );
     SAL_DLLPRIVATE Rectangle&       ImplGetItemEdgeClipRect();
@@ -133,12 +142,12 @@ public:
     void            SetTitleType( sal_uInt16 nTitle );
     sal_uInt16      GetTitleType() const { return mnTitle; }
 
-    void            StartPopupMode( const Rectangle& rRect, sal_uLong nFlags = 0 );
-    void            StartPopupMode( ToolBox* pBox, sal_uLong nFlags = 0  );
+    void            StartPopupMode( const Rectangle& rRect, FloatWinPopupFlags nFlags = FloatWinPopupFlags::NONE );
+    void            StartPopupMode( ToolBox* pBox, FloatWinPopupFlags nFlags = FloatWinPopupFlags::NONE  );
     void            EndPopupMode( sal_uInt16 nFlags = 0 );
     void            AddPopupModeWindow( vcl::Window* pWindow );
-    sal_uLong           GetPopupModeFlags() const { return mnPopupModeFlags; }
-    void            SetPopupModeFlags( sal_uLong nFlags ) { mnPopupModeFlags = nFlags; }
+    FloatWinPopupFlags GetPopupModeFlags() const { return mnPopupModeFlags; }
+    void            SetPopupModeFlags( FloatWinPopupFlags nFlags ) { mnPopupModeFlags = nFlags; }
     bool            IsInPopupMode() const { return mbPopupMode; }
     bool            IsInCleanUp() const { return mbInCleanUp; }
     bool            IsPopupModeCanceled() const { return mbPopupModeCanceled; }
@@ -149,7 +158,7 @@ public:
 
     bool            GrabsFocus() const { return mbGrabFocus; }
 
-    static Point    CalcFloatingPosition( vcl::Window* pWindow, const Rectangle& rRect, sal_uLong nFlags, sal_uInt16& rArrangeIndex );
+    static Point    CalcFloatingPosition( vcl::Window* pWindow, const Rectangle& rRect, FloatWinPopupFlags nFlags, sal_uInt16& rArrangeIndex );
 };
 
 #endif // INCLUDED_VCL_FLOATWIN_HXX
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 7c570f0..24c716d 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -48,6 +48,7 @@ namespace vcl { class Window; }
 class SalMenu;
 class IMenuBarWindow;
 struct SystemMenuData;
+enum class FloatWinPopupFlags;
 
 namespace com {
 namespace sun {
@@ -503,7 +504,7 @@ private:
     SAL_DLLPRIVATE MenuFloatingWindow * ImplGetFloatingWindow() const;
 
 protected:
-    SAL_DLLPRIVATE sal_uInt16                ImplExecute( vcl::Window* pWindow, const Rectangle& rRect, sal_uLong nPopupFlags, Menu* pStaredFrom, bool bPreSelectFirst );
+    SAL_DLLPRIVATE sal_uInt16                ImplExecute( vcl::Window* pWindow, const Rectangle& rRect, FloatWinPopupFlags nPopupFlags, Menu* pStaredFrom, bool bPreSelectFirst );
     SAL_DLLPRIVATE long                  ImplCalcHeight( sal_uInt16 nEntries ) const;
     SAL_DLLPRIVATE sal_uInt16                ImplCalcVisEntries( long nMaxHeight, sal_uInt16 nStartEntry = 0, sal_uInt16* pLastVisible = NULL ) const;
 
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 6944b3b..8dd50aa 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -557,11 +557,11 @@ void ScMenuFloatingWindow::launchSubMenu(bool bSetMenuPos)
     if (!pSubMenu)
         return;
 
-    sal_uInt32 nOldFlags = GetPopupModeFlags();
-    SetPopupModeFlags(nOldFlags | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE);
+    FloatWinPopupFlags nOldFlags = GetPopupModeFlags();
+    SetPopupModeFlags(nOldFlags | FloatWinPopupFlags::NoAppFocusClose);
     pSubMenu->resizeToFitMenuItems(); // set the size before launching the popup to get it positioned correctly.
     pSubMenu->StartPopupMode(
-        Rectangle(aPos,aSize), (FLOATWIN_POPUPMODE_RIGHT | FLOATWIN_POPUPMODE_GRABFOCUS));
+        Rectangle(aPos,aSize), (FloatWinPopupFlags::Right | FloatWinPopupFlags::GrabFocus));
     pSubMenu->AddPopupModeWindow(this);
     if (bSetMenuPos)
         pSubMenu->setSelectedMenuItem(0, false, false); // select menu item after the popup becomes fully visible.
@@ -809,11 +809,11 @@ void ScMenuFloatingWindow::ensureSubMenuVisible(ScMenuFloatingWindow* pSubMenu)
         Size aSize;
         getMenuItemPosSize(nMenuPos, aPos, aSize);
 
-        sal_uInt32 nOldFlags = GetPopupModeFlags();
-        SetPopupModeFlags(nOldFlags | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE);
+        FloatWinPopupFlags nOldFlags = GetPopupModeFlags();
+        SetPopupModeFlags(nOldFlags | FloatWinPopupFlags::NoAppFocusClose);
         pSubMenu->resizeToFitMenuItems(); // set the size before launching the popup to get it positioned correctly.
         pSubMenu->StartPopupMode(
-            Rectangle(aPos,aSize), (FLOATWIN_POPUPMODE_RIGHT | FLOATWIN_POPUPMODE_GRABFOCUS));
+            Rectangle(aPos,aSize), (FloatWinPopupFlags::Right | FloatWinPopupFlags::GrabFocus));
         pSubMenu->AddPopupModeWindow(this);
         SetPopupModeFlags(nOldFlags);
     }
@@ -1730,7 +1730,7 @@ void ScCheckListMenuWindow::launch(const Rectangle& rRect)
         aRect.Left() += nDiff;
     }
 
-    StartPopupMode(aRect, (FLOATWIN_POPUPMODE_DOWN | FLOATWIN_POPUPMODE_GRABFOCUS));
+    StartPopupMode(aRect, (FloatWinPopupFlags::Down | FloatWinPopupFlags::GrabFocus));
     cycleFocus(); // Set initial focus to the check list box.
 }
 
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index e59acb9..71bca6f 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1070,7 +1070,7 @@ void ScGridWindow::DoScenarioMenu( const ScRange& rScenRange )
     }
 
     mpFilterFloat->SetOutputSizePixel( aSize );
-    mpFilterFloat->StartPopupMode( aCellRect, FLOATWIN_POPUPMODE_DOWN|FLOATWIN_POPUPMODE_GRABFOCUS );
+    mpFilterFloat->StartPopupMode( aCellRect, FloatWinPopupFlags::Down|FloatWinPopupFlags::GrabFocus );
 
     mpFilterBox->SetUpdateMode(true);
     mpFilterBox->GrabFocus();
@@ -1222,7 +1222,7 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow, bool bDataSelec
         mpFilterBox->SetUpdateMode(false);
 
         mpFilterFloat->SetOutputSizePixel(aSize);
-        mpFilterFloat->StartPopupMode(aCellRect, FLOATWIN_POPUPMODE_DOWN | FLOATWIN_POPUPMODE_GRABFOCUS);
+        mpFilterFloat->StartPopupMode(aCellRect, FloatWinPopupFlags::Down | FloatWinPopupFlags::GrabFocus);
 
         //  Listbox fuellen
         bool bWait = aStrings.size() > 100;
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
index 9a0c861..606bddb 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -582,7 +582,7 @@ void AnnotationTag::OpenPopup( bool bEdit )
             mpAnnotationWindow->setAnnotation(mxAnnotation);
 
             sal_uInt16 nArrangeIndex = 0;
-            Point aPopupPos( FloatingWindow::CalcFloatingPosition( mpAnnotationWindow.get(), aRect, FLOATWIN_POPUPMODE_RIGHT, nArrangeIndex ) );
+            Point aPopupPos( FloatingWindow::CalcFloatingPosition( mpAnnotationWindow.get(), aRect, FloatWinPopupFlags::Right, nArrangeIndex ) );
             Size aPopupSize( 320, 240 );
 
             mpAnnotationWindow->SetPosSizePixel( aPopupPos, aPopupSize );
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx
index 4c2ba8b..a602456 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -614,7 +614,7 @@ void LayoutMenu::Command (const CommandEvent& rEvent)
                 FloatingWindow* pMenuWindow = dynamic_cast<FloatingWindow*>(pMenu->GetWindow());
                 if (pMenuWindow != NULL)
                     pMenuWindow->SetPopupModeFlags(
-                        pMenuWindow->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE);
+                        pMenuWindow->GetPopupModeFlags() | FloatWinPopupFlags::NoMouseUpClose);
                 pMenu->SetSelectHdl(LINK(this, LayoutMenu, OnMenuItemSelected));
 
                 // Disable the SID_INSERTPAGE_LAYOUT_MENU item when
diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx
index 2c522c1..c91ea08 100644
--- a/sd/source/ui/sidebar/MasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx
@@ -229,7 +229,7 @@ void MasterPagesSelector::Command (const CommandEvent& rEvent)
                 FloatingWindow* pMenuWindow = dynamic_cast<FloatingWindow*>(pMenu->GetWindow());
                 if (pMenuWindow != NULL)
                     pMenuWindow->SetPopupModeFlags(
-                        pMenuWindow->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE);
+                        pMenuWindow->GetPopupModeFlags() | FloatWinPopupFlags::NoMouseUpClose);
                 pMenu->SetSelectHdl(LINK(this, MasterPagesSelector, OnMenuItemSelected));
 
                 ProcessPopupMenu(*pMenu);
diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx
index 65a6a6a..1a73573 100644
--- a/sfx2/source/dialog/taskpane.cxx
+++ b/sfx2/source/dialog/taskpane.cxx
@@ -1174,7 +1174,7 @@ namespace sfx2
         FloatingWindow* pMenuWindow = static_cast< FloatingWindow* >( pMenu->GetWindow() );
         if ( pMenuWindow != NULL )
         {
-            pMenuWindow->SetPopupModeFlags ( pMenuWindow->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE );
+            pMenuWindow->SetPopupModeFlags ( pMenuWindow->GetPopupModeFlags() | FloatWinPopupFlags::NoMouseUpClose );
         }
 
         // Add one entry for every tool panel element to individually make
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 00e3f7f..b7a32b0 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -827,7 +827,7 @@ void SidebarController::ShowPopupMenu (
     FloatingWindow* pMenuWindow = dynamic_cast<FloatingWindow*>(pMenu->GetWindow());
     if (pMenuWindow != NULL)
     {
-        pMenuWindow->SetPopupModeFlags(pMenuWindow->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE);
+        pMenuWindow->SetPopupModeFlags(pMenuWindow->GetPopupModeFlags() | FloatWinPopupFlags::NoMouseUpClose);
     }
 
     // Create sub menu for customization (hiding of deck tabs.)
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index e88fc0e..74fb59f 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -2361,7 +2361,7 @@ bool CalendarField::ShowDropDown( bool bShow )
         mpCalendar->StartSelection();
         mpCalendar->GrabFocus();
         mpCalendar->Show();
-        mpFloatWin->StartPopupMode( aRect, FLOATWIN_POPUPMODE_NOFOCUSCLOSE|FLOATWIN_POPUPMODE_DOWN );
+        mpFloatWin->StartPopupMode( aRect, FloatWinPopupFlags::NoFocusClose|FloatWinPopupFlags::Down );
     }
     else
     {
diff --git a/svtools/source/uno/popupwindowcontroller.cxx b/svtools/source/uno/popupwindowcontroller.cxx
index 87e64d4..39ceb32 100644
--- a/svtools/source/uno/popupwindowcontroller.cxx
+++ b/svtools/source/uno/popupwindowcontroller.cxx
@@ -215,10 +215,10 @@ Reference< awt::XWindow > SAL_CALL PopupWindowController::createPopupWindow() th
             pWin->EnableDocking(true);
             mxImpl->SetPopupWindow(pWin,pToolBox);
             vcl::Window::GetDockingManager()->StartPopupMode( pToolBox, pWin,
-                                                           FLOATWIN_POPUPMODE_GRABFOCUS |
-                                                           FLOATWIN_POPUPMODE_NOFOCUSCLOSE |
-                                                           FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE |
-                                                           FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE );
+                                                           FloatWinPopupFlags::GrabFocus |
+                                                           FloatWinPopupFlags::NoFocusClose |
+                                                           FloatWinPopupFlags::AllMouseButtonClose |
+                                                           FloatWinPopupFlags::NoMouseUpClose );
         }
     }
     return Reference< awt::XWindow >();
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx
index 4041ef6..ae3eb84 100644
--- a/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx
+++ b/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx
@@ -46,7 +46,7 @@ VclPtr<SfxPopupWindow> ParaLineSpacingPopup::CreatePopupWindow()
 {
     VclPtr<ParaLineSpacingControl> pControl = VclPtr<ParaLineSpacingControl>::Create(GetSlotId());
 
-    pControl->StartPopupMode(&GetToolBox(), FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE);
+    pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoAppFocusClose);
 
     SetPopupWindow(pControl);
 
diff --git a/svx/source/sidebar/tools/Popup.cxx b/svx/source/sidebar/tools/Popup.cxx
index 221af08..193bf85 100644
--- a/svx/source/sidebar/tools/Popup.cxx
+++ b/svx/source/sidebar/tools/Popup.cxx
@@ -68,10 +68,10 @@ void Popup::Show (ToolBox& rToolBox)
 
         mxContainer->StartPopupMode(
             aRect,
-            FLOATWIN_POPUPMODE_NOFOCUSCLOSE|FLOATWIN_POPUPMODE_DOWN);
+            FloatWinPopupFlags::NoFocusClose|FloatWinPopupFlags::Down);
         mxContainer->SetPopupModeFlags(
             mxContainer->GetPopupModeFlags()
-                | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE);
+                | FloatWinPopupFlags::NoAppFocusClose);
 
         mxControl->GetFocus();
     }
diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index a36af3a..cf47480 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -745,7 +745,7 @@ VclPtr<SfxPopupWindow> SvxTableToolBoxControl::CreatePopupWindow()
     {
         ToolBox& rTbx = GetToolBox();
         VclPtr<TableWindow> pWin = VclPtr<TableWindow>::Create( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), rTbx, m_xFrame );
-        pWin->StartPopupMode( &rTbx, FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_NOKEYCLOSE );
+        pWin->StartPopupMode( &rTbx, FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoKeyClose );
         SetPopupWindow( pWin );
         return pWin;
     }
@@ -800,7 +800,7 @@ VclPtr<SfxPopupWindow> SvxColumnsToolBoxControl::CreatePopupWindow()
     {
             pWin = VclPtr<ColumnsWindow>::Create( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), GetToolBox(), m_xFrame );
             pWin->StartPopupMode( &GetToolBox(),
-                                  FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_NOKEYCLOSE );
+                                  FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoKeyClose );
             SetPopupWindow( pWin );
     }
     return pWin;
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index a517946..d83a587 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -178,7 +178,7 @@ void SvxListBoxControl::StateChanged(
 
 IMPL_LINK_NOARG(SvxListBoxControl, PopupModeEndHdl)
 {
-    if( pPopupWin && 0 == pPopupWin->GetPopupModeFlags()  &&
+    if( pPopupWin && FloatWinPopupFlags::NONE == pPopupWin->GetPopupModeFlags()  &&
         pPopupWin->IsUserSelected() )
     {
         sal_uInt16 nCount = pPopupWin->GetListBox().GetSelectEntryCount();
@@ -308,7 +308,7 @@ VclPtr<SfxPopupWindow> SvxUndoRedoControl::CreatePopupWindow()
 
     // move focus in floating window without
     // closing it (GrabFocus() would close it!)
-    pPopupWin->StartPopupMode( &rBox, FLOATWIN_POPUPMODE_GRABFOCUS );
+    pPopupWin->StartPopupMode( &rBox, FloatWinPopupFlags::GrabFocus );
     //pPopupWin->GetListBox().GrabFocus();
 
     return pPopupWin;
diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index 5f303bc..1014900 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -634,9 +634,9 @@ VclPtr<SfxPopupWindow> SvxLineEndToolBoxControl::CreatePopupWindow()
     SvxLineEndWindow* pLineEndWin =
         VclPtr<SvxLineEndWindow>::Create( GetId(), m_xFrame, &GetToolBox(), SVX_RESSTR( RID_SVXSTR_LINEEND ) );
     pLineEndWin->StartPopupMode( &GetToolBox(),
-                                 FLOATWIN_POPUPMODE_GRABFOCUS |
-                                 FLOATWIN_POPUPMODE_ALLOWTEAROFF |
-                                 FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
+                                 FloatWinPopupFlags::GrabFocus |
+                                 FloatWinPopupFlags::AllowTearOff |
+                                 FloatWinPopupFlags::NoAppFocusClose );
     pLineEndWin->StartSelection();
     SetPopupWindow( pLineEndWin );
     return pLineEndWin;
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index ab09ae8..2e962cc 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2634,7 +2634,7 @@ VclPtr<SfxPopupWindow> SvxColorToolBoxControl::CreatePopupWindow()
     }
 
     pColorWin->StartPopupMode( &GetToolBox(),
-        FLOATWIN_POPUPMODE_ALLOWTEAROFF|FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
+        FloatWinPopupFlags::AllowTearOff|FloatWinPopupFlags::NoAppFocusClose );
     pColorWin->StartSelection();
     SetPopupWindow( pColorWin );
     if ( !bSidebarType )
@@ -2778,9 +2778,9 @@ VclPtr<SfxPopupWindow> SvxFrameToolBoxControl::CreatePopupWindow()
                                         GetSlotId(), m_xFrame, &GetToolBox() );
 
     pFrameWin->StartPopupMode( &GetToolBox(),
-                               FLOATWIN_POPUPMODE_GRABFOCUS |
-                               FLOATWIN_POPUPMODE_ALLOWTEAROFF |
-                               FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
+                               FloatWinPopupFlags::GrabFocus |
+                               FloatWinPopupFlags::AllowTearOff |
+                               FloatWinPopupFlags::NoAppFocusClose );
     pFrameWin->StartSelection();
     SetPopupWindow( pFrameWin );
 
@@ -2818,9 +2818,9 @@ VclPtr<SfxPopupWindow> SvxFrameLineStyleToolBoxControl::CreatePopupWindow()
 {
     VclPtr<SvxLineWindow_Impl> pLineWin = VclPtr<SvxLineWindow_Impl>::Create( GetSlotId(), m_xFrame, &GetToolBox() );
     pLineWin->StartPopupMode( &GetToolBox(),
-                              FLOATWIN_POPUPMODE_GRABFOCUS |
-                              FLOATWIN_POPUPMODE_ALLOWTEAROFF |
-                              FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
+                              FloatWinPopupFlags::GrabFocus |
+                              FloatWinPopupFlags::AllowTearOff |
+                              FloatWinPopupFlags::NoAppFocusClose );
     SetPopupWindow( pLineWin );
 
     return pLineWin;
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index f5556db..a86d367 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -900,7 +900,7 @@ void SwView::ExecFieldPopup( const Point& rPt, IFieldmark *fieldBM )
     m_pFieldPopup->SetPopupModeEndHdl( LINK( this, SwView, FieldPopupModeEndHdl ) );
 
     Rectangle aRect( m_pEditWin->OutputToScreenPixel( aPixPos ), Size( 0, 0 ) );
-    m_pFieldPopup->StartPopupMode( aRect, FLOATWIN_POPUPMODE_DOWN|FLOATWIN_POPUPMODE_GRABFOCUS );
+    m_pFieldPopup->StartPopupMode( aRect, FloatWinPopupFlags::Down|FloatWinPopupFlags::GrabFocus );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 5a351fa..2bbacde 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -433,7 +433,7 @@ void SwNavigationPI::CreateNavigationTool(const Rectangle& rRect, bool bSetFocus
     Point aT1 = aRect.TopLeft();
     aT1 = pPopup->GetParent()->OutputToScreenPixel(pPopup->GetParent()->AbsoluteScreenToOutputPixel(aContentToolBox->OutputToAbsoluteScreenPixel(aT1)));
     aRect.SetPos(aT1);
-    pPopup->StartPopupMode(aRect, FLOATWIN_POPUPMODE_RIGHT|FLOATWIN_POPUPMODE_ALLOWTEAROFF);
+    pPopup->StartPopupMode(aRect, FloatWinPopupFlags::Right|FloatWinPopupFlags::AllowTearOff);
     SetPopupWindow( pPopup );
     if(bSetFocus)
     {
diff --git a/vcl/inc/salmenu.hxx b/vcl/inc/salmenu.hxx
index ee9bdb7..aaea364 100644
--- a/vcl/inc/salmenu.hxx
+++ b/vcl/inc/salmenu.hxx
@@ -77,7 +77,7 @@ public:
     virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage ) = 0;
     virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const vcl::KeyCode& rKeyCode, const OUString& rKeyName ) = 0;
     virtual void GetSystemMenuData( SystemMenuData* pData ) = 0;
-    virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, sal_uLong nFlags);
+    virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, FloatWinPopupFlags nFlags);
     virtual bool AddMenuBarButton( const SalMenuButtonItem& ); // return false if not implemented or failure
     virtual void RemoveMenuBarButton( sal_uInt16 nId );
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index e05b734..c51f4f6 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -130,7 +130,7 @@ SalMenu::~SalMenu()
 {
 }
 
-bool SalMenu::ShowNativePopupMenu(FloatingWindow *, const Rectangle&, sal_uLong )
+bool SalMenu::ShowNativePopupMenu(FloatingWindow *, const Rectangle&, FloatWinPopupFlags )
 {
     return false;
 }
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index f1b9c23..bd1935c 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -2973,7 +2973,7 @@ void ImplListBoxFloatingWindow::setPosSizePixel( long nX, long nY, long nWidth,
             aPos.Y() = nY;
 
         sal_uInt16 nIndex;
-        SetPosPixel( ImplCalcPos( this, Rectangle( aPos, GetParent()->GetSizePixel() ), FLOATWIN_POPUPMODE_DOWN, nIndex ) );
+        SetPosPixel( ImplCalcPos( this, Rectangle( aPos, GetParent()->GetSizePixel() ), FloatWinPopupFlags::Down, nIndex ) );
     }
 
 //  if( !IsReallyVisible() )
@@ -3105,7 +3105,7 @@ void ImplListBoxFloatingWindow::StartFloat( bool bStartTracking )
             pGrandparentOutDev->ReMirror( aRect );
 
         // mouse-button right: close the List-Box-Float-win and don't stop the handling fdo#84795
-        StartPopupMode( aRect, FLOATWIN_POPUPMODE_DOWN | FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE );
+        StartPopupMode( aRect, FloatWinPopupFlags::Down | FloatWinPopupFlags::AllMouseButtonClose );
 
         if( nPos != LISTBOX_ENTRY_NOTFOUND )
             mpImplLB->ShowProminentEntry( nPos );
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index 684f444..2d8d937 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -368,7 +368,7 @@ void DockingManager::SetFloatingMode( const vcl::Window *pWindow, bool bFloating
         pWrapper->SetFloatingMode( bFloating );
 }
 
-void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const vcl::Window *pWindow, sal_uLong nFlags )
+void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const vcl::Window *pWindow, FloatWinPopupFlags nFlags )
 {
     ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
     if( pWrapper )
@@ -377,10 +377,10 @@ void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const vcl::Window
 
 void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const vcl::Window *pWindow )
 {
-    StartPopupMode( pParentToolBox, pWindow, FLOATWIN_POPUPMODE_ALLOWTEAROFF         |
-                    FLOATWIN_POPUPMODE_NOFOCUSCLOSE         |
-                    FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE  |
-                    FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE );
+    StartPopupMode( pParentToolBox, pWindow, FloatWinPopupFlags::AllowTearOff         |
+                    FloatWinPopupFlags::NoFocusClose         |
+                    FloatWinPopupFlags::AllMouseButtonClose  |
+                    FloatWinPopupFlags::NoMouseUpClose );
 }
 
 bool DockingManager::IsInPopupMode( const vcl::Window *pWindow )
@@ -1098,7 +1098,7 @@ void ImplDockingWindowWrapper::ShowTitleButton( sal_uInt16 nButton, bool bVisibl
     }
 }
 
-void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, sal_uLong nFlags )
+void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWinPopupFlags nFlags )
 {
     // do nothing if window is floating
     if( IsFloatingMode() )
@@ -1113,7 +1113,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, sal_uLon
         mpOldBorderWin = NULL;  // no border window found
 
     // the new parent for popup mode
-    VclPtrInstance<ImplPopupFloatWin> pWin( mpParent, this, (nFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF) != 0 );
+    VclPtrInstance<ImplPopupFloatWin> pWin( mpParent, this, bool(nFlags & FloatWinPopupFlags::AllowTearOff) );
 
     pWin->SetPopupModeEndHdl( LINK( this, ImplDockingWindowWrapper, PopupModeEnd ) );
     pWin->SetText( GetWindow()->GetText() );
@@ -1146,7 +1146,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, sal_uLon
     // if the subtoolbar was opened via keyboard make sure that key events
     // will go into subtoolbar
     if( pParentToolBox->IsKeyEvent() )
-        nFlags |= FLOATWIN_POPUPMODE_GRABFOCUS;
+        nFlags |= FloatWinPopupFlags::GrabFocus;
 
     mpFloatWin->StartPopupMode( pParentToolBox, nFlags );
     GetWindow()->Show();
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 0e2f5cc..f66f92e 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -123,7 +123,7 @@ void FloatingWindow::ImplInit( vcl::Window* pParent, WinBits nStyle )
     mnPostId                = 0;
     mnTitle                 = (nStyle & (WB_MOVEABLE | WB_POPUP)) ? FLOATWIN_TITLE_NORMAL : FLOATWIN_TITLE_NONE;
     mnOldTitle              = mnTitle;
-    mnPopupModeFlags        = 0;
+    mnPopupModeFlags        = FloatWinPopupFlags::NONE;
     mbInPopupMode           = false;
     mbPopupMode             = false;
     mbPopupModeCanceled     = false;
@@ -159,7 +159,7 @@ FloatingWindow::FloatingWindow(vcl::Window* pParent, const OString& rID, const O
     , mpFirstPopupModeWin(0)
     , mpImplData(0)
     , mnPostId(0)
-    , mnPopupModeFlags(0)
+    , mnPopupModeFlags(FloatWinPopupFlags::NONE)
     , mnTitle(0)
     , mnOldTitle(0)
     , mbInPopupMode(false)
@@ -218,13 +218,13 @@ void FloatingWindow::dispose()
     SystemWindow::dispose();
 }
 
-Point FloatingWindow::CalcFloatingPosition( vcl::Window* pWindow, const Rectangle& rRect, sal_uLong nFlags, sal_uInt16& rArrangeIndex )
+Point FloatingWindow::CalcFloatingPosition( vcl::Window* pWindow, const Rectangle& rRect, FloatWinPopupFlags nFlags, sal_uInt16& rArrangeIndex )
 {
     return ImplCalcPos( pWindow, rRect, nFlags, rArrangeIndex );
 }
 
 Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow,
-                                   const Rectangle& rRect, sal_uLong nFlags,
+                                   const Rectangle& rRect, FloatWinPopupFlags nFlags,
                                    sal_uInt16& rArrangeIndex )
 {
     // get window position
@@ -254,43 +254,43 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow,
         aScreenRect = Application::GetScreenPosSizePixel(
             Application::GetBestScreen( bRTL ? devRectRTL : devRect ) );
 
-    sal_uInt16      nArrangeAry[5];
-    sal_uInt16      nArrangeIndex;
-    Point       e1,e2;  // the common edge between the item rect and the floating window
+    FloatWinPopupFlags nArrangeAry[5];
+    sal_uInt16        nArrangeIndex;
+    Point             e1,e2;  // the common edge between the item rect and the floating window
 
-    if ( nFlags & FLOATWIN_POPUPMODE_LEFT )
+    if ( nFlags & FloatWinPopupFlags::Left )
     {
-        nArrangeAry[0]  = FLOATWIN_POPUPMODE_LEFT;
-        nArrangeAry[1]  = FLOATWIN_POPUPMODE_RIGHT;
-        nArrangeAry[2]  = FLOATWIN_POPUPMODE_UP;
-        nArrangeAry[3]  = FLOATWIN_POPUPMODE_DOWN;
-        nArrangeAry[4]  = FLOATWIN_POPUPMODE_LEFT;
+        nArrangeAry[0]  = FloatWinPopupFlags::Left;
+        nArrangeAry[1]  = FloatWinPopupFlags::Right;
+        nArrangeAry[2]  = FloatWinPopupFlags::Up;
+        nArrangeAry[3]  = FloatWinPopupFlags::Down;
+        nArrangeAry[4]  = FloatWinPopupFlags::Left;
     }
-    else if ( nFlags & FLOATWIN_POPUPMODE_RIGHT )
+    else if ( nFlags & FloatWinPopupFlags::Right )
     {
-        nArrangeAry[0]  = FLOATWIN_POPUPMODE_RIGHT;
-        nArrangeAry[1]  = FLOATWIN_POPUPMODE_LEFT;
-        nArrangeAry[2]  = FLOATWIN_POPUPMODE_UP;
-        nArrangeAry[3]  = FLOATWIN_POPUPMODE_DOWN;
-        nArrangeAry[4]  = FLOATWIN_POPUPMODE_RIGHT;
+        nArrangeAry[0]  = FloatWinPopupFlags::Right;
+        nArrangeAry[1]  = FloatWinPopupFlags::Left;
+        nArrangeAry[2]  = FloatWinPopupFlags::Up;
+        nArrangeAry[3]  = FloatWinPopupFlags::Down;
+        nArrangeAry[4]  = FloatWinPopupFlags::Right;
     }
-    else if ( nFlags & FLOATWIN_POPUPMODE_UP )
+    else if ( nFlags & FloatWinPopupFlags::Up )
     {
-        nArrangeAry[0]  = FLOATWIN_POPUPMODE_UP;
-        nArrangeAry[1]  = FLOATWIN_POPUPMODE_DOWN;
-        nArrangeAry[2]  = FLOATWIN_POPUPMODE_RIGHT;
-        nArrangeAry[3]  = FLOATWIN_POPUPMODE_LEFT;
-        nArrangeAry[4]  = FLOATWIN_POPUPMODE_UP;
+        nArrangeAry[0]  = FloatWinPopupFlags::Up;
+        nArrangeAry[1]  = FloatWinPopupFlags::Down;
+        nArrangeAry[2]  = FloatWinPopupFlags::Right;
+        nArrangeAry[3]  = FloatWinPopupFlags::Left;
+        nArrangeAry[4]  = FloatWinPopupFlags::Up;
     }
     else
     {
-        nArrangeAry[0]  = FLOATWIN_POPUPMODE_DOWN;
-        nArrangeAry[1]  = FLOATWIN_POPUPMODE_UP;
-        nArrangeAry[2]  = FLOATWIN_POPUPMODE_RIGHT;
-        nArrangeAry[3]  = FLOATWIN_POPUPMODE_LEFT;
-        nArrangeAry[4]  = FLOATWIN_POPUPMODE_DOWN;
+        nArrangeAry[0]  = FloatWinPopupFlags::Down;
+        nArrangeAry[1]  = FloatWinPopupFlags::Up;
+        nArrangeAry[2]  = FloatWinPopupFlags::Right;
+        nArrangeAry[3]  = FloatWinPopupFlags::Left;
+        nArrangeAry[4]  = FloatWinPopupFlags::Down;
     }
-    if ( nFlags & FLOATWIN_POPUPMODE_NOAUTOARRANGE )
+    if ( nFlags & FloatWinPopupFlags::NoAutoArrange )
         nArrangeIndex = 4;
     else
         nArrangeIndex = 0;
@@ -301,7 +301,7 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow,
         switch ( nArrangeAry[nArrangeIndex] )
         {
 
-            case FLOATWIN_POPUPMODE_LEFT:
+            case FloatWinPopupFlags::Left:
                 aPos.X() = devRect.Left()-aSize.Width()+1;
                 aPos.Y() = devRect.Top();
                 aPos.Y() -= pWindow->mpWindowImpl->mnTopBorder;
@@ -326,7 +326,7 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow,
                     e2.Y()--;
                 }
                 break;
-            case FLOATWIN_POPUPMODE_RIGHT:
+            case FloatWinPopupFlags::Right:
                 aPos     = devRect.TopRight();
                 aPos.Y() -= pWindow->mpWindowImpl->mnTopBorder;
                 if( bRTL ) // --- RTL --- we're comparing screen coordinates here
@@ -350,7 +350,7 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow,
                     e2.Y()--;
                 }
                 break;
-            case FLOATWIN_POPUPMODE_UP:
+            case FloatWinPopupFlags::Up:
                 aPos.X() = devRect.Left();
                 aPos.Y() = devRect.Top()-aSize.Height()+1;
                 if ( aPos.Y() < aScreenRect.Top() )
@@ -366,7 +366,7 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow,
                     e2.X()--;
                 }
                 break;
-            case FLOATWIN_POPUPMODE_DOWN:
+            case FloatWinPopupFlags::Down:
                 aPos = devRect.BottomLeft();
                 if ( aPos.Y()+aSize.Height() > aScreenRect.Bottom() )
                     bBreak = false;
@@ -381,13 +381,14 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow,
                     e2.X()--;
                 }
                 break;
+            default: break;
         }
 
         // adjust if necessary
-        if ( bBreak && !(nFlags & FLOATWIN_POPUPMODE_NOAUTOARRANGE) )
+        if ( bBreak && !(nFlags & FloatWinPopupFlags::NoAutoArrange) )
         {
-            if ( (nArrangeAry[nArrangeIndex] == FLOATWIN_POPUPMODE_LEFT)  ||
-                 (nArrangeAry[nArrangeIndex] == FLOATWIN_POPUPMODE_RIGHT) )
+            if ( (nArrangeAry[nArrangeIndex] == FloatWinPopupFlags::Left)  ||
+                 (nArrangeAry[nArrangeIndex] == FloatWinPopupFlags::Right) )
             {
                 if ( aPos.Y()+aSize.Height() > aScreenRect.Bottom() )
                 {
@@ -496,7 +497,7 @@ FloatingWindow* FloatingWindow::ImplFindLastLevelFloat()
 
     do
     {
-        if ( pWin->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NEWLEVEL )
+        if ( pWin->GetPopupModeFlags() & FloatWinPopupFlags::NewLevel )
             pLastFoundWin = pWin;
 
         pWin = pWin->mpNextFloat;
@@ -526,7 +527,7 @@ IMPL_LINK_NOARG(FloatingWindow, ImplEndPopupModeHdl)
 {
     VclPtr<FloatingWindow> pThis(this);
     mnPostId            = 0;
-    mnPopupModeFlags    = 0;
+    mnPopupModeFlags    = FloatWinPopupFlags::NONE;
     mbPopupMode         = false;
     PopupModeEnd();
     return 0;
@@ -618,7 +619,7 @@ void FloatingWindow::SetTitleType( sal_uInt16 nTitle )
     }
 }
 
-void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags )
+void FloatingWindow::StartPopupMode( const Rectangle& rRect, FloatWinPopupFlags nFlags )
 {
     // avoid flickering
     if ( IsVisible() )
@@ -631,19 +632,19 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags )
     mnOldTitle = mnTitle;
     if ( ( mpWindowImpl->mnStyle & WB_POPUP ) && !GetText().isEmpty() )
         SetTitleType( FLOATWIN_TITLE_POPUP );
-    else if ( nFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF )
+    else if ( nFlags & FloatWinPopupFlags::AllowTearOff )
         SetTitleType( FLOATWIN_TITLE_TEAROFF );
     else
         SetTitleType( FLOATWIN_TITLE_NONE );
 
     // avoid close on focus change for decorated floating windows only
     if( mpWindowImpl->mbFrame && (GetStyle() & WB_MOVEABLE) )
-        nFlags |= FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;
+        nFlags |= FloatWinPopupFlags::NoAppFocusClose;
 
     // #102010# For debugging Accessibility
     static const char* pEnv = getenv("SAL_FLOATWIN_NOAPPFOCUSCLOSE" );
     if( pEnv && *pEnv )
-        nFlags |= FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;
+        nFlags |= FloatWinPopupFlags::NoAppFocusClose;
 
     // compute window position according to flags and arrangement
     sal_uInt16 nArrangeIndex;
@@ -691,7 +692,7 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags )
     ImplSVData* pSVData = ImplGetSVData();
     mpNextFloat = pSVData->maWinData.mpFirstFloat;
     pSVData->maWinData.mpFirstFloat = this;
-    if( nFlags & FLOATWIN_POPUPMODE_GRABFOCUS )
+    if( nFlags & FloatWinPopupFlags::GrabFocus )
     {
         // force key input even without focus (useful for menus)
         mbGrabFocus = true;
@@ -699,7 +700,7 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags )
     Show( true, SHOW_NOACTIVATE );
 }
 
-void FloatingWindow::StartPopupMode( ToolBox* pBox, sal_uLong nFlags )
+void FloatingWindow::StartPopupMode( ToolBox* pBox, FloatWinPopupFlags nFlags )
 {
     // get selected button
     sal_uInt16 nItemId = pBox->GetDownItemId();
@@ -717,27 +718,27 @@ void FloatingWindow::StartPopupMode( ToolBox* pBox, sal_uLong nFlags )
     aRect.SetPos( aPos );
 
     nFlags |=
-        FLOATWIN_POPUPMODE_NOFOCUSCLOSE     |
-//        FLOATWIN_POPUPMODE_NOMOUSECLOSE       |
-        FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE |
-//        FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE   |   // #105968# floating toolboxes should close when clicked in (parent's) float rect
-        FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE;
-//          |      FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;
+        FloatWinPopupFlags::NoFocusClose     |
+//        FloatWinPopupFlags::NoMouseClose       |
+        FloatWinPopupFlags::AllMouseButtonClose |
+//        FloatWinPopupFlags::NoMouseRectClose   |   // #105968# floating toolboxes should close when clicked in (parent's) float rect
+        FloatWinPopupFlags::NoMouseUpClose;
+//          |      FloatWinPopupFlags::NoAppFocusClose;
 
 /*
- *  FLOATWIN_POPUPMODE_NOKEYCLOSE       |
+ *  FloatWinPopupFlags::NoKeyClose       |
  *  don't set since it disables closing floaters with escape
  */
 
     // set Flags for positioning
-    if ( !(nFlags & (FLOATWIN_POPUPMODE_DOWN | FLOATWIN_POPUPMODE_UP |
-                     FLOATWIN_POPUPMODE_LEFT | FLOATWIN_POPUPMODE_RIGHT |
-                     FLOATWIN_POPUPMODE_NOAUTOARRANGE)) )
+    if ( !(nFlags & (FloatWinPopupFlags::Down | FloatWinPopupFlags::Up |
+                     FloatWinPopupFlags::Left | FloatWinPopupFlags::Right |
+                     FloatWinPopupFlags::NoAutoArrange)) )
     {
          if ( pBox->IsHorizontal() )
-             nFlags |= FLOATWIN_POPUPMODE_DOWN;
+             nFlags |= FloatWinPopupFlags::Down;
          else
-             nFlags |= FLOATWIN_POPUPMODE_RIGHT;
+             nFlags |= FloatWinPopupFlags::Right;
     }
 
     // start FloatingMode
@@ -761,11 +762,11 @@ void FloatingWindow::ImplEndPopupMode( sal_uInt16 nFlags, sal_uLong nFocusId )
     pSVData->maWinData.mpFirstFloat = mpNextFloat;
     mpNextFloat = NULL;
 
-    sal_uLong nPopupModeFlags = mnPopupModeFlags;
+    FloatWinPopupFlags nPopupModeFlags = mnPopupModeFlags;
 
     // hide window again if it was not deleted
     if ( !(nFlags & FLOATWIN_POPUPMODEEND_TEAROFF) ||
-         !(nPopupModeFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF) )
+         !(nPopupModeFlags & FloatWinPopupFlags::AllowTearOff) )
     {
         Show( false, SHOW_NOFOCUSCHANGE );
 
@@ -804,7 +805,7 @@ void FloatingWindow::ImplEndPopupMode( sal_uInt16 nFlags, sal_uLong nFocusId )
     // close all other windows depending on parameter
     if ( nFlags & FLOATWIN_POPUPMODEEND_CLOSEALL )
     {
-        if ( !(nPopupModeFlags & FLOATWIN_POPUPMODE_NEWLEVEL) )
+        if ( !(nPopupModeFlags & FloatWinPopupFlags::NewLevel) )
         {
             if ( pSVData->maWinData.mpFirstFloat )
             {
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 2e6d8c6..762eaa2 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2811,28 +2811,28 @@ sal_uInt16 PopupMenu::Execute( vcl::Window* pExecWindow, const Rectangle& rRect,
 {
     ENSURE_OR_RETURN( pExecWindow, "PopupMenu::Execute: need a non-NULL window!", 0 );
 
-    sal_uLong nPopupModeFlags = 0;
+    FloatWinPopupFlags nPopupModeFlags = FloatWinPopupFlags::NONE;
     if ( nFlags & POPUPMENU_EXECUTE_DOWN )
-        nPopupModeFlags = FLOATWIN_POPUPMODE_DOWN;
+        nPopupModeFlags = FloatWinPopupFlags::Down;
     else if ( nFlags & POPUPMENU_EXECUTE_UP )
-        nPopupModeFlags = FLOATWIN_POPUPMODE_UP;
+        nPopupModeFlags = FloatWinPopupFlags::Up;
     else if ( nFlags & POPUPMENU_EXECUTE_LEFT )
-        nPopupModeFlags = FLOATWIN_POPUPMODE_LEFT;
+        nPopupModeFlags = FloatWinPopupFlags::Left;
     else if ( nFlags & POPUPMENU_EXECUTE_RIGHT )
-        nPopupModeFlags = FLOATWIN_POPUPMODE_RIGHT;
+        nPopupModeFlags = FloatWinPopupFlags::Right;
     else
-        nPopupModeFlags = FLOATWIN_POPUPMODE_DOWN;
+        nPopupModeFlags = FloatWinPopupFlags::Down;
 
     if (nFlags & POPUPMENU_NOMOUSEUPCLOSE )                      // allow popup menus to stay open on mouse button up
-        nPopupModeFlags |= FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE;    // useful if the menu was opened on mousebutton down (eg toolbox configuration)
+        nPopupModeFlags |= FloatWinPopupFlags::NoMouseUpClose;    // useful if the menu was opened on mousebutton down (eg toolbox configuration)
 
     if (nFlags & POPUPMENU_NOHORZ_PLACEMENT)
-        nPopupModeFlags |= FLOATWIN_POPUPMODE_NOHORZPLACEMENT;
+        nPopupModeFlags |= FloatWinPopupFlags::NoHorzPlacement;
 
     return ImplExecute( pExecWindow, rRect, nPopupModeFlags, 0, false );
 }
 
-sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, sal_uLong nPopupModeFlags, Menu* pSFrom, bool bPreSelectFirst )
+sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, bool bPreSelectFirst )
 {
     if ( !pSFrom && ( PopupMenu::IsInExecute() || !GetItemCount() ) )
         return 0;
@@ -2866,11 +2866,11 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, sal_
 
     WinBits nStyle = WB_BORDER;
     if (bRealExecute)
-        nPopupModeFlags |= FLOATWIN_POPUPMODE_NEWLEVEL;
-    nPopupModeFlags |= FLOATWIN_POPUPMODE_NOKEYCLOSE | FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE;
+        nPopupModeFlags |= FloatWinPopupFlags::NewLevel;
+    nPopupModeFlags |= FloatWinPopupFlags::NoKeyClose | FloatWinPopupFlags::AllMouseButtonClose;
 
     // could be useful during debugging.
-    // nPopupModeFlags |= FLOATWIN_POPUPMODE_NOFOCUSCLOSE;
+    // nPopupModeFlags |= FloatWinPopupFlags::NoFocusClose;
 
     ImplDelData aDelData;
     pW->ImplAddDel( &aDelData );
@@ -2952,7 +2952,7 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, sal_
     //mode is to place it somewhere it will fit.  e.g. above, left, right. For
     //some cases, e.g. menubars, it's desirable to limit the options to
     //above/below and force the menu to scroll if it won't fit
-    if (nPopupModeFlags & FLOATWIN_POPUPMODE_NOHORZPLACEMENT)
+    if (nPopupModeFlags & FloatWinPopupFlags::NoHorzPlacement)
     {
         vcl::Window* pRef = pWin;
         if ( pRef->GetParent() )
@@ -2984,13 +2984,13 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, sal_
     // #102158# menus must never grab the focus, otherwise
     // they will be closed immediately
     // from now on focus grabbing is only prohibited automatically if
-    // FLOATWIN_POPUPMODE_GRABFOCUS was set (which is done below), because some
+    // FloatWinPopupFlags::GrabFocus was set (which is done below), because some
     // floaters (like floating toolboxes) may grab the focus
     // pWin->GrabFocus();
     if ( GetItemCount() )
     {
         SalMenu* pMenu = ImplGetSalMenu();
-        if( pMenu && bRealExecute && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) )
+        if( pMenu && bRealExecute && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FloatWinPopupFlags::GrabFocus ) )
         {
             pWin->StopExecute(0);
             pWin->doShutdown();
@@ -3000,7 +3000,7 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, sal_
         }
         else
         {
-            pWin->StartPopupMode( aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS );
+            pWin->StartPopupMode( aRect, nPopupModeFlags | FloatWinPopupFlags::GrabFocus );
         }
         if( pSFrom )
         {
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index 6a8de20..942f184 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -336,7 +336,7 @@ void MenuBarWindow::ImplCreatePopup( bool bPreSelectFirst )
             // #99071# do not grab the focus, otherwise it will be restored to the menubar
             // when the frame is reactivated later
             //GrabFocus();
-            pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FLOATWIN_POPUPMODE_DOWN | FLOATWIN_POPUPMODE_NOHORZPLACEMENT, pMenu, bPreSelectFirst );
+            pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FloatWinPopupFlags::Down | FloatWinPopupFlags::NoHorzPlacement, pMenu, bPreSelectFirst );
             // does not have a window, if aborted before or if there are no entries
             if ( pActivePopup->ImplGetFloatingWindow() )
                 pActivePopup->ImplGetFloatingWindow()->AddPopupModeWindow( this );
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx
index f934010..4345e16 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -282,8 +282,8 @@ IMPL_LINK_TYPED( MenuFloatingWindow, HighlightChanged, Timer*, pTimer, void )
     {
         if ( pActivePopup && ( pActivePopup != pItemData->pSubMenu ) )
         {
-            sal_uLong nOldFlags = GetPopupModeFlags();
-            SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
+            FloatWinPopupFlags nOldFlags = GetPopupModeFlags();
+            SetPopupModeFlags( GetPopupModeFlags() | FloatWinPopupFlags::NoAppFocusClose );
             KillActivePopup();
             SetPopupModeFlags( nOldFlags );
         }
@@ -321,9 +321,9 @@ IMPL_LINK_TYPED( MenuFloatingWindow, HighlightChanged, Timer*, pTimer, void )
             // were for long in Activate Rescheduled and which should not be
             // displayed now.
             Menu* pTest = pActivePopup;
-            sal_uLong nOldFlags = GetPopupModeFlags();
-            SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
-            sal_uInt16 nRet = pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FLOATWIN_POPUPMODE_RIGHT, pMenu, pTimer == nullptr );
+            FloatWinPopupFlags nOldFlags = GetPopupModeFlags();
+            SetPopupModeFlags( GetPopupModeFlags() | FloatWinPopupFlags::NoAppFocusClose );
+            sal_uInt16 nRet = pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FloatWinPopupFlags::Right, pMenu, pTimer == nullptr );
             SetPopupModeFlags( nOldFlags );
 
             // nRet != 0, wenn es waerend Activate() abgeschossen wurde...
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 0874091..2f5d8b5 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -76,7 +76,7 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
         HitTest         nHitTest = HITTEST_OUTSIDE;
         FloatingWindow* pFloat = pSVData->maWinData.mpFirstFloat->ImplFloatHitTest( pChild, rMousePos, nHitTest );
         FloatingWindow* pLastLevelFloat;
-        sal_uLong           nPopupFlags;
+        FloatWinPopupFlags nPopupFlags;
         if ( nSVEvent == MouseNotifyEvent::MOUSEMOVE )
         {
             if ( bMouseLeave )
@@ -105,7 +105,7 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
                     }
                     else if ( nHitTest == HITTEST_RECT )
                     {
-                        if ( !(pFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE) )
+                        if ( !(pFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoMouseRectClose) )
                             pFloat->ImplSetMouseDown();
                         return true;
                     }
@@ -125,7 +125,7 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
                     {
                         pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
                         nPopupFlags = pLastLevelFloat->GetPopupModeFlags();
-                        if ( !(nPopupFlags & FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE) )
+                        if ( !(nPopupFlags & FloatWinPopupFlags::NoMouseUpClose) )
                         {
                             pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
                             return true;
@@ -139,9 +139,9 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
                 {
                     pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
                     nPopupFlags = pLastLevelFloat->GetPopupModeFlags();
-                    if ( nPopupFlags & FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE )
+                    if ( nPopupFlags & FloatWinPopupFlags::AllMouseButtonClose )
                     {
-                        if ( (nPopupFlags & FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE) &&
+                        if ( (nPopupFlags & FloatWinPopupFlags::NoMouseUpClose) &&
                              (nSVEvent == MouseNotifyEvent::MOUSEBUTTONUP) )
                             return true;
                         pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
@@ -953,7 +953,7 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent,
                 if ( pSVData->maWinData.mpFirstFloat )
                 {
                     FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
-                    if ( !(pLastLevelFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOKEYCLOSE) )
+                    if ( !(pLastLevelFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoKeyClose) )
                     {
                         sal_uInt16 nEscCode = aKeyCode.GetCode();
 
@@ -976,7 +976,7 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent,
         if ( pSVData->maWinData.mpFirstFloat )
         {
             FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
-            if ( !(pLastLevelFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOKEYCLOSE) )
+            if ( !(pLastLevelFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoKeyClose) )
             {
                 sal_uInt16 nCode = aKeyCode.GetCode();
 
@@ -1651,7 +1651,7 @@ static void KillOwnPopups( vcl::Window* pWindow )
     vcl::Window *pChild = pSVData->maWinData.mpFirstFloat;
     if ( pChild && pParent->ImplIsWindowOrChild( pChild, true ) )
     {
-        if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE) )
+        if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoAppFocusClose) )
             pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
     }
 }
@@ -1916,7 +1916,7 @@ static void ImplHandleLoseFocus( vcl::Window* pWindow )
     // is set, such that we do not show windows during the switch
     if ( pSVData->maWinData.mpFirstFloat )
     {
-        if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE) )
+        if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoAppFocusClose) )
             pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
     }
 
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index e16074b..06d4748 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -2988,7 +2988,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
         if ( pSVData->maWinData.mpFirstFloat )
         {
             static const char* pEnv = getenv( "SAL_FLOATWIN_NOAPPFOCUSCLOSE" );
-            if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE) && !(pEnv && *pEnv) )
+            if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoAppFocusClose) && !(pEnv && *pEnv) )
                 pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
         }
     }
@@ -3498,9 +3498,9 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
             if ((mpParent != NULL && nStyle_ == 0)
                 && pSVData->maWinData.mpFirstFloat )
             {
-                sal_uLong nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags();
+                FloatWinPopupFlags nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags();
                 pSVData->maWinData.mpFirstFloat->SetPopupModeFlags(
-                                        nMode & ~(FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE));
+                                        nMode & ~(FloatWinPopupFlags::NoAppFocusClose));
             }
             return nRet;
         }
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 3573933..e349aa1 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -3292,7 +3292,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
             if ( pSVData->maWinData.mpFirstFloat )
             {
                 static const char* pEnv = getenv( "SAL_FLOATWIN_NOAPPFOCUSCLOSE" );
-                if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE) && !(pEnv && *pEnv) )
+                if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoAppFocusClose) && !(pEnv && *pEnv) )
                     pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
             }
         }


More information about the Libreoffice-commits mailing list