[Libreoffice-commits] core.git: 2 commits - avmedia/source basctl/source chart2/source dbaccess/source extensions/source include/svx include/vcl o3tl/qa sc/source sd/source sfx2/source svtools/source svx/source toolkit/source vcl/inc vcl/source

Noel Grandin noel at peralex.com
Fri Nov 7 04:54:40 PST 2014


 avmedia/source/viewer/mediaevent_impl.cxx                  |    8 -
 basctl/source/basicide/bastypes.cxx                        |    2 
 chart2/source/controller/main/ChartController_TextEdit.cxx |    2 
 chart2/source/controller/main/ChartController_Window.cxx   |    2 
 dbaccess/source/ui/app/AppDetailPageHelper.cxx             |    4 
 dbaccess/source/ui/control/toolboxcontroller.cxx           |    2 
 extensions/source/bibliography/toolbar.cxx                 |    2 
 include/svx/svdview.hxx                                    |   10 +-
 include/vcl/event.hxx                                      |   61 +++++++------
 o3tl/qa/test-typed_flags.cxx                               |    1 
 sc/source/ui/drawfunc/fudraw.cxx                           |    2 
 sc/source/ui/drawfunc/fupoor.cxx                           |    2 
 sc/source/ui/drawfunc/futext.cxx                           |    2 
 sc/source/ui/navipi/navipi.cxx                             |    2 
 sc/source/ui/view/gridwin.cxx                              |    4 
 sc/source/ui/view/gridwin5.cxx                             |    2 
 sd/source/ui/func/fudraw.cxx                               |    2 
 sd/source/ui/func/fuediglu.cxx                             |   10 +-
 sd/source/ui/func/fupoor.cxx                               |    4 
 sd/source/ui/func/fusel.cxx                                |   10 +-
 sfx2/source/statbar/stbitem.cxx                            |    6 -
 svtools/source/brwbox/brwbox2.cxx                          |    9 -
 svtools/source/brwbox/datwin.cxx                           |    2 
 svtools/source/contnr/treelistbox.cxx                      |    2 
 svtools/source/control/tabbar.cxx                          |    4 
 svx/source/dialog/connctrl.cxx                             |    2 
 svx/source/fmcomp/gridcell.cxx                             |    2 
 svx/source/svdraw/svdview.cxx                              |    2 
 toolkit/source/awt/vclxwindow.cxx                          |    4 
 vcl/inc/window.h                                           |    5 -
 vcl/source/window/mouse.cxx                                |    6 -
 vcl/source/window/mouseevent.cxx                           |    6 -
 vcl/source/window/toolbox.cxx                              |    6 -
 vcl/source/window/window.cxx                               |    2 
 vcl/source/window/window2.cxx                              |   10 +-
 vcl/source/window/winproc.cxx                              |   33 +++----
 36 files changed, 127 insertions(+), 108 deletions(-)

New commits:
commit 31d902d3c00fdc5f088aff433b7ebf308a718339
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Nov 7 12:30:39 2014 +0200

    fdo#84938: replace MOUSE_ modifier constants with enum
    
    and make the two categories of constants non-overlapping, we
    really don't need to risk confusion in order to save 6 bits in
    a data structure like this.
    
    Change-Id: I2251195d8e45ed04e2a89e47ae9c3e52cf0475c0

diff --git a/avmedia/source/viewer/mediaevent_impl.cxx b/avmedia/source/viewer/mediaevent_impl.cxx
index 2db8831..86e1817 100644
--- a/avmedia/source/viewer/mediaevent_impl.cxx
+++ b/avmedia/source/viewer/mediaevent_impl.cxx
@@ -107,7 +107,7 @@ void SAL_CALL MediaEventListenersImpl::mousePressed( const ::com::sun::star::awt
     {
         MouseEvent aVCLMouseEvt( Point( e.X, e.Y ),
                                  sal::static_int_cast< sal_uInt16 >(e.ClickCount),
-                                 0,
+                                 MouseEventModifiers::NONE,
                                 ( ( e.Buttons & 1 ) ? MOUSE_LEFT : 0 ) |
                                 ( ( e.Buttons & 2 ) ? MOUSE_RIGHT : 0 ) |
                                 ( ( e.Buttons & 4 ) ? MOUSE_MIDDLE : 0 ),
@@ -128,7 +128,7 @@ void SAL_CALL MediaEventListenersImpl::mouseReleased( const ::com::sun::star::aw
     {
         MouseEvent aVCLMouseEvt( Point( e.X, e.Y ),
                                  sal::static_int_cast< sal_uInt16 >(e.ClickCount),
-                                 0,
+                                 MouseEventModifiers::NONE,
                                 ( ( e.Buttons & 1 ) ? MOUSE_LEFT : 0 ) |
                                 ( ( e.Buttons & 2 ) ? MOUSE_RIGHT : 0 ) |
                                 ( ( e.Buttons & 4 ) ? MOUSE_MIDDLE : 0 ),
@@ -173,7 +173,7 @@ void SAL_CALL MediaEventListenersImpl::mouseDragged( const ::com::sun::star::awt
 
     if( mpNotifyWindow )
     {
-        MouseEvent aVCLMouseEvt( Point( e.X, e.Y ), 0, 0, e.Buttons, e.Modifiers );
+        MouseEvent aVCLMouseEvt( Point( e.X, e.Y ), 0, MouseEventModifiers::NONE, e.Buttons, e.Modifiers );
         Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEMOVE, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLMouseEvt );
     }
 }
@@ -188,7 +188,7 @@ void SAL_CALL MediaEventListenersImpl::mouseMoved( const ::com::sun::star::awt::
 
     if( mpNotifyWindow )
     {
-        MouseEvent aVCLMouseEvt( Point( e.X, e.Y ), 0, 0, e.Buttons, e.Modifiers );
+        MouseEvent aVCLMouseEvt( Point( e.X, e.Y ), 0, MouseEventModifiers::NONE, e.Buttons, e.Modifiers );
         Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEMOVE, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLMouseEvt );
     }
 }
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 55a3dc4..169902a 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -483,7 +483,7 @@ void TabBar::Command( const CommandEvent& rCEvt )
         if ( rCEvt.IsMouseEvent() )     // select right tab
         {
             Point aP = PixelToLogic( aPos );
-            MouseEvent aMouseEvent( aP, 1, MOUSE_SIMPLECLICK, MOUSE_LEFT );
+            MouseEvent aMouseEvent( aP, 1, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT );
             ::TabBar::MouseButtonDown( aMouseEvent ); // base class
         }
 
diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx
index 0cb9648..5fe2635 100644
--- a/chart2/source/controller/main/ChartController_TextEdit.cxx
+++ b/chart2/source/controller/main/ChartController_TextEdit.cxx
@@ -90,7 +90,7 @@ void ChartController::StartTextEdit( const Point* pMousePixel )
             OutlinerView* pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView();
             if ( pOutlinerView )
             {
-                MouseEvent aEditEvt( *pMousePixel, 1, MOUSE_SYNTHETIC, MOUSE_LEFT, 0 );
+                MouseEvent aEditEvt( *pMousePixel, 1, MouseEventModifiers::SYNTHETIC, MOUSE_LEFT, 0 );
                 pOutlinerView->MouseButtonDown( aEditEvt );
                 pOutlinerView->MouseButtonUp( aEditEvt );
             }
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index c367f65..fb1132c 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -549,7 +549,7 @@ IMPL_LINK_NOARG(ChartController, DoubleClickWaitingHdl)
             MouseEvent aMouseEvent(
                             aPointerState.maPos,
                             1/*nClicks*/,
-                            0/*nMode*/,
+                            MouseEventModifiers::NONE,
                             static_cast< sal_uInt16 >( aPointerState.mnState )/*nButtons*/,
                             0/*nModifier*/ );
             impl_SetMousePointer( aMouseEvent );
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 75c51d1..184fb48 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -1176,7 +1176,7 @@ IMPL_LINK(OAppDetailPageHelper, OnDropdownClickHdl, ToolBox*, /*pToolBox*/)
 
     // simulate a mouse move (so the "down" state is really painted)
     Point aPoint = m_aTBPreview.GetItemRect( SID_DB_APP_DISABLE_PREVIEW ).TopLeft();
-    MouseEvent aMove( aPoint, 0, MOUSE_SIMPLEMOVE | MOUSE_SYNTHETIC );
+    MouseEvent aMove( aPoint, 0, MouseEventModifiers::SIMPLEMOVE | MouseEventModifiers::SYNTHETIC );
     m_aTBPreview.MouseMove( aMove );
 
     m_aTBPreview.Update();
@@ -1200,7 +1200,7 @@ IMPL_LINK(OAppDetailPageHelper, OnDropdownClickHdl, ToolBox*, /*pToolBox*/)
 
     sal_uInt16 nSelectedAction = aMenu->Execute(&m_aTBPreview, m_aTBPreview.GetItemRect( SID_DB_APP_DISABLE_PREVIEW ));
     // "cleanup" the toolbox state
-    MouseEvent aLeave( aPoint, 0, MOUSE_LEAVEWINDOW | MOUSE_SYNTHETIC );
+    MouseEvent aLeave( aPoint, 0, MouseEventModifiers::LEAVEWINDOW | MouseEventModifiers::SYNTHETIC );
     m_aTBPreview.MouseMove( aLeave );
     m_aTBPreview.SetItemDown( SID_DB_APP_DISABLE_PREVIEW, false);
     if ( nSelectedAction )
diff --git a/dbaccess/source/ui/control/toolboxcontroller.cxx b/dbaccess/source/ui/control/toolboxcontroller.cxx
index 5bbd3b0..cb6d306 100644
--- a/dbaccess/source/ui/control/toolboxcontroller.cxx
+++ b/dbaccess/source/ui/control/toolboxcontroller.cxx
@@ -234,7 +234,7 @@ namespace dbaui
         sal_uInt16 nSelected = pMenu->Execute(pToolBox, pToolBox->GetItemRect( m_nToolBoxId ),POPUPMENU_EXECUTE_DOWN);
         // "cleanup" the toolbox state
         Point aPoint = pToolBox->GetItemRect( m_nToolBoxId ).TopLeft();
-        MouseEvent aLeave( aPoint, 0, MOUSE_LEAVEWINDOW | MOUSE_SYNTHETIC );
+        MouseEvent aLeave( aPoint, 0, MouseEventModifiers::LEAVEWINDOW | MouseEventModifiers::SYNTHETIC );
         pToolBox->MouseMove( aLeave );
         pToolBox->SetItemDown( m_nToolBoxId, false);
 
diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx
index b32738e..d4f433e 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -498,7 +498,7 @@ IMPL_LINK( BibToolBar, MenuHdl, ToolBox*, /*pToolbox*/)
         }
 
         Point aPoint;
-        MouseEvent aLeave( aPoint, 0, MOUSE_LEAVEWINDOW | MOUSE_SYNTHETIC );
+        MouseEvent aLeave( aPoint, 0, MouseEventModifiers::LEAVEWINDOW | MouseEventModifiers::SYNTHETIC );
         MouseMove( aLeave );
         SetItemDown(TBC_BT_AUTOFILTER,false);
 
diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx
index fca5eb4..2a754d1 100644
--- a/include/svx/svdview.hxx
+++ b/include/svx/svdview.hxx
@@ -101,11 +101,11 @@ struct SVX_DLLPUBLIC SdrViewEvent
     SdrHdlKind                  eHdlKind;
     SdrCreateCmd                eEndCreateCmd;   // auch fuer EndInsPoint
 
-    sal_uInt16                      nMouseClicks;
-    sal_uInt16                      nMouseMode;
-    sal_uInt16                      nMouseCode;
-    sal_uInt16                      nHlplIdx;
-    sal_uInt16                      nGlueId;
+    sal_uInt16                  nMouseClicks;
+    MouseEventModifiers         nMouseMode;
+    sal_uInt16                  nMouseCode;
+    sal_uInt16                  nHlplIdx;
+    sal_uInt16                  nGlueId;
 
     bool                        bMouseDown : 1;
     bool                        bMouseUp : 1;
diff --git a/include/vcl/event.hxx b/include/vcl/event.hxx
index 3cd5f8a..76e609d 100644
--- a/include/vcl/event.hxx
+++ b/include/vcl/event.hxx
@@ -82,20 +82,27 @@ inline KeyEvent::KeyEvent( sal_Unicode nChar, const vcl::KeyCode& rKeyCode,
 // - MouseEvent-Types -
 
 
-// Maus-Move-Modi
-#define MOUSE_SIMPLEMOVE        ((sal_uInt16)0x0001)
-#define MOUSE_DRAGMOVE          ((sal_uInt16)0x0002)
-#define MOUSE_DRAGCOPY          ((sal_uInt16)0x0004)
-#define MOUSE_ENTERWINDOW       ((sal_uInt16)0x0010)
-#define MOUSE_LEAVEWINDOW       ((sal_uInt16)0x0020)
-#define MOUSE_SYNTHETIC         ((sal_uInt16)0x0040)
-#define MOUSE_MODIFIERCHANGED   ((sal_uInt16)0x0080)
-
-// Maus-Button-Down/Up-Modi
-#define MOUSE_SIMPLECLICK       ((sal_uInt16)0x0001)
-#define MOUSE_SELECT            ((sal_uInt16)0x0002)
-#define MOUSE_MULTISELECT       ((sal_uInt16)0x0004)
-#define MOUSE_RANGESELECT       ((sal_uInt16)0x0008)
+enum class MouseEventModifiers
+{
+   NONE              = 0,
+   // mouse move modifiers
+   SIMPLEMOVE        = 0x0001,
+   DRAGMOVE          = 0x0002,
+   DRAGCOPY          = 0x0004,
+   ENTERWINDOW       = 0x0010,
+   LEAVEWINDOW       = 0x0020,
+   SYNTHETIC         = 0x0040,
+   MODIFIERCHANGED   = 0x0080,
+   // mouse up/down-button modifiers
+   SIMPLECLICK       = 0x0100,
+   SELECT            = 0x0200,
+   MULTISELECT       = 0x0400,
+   RANGESELECT       = 0x0800
+};
+namespace o3tl
+{
+    template<> struct typed_flags<MouseEventModifiers> : is_typed_flags<MouseEventModifiers, 0xff7> {};
+}
 
 // Maus-Buttons
 #define MOUSE_LEFT              ((sal_uInt16)0x0001)
@@ -109,34 +116,34 @@ inline KeyEvent::KeyEvent( sal_Unicode nChar, const vcl::KeyCode& rKeyCode,
 class VCL_DLLPUBLIC MouseEvent
 {
 private:
-    Point           maPos;
-    sal_uInt16          mnMode;
+    Point               maPos;
+    MouseEventModifiers mnMode;
     sal_uInt16          mnClicks;
     sal_uInt16          mnCode;
 
 public:
     explicit        MouseEvent();
     explicit        MouseEvent( const Point& rPos, sal_uInt16 nClicks = 1,
-                                sal_uInt16 nMode = 0, sal_uInt16 nButtons = 0,
+                                MouseEventModifiers nMode = MouseEventModifiers::NONE, sal_uInt16 nButtons = 0,
                                 sal_uInt16 nModifier = 0 );
 
     const Point&    GetPosPixel() const     { return maPos; }
-    sal_uInt16          GetMode() const         { return mnMode; }
+    MouseEventModifiers GetMode() const         { return mnMode; }
                     /** inits this vcl KeyEvent with all settings from the given awt event **/
                     MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent );
 
-    sal_uInt16          GetClicks() const       { return mnClicks; }
+    sal_uInt16      GetClicks() const       { return mnClicks; }
 
     bool            IsEnterWindow() const
-                        { return ((mnMode & MOUSE_ENTERWINDOW) != 0); }
+                        { return bool(mnMode & MouseEventModifiers::ENTERWINDOW); }
     bool            IsLeaveWindow() const
-                        { return ((mnMode & MOUSE_LEAVEWINDOW) != 0); }
+                        { return bool(mnMode & MouseEventModifiers::LEAVEWINDOW); }
     bool            IsSynthetic() const
-                        { return ((mnMode & MOUSE_SYNTHETIC) != 0); }
+                        { return bool(mnMode & MouseEventModifiers::SYNTHETIC); }
     bool            IsModifierChanged() const
-                        { return ((mnMode & MOUSE_MODIFIERCHANGED) != 0); }
+                        { return bool(mnMode & MouseEventModifiers::MODIFIERCHANGED); }
 
-    sal_uInt16          GetButtons() const
+    sal_uInt16      GetButtons() const
                         { return (mnCode & (MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)); }
     bool            IsLeft() const
                         { return ((mnCode & MOUSE_LEFT) != 0); }
@@ -145,7 +152,7 @@ public:
     bool            IsRight() const
                         { return ((mnCode & MOUSE_RIGHT) != 0); }
 
-    sal_uInt16          GetModifier() const
+    sal_uInt16      GetModifier() const
                         { return (mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)); }
     bool            IsShift() const
                         { return ((mnCode & KEY_SHIFT) != 0); }
@@ -159,13 +166,13 @@ public:
 
 inline MouseEvent::MouseEvent()
 {
-    mnMode      = 0;
+    mnMode      = MouseEventModifiers::NONE;
     mnClicks    = 0;
     mnCode      = 0;
 }
 
 inline MouseEvent::MouseEvent( const Point& rPos, sal_uInt16 nClicks,
-                               sal_uInt16 nMode,
+                               MouseEventModifiers nMode,
                                sal_uInt16 nButtons, sal_uInt16 nModifier ) :
             maPos( rPos )
 {
diff --git a/o3tl/qa/test-typed_flags.cxx b/o3tl/qa/test-typed_flags.cxx
index 3fe327e..d2a4154 100644
--- a/o3tl/qa/test-typed_flags.cxx
+++ b/o3tl/qa/test-typed_flags.cxx
@@ -47,8 +47,6 @@ public:
         nHint &= ConfigurationChangedHint::ONE;
         CPPUNIT_ASSERT( bool(nHint &= ConfigurationChangedHint::ONE) );
 
-        ConfigurationChangedHint nHint2  = nHint & ~(ConfigurationChangedHint::ONE | ConfigurationChangedHint::TWO);
-
     }
 
     // Change the following lines only, if you add, remove or rename
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index 34cea99..009c2b5 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -707,7 +707,7 @@ void FuDraw::Deactivate()
 static bool lcl_UrlHit( SdrView* pView, const Point& rPosPixel, vcl::Window* pWindow )
 {
     SdrViewEvent aVEvt;
-    MouseEvent aMEvt( rPosPixel, 1, 0, MOUSE_LEFT );
+    MouseEvent aMEvt( rPosPixel, 1, MouseEventModifiers::NONE, MOUSE_LEFT );
     SdrHitKind eHit = pView->PickAnything( aMEvt, SDRMOUSEBUTTONDOWN, aVEvt );
 
     if ( eHit != SDRHIT_NONE && aVEvt.pObj != NULL )
diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx
index dfad06a..979e7b6 100644
--- a/sc/source/ui/drawfunc/fupoor.cxx
+++ b/sc/source/ui/drawfunc/fupoor.cxx
@@ -133,7 +133,7 @@ IMPL_LINK_NOARG_INLINE_START(FuPoor, ScrollHdl)
 
     // use remembered MouseButton state to create correct
     // MouseEvents for this artificial MouseMove.
-    MouseMove(MouseEvent(aPosPixel, 1, 0, GetMouseButtonCode()));
+    MouseMove(MouseEvent(aPosPixel, 1, MouseEventModifiers::NONE, GetMouseButtonCode()));
 
     return 0;
 }
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index e3be957..0d76c7e 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -750,7 +750,7 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel,
                         {
                             if ( pMousePixel )
                             {
-                                MouseEvent aEditEvt( *pMousePixel, 1, MOUSE_SYNTHETIC, MOUSE_LEFT, 0 );
+                                MouseEvent aEditEvt( *pMousePixel, 1, MouseEventModifiers::SYNTHETIC, MOUSE_LEFT, 0 );
                                 pOLV->MouseButtonDown(aEditEvt);
                                 pOLV->MouseButtonUp(aEditEvt);
                             }
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index efd1e80..b3a1f19 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -405,7 +405,7 @@ IMPL_LINK_NOARG(CommandToolBox, ToolBoxDropdownClickHdl)
 
         //  den gehighlighteten Button aufheben
         Point aPoint;
-        MouseEvent aLeave( aPoint, 0, MOUSE_LEAVEWINDOW | MOUSE_SYNTHETIC );
+        MouseEvent aLeave( aPoint, 0, MouseEventModifiers::LEAVEWINDOW | MouseEventModifiers::SYNTHETIC );
         MouseMove( aLeave );
     }
 
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 4e0fb78..e8defd1 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2274,7 +2274,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
             {
                 //  Text-Cursor gleich an die geklickte Stelle setzen
                 EditView* pEditView = pViewData->GetEditView( eWhich );
-                MouseEvent aEditEvt( rMEvt.GetPosPixel(), 1, MOUSE_SYNTHETIC, MOUSE_LEFT, 0 );
+                MouseEvent aEditEvt( rMEvt.GetPosPixel(), 1, MouseEventModifiers::SYNTHETIC, MOUSE_LEFT, 0 );
                 pEditView->MouseButtonDown( aEditEvt );
                 pEditView->MouseButtonUp( aEditEvt );
             }
@@ -2472,7 +2472,7 @@ void ScGridWindow::MouseMove( const MouseEvent& rMEvt )
             nButtonDown = 0;
             nMouseStatus = SC_GM_NONE;
             ReleaseMouse();
-            pFilterBox->MouseButtonDown( MouseEvent( aRelPos, 1, MOUSE_SIMPLECLICK, MOUSE_LEFT ) );
+            pFilterBox->MouseButtonDown( MouseEvent( aRelPos, 1, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT ) );
             return;
         }
     }
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 9453104..8bdd989 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -288,7 +288,7 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
         if ( pDrView )                                      // URL / Image-Map
         {
             SdrViewEvent aVEvt;
-            MouseEvent aMEvt( aPosPixel, 1, 0, MOUSE_LEFT );
+            MouseEvent aMEvt( aPosPixel, 1, MouseEventModifiers::NONE, MOUSE_LEFT );
             SdrHitKind eHit = pDrView->PickAnything( aMEvt, SDRMOUSEBUTTONDOWN, aVEvt );
 
             if ( eHit != SDRHIT_NONE && aVEvt.pObj != NULL )
diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index 9575516..613e74f 100644
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -759,7 +759,7 @@ bool FuDraw::RequestHelp(const HelpEvent& rHEvt)
     {
         SdrViewEvent aVEvt;
 
-        MouseEvent aMEvt(mpWindow->GetPointerPosPixel(), 1, 0, MOUSE_LEFT);
+        MouseEvent aMEvt(mpWindow->GetPointerPosPixel(), 1, MouseEventModifiers::NONE, MOUSE_LEFT);
 
         SdrHitKind eHit = mpView->PickAnything(aMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
 
diff --git a/sd/source/ui/func/fuediglu.cxx b/sd/source/ui/func/fuediglu.cxx
index 889a2bf..74e1f59 100644
--- a/sd/source/ui/func/fuediglu.cxx
+++ b/sd/source/ui/func/fuediglu.cxx
@@ -309,7 +309,7 @@ bool FuEditGluePoints::KeyInput(const KeyEvent& rKEvt)
                 Point ePoint = aPoint + Point(nX,nY);
                 mpWindow->SetPointerPosPixel(ePoint);
                 //simulate mouse move action
-                MouseEvent eMevt(ePoint,1,2,MOUSE_LEFT, 0);
+                MouseEvent eMevt(ePoint, 1, MouseEventModifiers::DRAGMOVE, MOUSE_LEFT, 0);
                 MouseMove(eMevt);
                 oldPoint = ePoint;
                 bBeginInsertPoint = true;
@@ -324,14 +324,18 @@ bool FuEditGluePoints::KeyInput(const KeyEvent& rKEvt)
                 {
                     mpWindow->SetPointerPosPixel(oldPoint);
                     //simulate mouse button down action
-                    MouseEvent aMevt(oldPoint,1,3,MOUSE_LEFT,KEY_SHIFT);
+                    MouseEvent aMevt(oldPoint, 1,
+                                     MouseEventModifiers::SIMPLEMOVE | MouseEventModifiers::DRAGMOVE,
+                                     MOUSE_LEFT, KEY_SHIFT);
                     // MT IA2: Not used?
                     // sal_uInt16 ubuttons = aMevt.GetButtons();
                     // sal_uInt16 uMod      = aMevt.GetModifier();
                     MouseButtonDown(aMevt);
                     mpWindow->CaptureMouse();
                     //simulate mouse button up action
-                    MouseEvent rMEvt(oldPoint+Point(0,0),1,17, MOUSE_LEFT, KEY_SHIFT);
+                    MouseEvent rMEvt(oldPoint+Point(0,0), 1,
+                                     MouseEventModifiers::SIMPLEMOVE | MouseEventModifiers::ENTERWINDOW,
+                                     MOUSE_LEFT, KEY_SHIFT);
                     MouseButtonUp(rMEvt);
                     bReturn= true;
                 }
diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx
index c98211e..1f19ac3 100644
--- a/sd/source/ui/func/fupoor.cxx
+++ b/sd/source/ui/func/fupoor.cxx
@@ -180,7 +180,7 @@ IMPL_LINK_NOARG_INLINE_START(FuPoor, ScrollHdl)
 
     // use remembered MouseButton state to create correct
     // MouseEvents for this artificial MouseMove.
-    MouseMove(MouseEvent(aPnt, 1, 0, GetMouseButtonCode()));
+    MouseMove(MouseEvent(aPnt, 1, MouseEventModifiers::NONE, GetMouseButtonCode()));
 
     return 0;
 }
@@ -989,7 +989,7 @@ IMPL_LINK_NOARG_INLINE_START(FuPoor, DelayHdl)
 
     // use remembered MouseButton state to create correct
     // MouseEvents for this artificial MouseMove.
-    MouseMove(MouseEvent(aPnt, 1, 0, GetMouseButtonCode()));
+    MouseMove(MouseEvent(aPnt, 1, MouseEventModifiers::NONE, GetMouseButtonCode()));
 
     return 0;
 }
diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx
index 51d134e..0e3c0de 100644
--- a/sd/source/ui/func/fusel.cxx
+++ b/sd/source/ui/func/fusel.cxx
@@ -950,7 +950,7 @@ bool FuSelection::KeyInput(const KeyEvent& rKEvt)
                 Point ePoint = aPoint + Point(nX,nY);
                 mpWindow->SetPointerPosPixel(ePoint);
                 //simulate mouse move action
-                MouseEvent eMevt(ePoint,1,2, MOUSE_LEFT, 0);
+                MouseEvent eMevt(ePoint, 1, MouseEventModifiers::DRAGMOVE, MOUSE_LEFT, 0);
                 MouseMove(eMevt);
                 oldPoint = ePoint;
                 bMovedToCenterPoint = true;
@@ -964,7 +964,9 @@ bool FuSelection::KeyInput(const KeyEvent& rKEvt)
                 if(!bBeginInsertPoint)
                 {
                     //simulate mouse button down action
-                    MouseEvent aMevt(oldPoint,1,3, MOUSE_LEFT, KEY_SHIFT);
+                    MouseEvent aMevt(oldPoint, 1,
+                                     MouseEventModifiers::SIMPLEMOVE | MouseEventModifiers::DRAGMOVE,
+                                     MOUSE_LEFT, KEY_SHIFT);
                     MouseButtonDown(aMevt);
                     mpWindow->CaptureMouse();
                     bBeginInsertPoint = true;
@@ -972,7 +974,9 @@ bool FuSelection::KeyInput(const KeyEvent& rKEvt)
                 else
                 {
                     //simulate mouse button up action
-                    MouseEvent rMEvt(oldPoint,1,17, MOUSE_LEFT, KEY_SHIFT);
+                    MouseEvent rMEvt(oldPoint, 1,
+                                     MouseEventModifiers::SIMPLEMOVE | MouseEventModifiers::ENTERWINDOW,
+                                     MOUSE_LEFT, KEY_SHIFT);
                     MouseButtonUp(rMEvt);
                     bBeginInsertPoint = false;
                 }
diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx
index 70e8280..27ba304 100644
--- a/sfx2/source/statbar/stbitem.cxx
+++ b/sfx2/source/statbar/stbitem.cxx
@@ -324,7 +324,7 @@ throw ( uno::RuntimeException, std::exception )
 
     ::MouseEvent aMouseEvent( aPos,
                               (sal_uInt16)rMouseEvent.ClickCount,
-                              0,
+                              MouseEventModifiers::NONE,
                               convertAwtToVCLMouseButtons( rMouseEvent.Buttons ),
                               0 );
 
@@ -342,7 +342,7 @@ throw (uno::RuntimeException, std::exception)
 
     ::MouseEvent aMouseEvent( aPos,
                               (sal_uInt16)rMouseEvent.ClickCount,
-                              0,
+                              MouseEventModifiers::NONE,
                               convertAwtToVCLMouseButtons( rMouseEvent.Buttons ),
                               0 );
     return MouseMove( aMouseEvent );
@@ -359,7 +359,7 @@ throw ( uno::RuntimeException, std::exception )
 
     ::MouseEvent aMouseEvent( aPos,
                               (sal_uInt16)rMouseEvent.ClickCount,
-                              0,
+                              MouseEventModifiers::NONE,
                               convertAwtToVCLMouseButtons( rMouseEvent.Buttons ),
                               0 );
     return MouseButtonUp( aMouseEvent );
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index 64abdb2..7e7e7ea 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -1582,7 +1582,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
         DoubleClick( rEvt );
     }
     // selections
-    else if ( ( rEvt.GetMode() & ( MOUSE_SELECT | MOUSE_SIMPLECLICK ) ) &&
+    else if ( ( rEvt.GetMode() & ( MouseEventModifiers::SELECT | MouseEventModifiers::SIMPLECLICK ) ) &&
          ( bColumnCursor || rEvt.GetRow() >= 0 ) )
     {
         if ( rEvt.GetClicks() == 1 )
@@ -1626,7 +1626,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
                         }
 
                         // expanding mode?
-                        if ( rEvt.GetMode() & MOUSE_RANGESELECT )
+                        if ( rEvt.GetMode() & MouseEventModifiers::RANGESELECT )
                         {
                             // select the further touched rows too
                             bSelect = true;
@@ -1639,13 +1639,12 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
                         {
                             // wait for Drag&Drop
                             bHit = true;
-                            bExtendedMode = MOUSE_MULTISELECT ==
-                                    ( rEvt.GetMode() & MOUSE_MULTISELECT );
+                            bExtendedMode = bool( rEvt.GetMode() & MouseEventModifiers::MULTISELECT );
                             return;
                         }
 
                         // extension mode?
-                        else if ( rEvt.GetMode() & MOUSE_MULTISELECT )
+                        else if ( rEvt.GetMode() & MouseEventModifiers::MULTISELECT )
                         {
                             // determine the new selection range
                             // and selection/deselection
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index f27af1c..027eb03 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -403,7 +403,7 @@ void BrowserDataWin::Command( const CommandEvent& rEvt )
 
     Point aEventPos( rEvt.GetMousePosPixel() );
     long nRow = pBox->GetRowAtYPosPixel( aEventPos.Y(), false);
-    MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT );
+    MouseEvent aMouseEvt( aEventPos, 1, MouseEventModifiers::SELECT, MOUSE_LEFT );
     if ( COMMAND_CONTEXTMENU == rEvt.GetCommand() && rEvt.IsMouseEvent() &&
          nRow < pBox->GetRowCount() && !pBox->IsRowSelected(nRow) )
     {
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 154ead8..60e6fc2 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -1307,7 +1307,7 @@ void SvTreeListBox::StartDrag( sal_Int8, const Point& rPosPixel )
 {
 
     Point aEventPos( rPosPixel );
-    MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT );
+    MouseEvent aMouseEvt( aEventPos, 1, MouseEventModifiers::SELECT, MOUSE_LEFT );
     MouseButtonUp( aMouseEvt );
 
     nOldDragMode = GetDragDropMode();
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 2e8fa76..10fb757 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -897,7 +897,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
             return;
     }
 
-    if ( (rMEvt.GetMode() & (MOUSE_MULTISELECT | MOUSE_RANGESELECT)) && (rMEvt.GetClicks() == 1) )
+    if ( (rMEvt.GetMode() & (MouseEventModifiers::MULTISELECT | MouseEventModifiers::RANGESELECT)) && (rMEvt.GetClicks() == 1) )
     {
         if ( nSelId )
         {
@@ -907,7 +907,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
 
             if ( pItem->mbEnable )
             {
-                if ( (rMEvt.GetMode() & MOUSE_MULTISELECT) && (mnWinStyle & WB_MULTISELECT) )
+                if ( (rMEvt.GetMode() & MouseEventModifiers::MULTISELECT) && (mnWinStyle & WB_MULTISELECT) )
                 {
                     if ( nSelId != mnCurPageId )
                     {
diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx
index f87d310..4d2ca79 100644
--- a/svx/source/dialog/connctrl.cxx
+++ b/svx/source/dialog/connctrl.cxx
@@ -135,7 +135,7 @@ void SvxXConnectionPreview::AdaptSize()
         SetMapMode( aDisplayMap );
 
         Point aPos;
-        MouseEvent aMEvt( aPos, 1, 0, MOUSE_RIGHT );
+        MouseEvent aMEvt( aPos, 1, MouseEventModifiers::NONE, MOUSE_RIGHT );
         MouseButtonDown( aMEvt );
     }
 }
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index c8a9dcf..f9514e7 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -3494,7 +3494,7 @@ void FmXGridCell::onWindowEvent( const sal_uIntPtr _nEventId, const vcl::Window&
             {
                 awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( rMouseEvent, *this ) );
                 aEvent.ClickCount = 0;
-                const bool bSimpleMove = ( ( rMouseEvent.GetMode() & MOUSE_SIMPLEMOVE ) != 0 );
+                const bool bSimpleMove = bool( rMouseEvent.GetMode() & MouseEventModifiers::SIMPLEMOVE );
                 m_aMouseMotionListeners.notifyEach( bSimpleMove ? &awt::XMouseMotionListener::mouseMoved: &awt::XMouseMotionListener::mouseDragged, aEvent );
             }
         }
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index bf7ca1c..784d1e8 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -63,7 +63,7 @@ SdrViewEvent::SdrViewEvent()
       eHdlKind(HDL_MOVE),
       eEndCreateCmd(SDRCREATE_NEXTPOINT),
       nMouseClicks(0),
-      nMouseMode(0),
+      nMouseMode(MouseEventModifiers::NONE),
       nMouseCode(0),
       nHlplIdx(0),
       nGlueId(0),
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index f7d7b41..8bdec54 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -682,7 +682,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
                     aWhere = Point( -1, -1 );
                 }
 
-                MouseEvent aMEvt( aWhere, 1, MOUSE_SIMPLECLICK, MOUSE_LEFT, 0 );
+                MouseEvent aMEvt( aWhere, 1, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT, 0 );
                 awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( aMEvt, *this ) );
                 aEvent.PopupTrigger = sal_True;
 
@@ -714,7 +714,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
             {
                 awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *pMouseEvt, *this ) );
                 aEvent.ClickCount = 0;  // #92138#
-                if ( pMouseEvt->GetMode() & MOUSE_SIMPLEMOVE )
+                if ( pMouseEvt->GetMode() & MouseEventModifiers::SIMPLEMOVE )
                     mpImpl->getMouseMotionListeners().mouseMoved( aEvent );
                 else
                     mpImpl->getMouseMotionListeners().mouseDragged( aEvent );
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index 2b2082e..431b512 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -49,6 +49,7 @@ class ImplFontCache;
 class VCLXWindow;
 class SalFrame;
 class SalObject;
+enum class MouseEventModifiers;
 
 namespace com {
 namespace sun {
@@ -158,7 +159,7 @@ struct ImplFrameData
     sal_uInt16          mnClickCount;           //< mouse click count
     sal_uInt16          mnFirstMouseCode;       //< mouse code by mousebuttondown
     sal_uInt16          mnMouseCode;            //< mouse code
-    sal_uInt16          mnMouseMode;            //< mouse mode
+    MouseEventModifiers mnMouseMode;            //< mouse mode
     MapUnit             meMapUnit;              //< last MapUnit for LogicUnitToPixel
     bool                mbHasFocus;             //< focus
     bool                mbInMouseMove;          //< is MouseMove on stack
@@ -377,7 +378,7 @@ public:
 
 bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMouseLeave,
                            long nX, long nY, sal_uIntPtr nMsgTime,
-                           sal_uInt16 nCode, sal_uInt16 nMode );
+                           sal_uInt16 nCode, MouseEventModifiers nMode );
 void ImplHandleResize( vcl::Window* pWindow, long nNewWidth, long nNewHeight );
 
 #endif // INCLUDED_VCL_INC_WINDOW_H
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index 1249ad4..783312f 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -140,7 +140,7 @@ void Window::ImplCallMouseMove( sal_uInt16 nMouseCode, bool bModChanged )
         long    nX      = mpWindowImpl->mpFrameData->mnLastMouseX;
         long    nY      = mpWindowImpl->mpFrameData->mnLastMouseY;
         sal_uInt16  nCode   = nMouseCode;
-        sal_uInt16  nMode   = mpWindowImpl->mpFrameData->mnMouseMode;
+        MouseEventModifiers nMode = mpWindowImpl->mpFrameData->mnMouseMode;
         bool    bLeave;
         // check for MouseLeave
         if ( ((nX < 0) || (nY < 0) ||
@@ -150,9 +150,9 @@ void Window::ImplCallMouseMove( sal_uInt16 nMouseCode, bool bModChanged )
             bLeave = true;
         else
             bLeave = false;
-        nMode |= MOUSE_SYNTHETIC;
+        nMode |= MouseEventModifiers::SYNTHETIC;
         if ( bModChanged )
-            nMode |= MOUSE_MODIFIERCHANGED;
+            nMode |= MouseEventModifiers::MODIFIERCHANGED;
         ImplHandleMouseEvent( mpWindowImpl->mpFrameWindow, EVENT_MOUSEMOVE, bLeave, nX, nY, nTime, nCode, nMode );
     }
 }
diff --git a/vcl/source/window/mouseevent.cxx b/vcl/source/window/mouseevent.cxx
index 3fb692d..d4a493c 100644
--- a/vcl/source/window/mouseevent.cxx
+++ b/vcl/source/window/mouseevent.cxx
@@ -26,7 +26,7 @@
 /** inits this vcl KeyEvent with all settings from the given awt event **/
 MouseEvent::MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent )
 : maPos( rEvent.X, rEvent.Y )
-, mnMode( 0 )
+, mnMode( MouseEventModifiers::NONE )
 , mnClicks( static_cast< sal_uInt16 >( rEvent.ClickCount ) )
 , mnCode( 0 )
 {
@@ -38,8 +38,8 @@ MouseEvent::MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent )
             mnCode |= KEY_MOD1;
         if( (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD2) != 0 )
             mnCode |= KEY_MOD2;
-                if( (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD3) != 0 )
-                        mnCode |= KEY_MOD3;
+        if( (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD3) != 0 )
+            mnCode |= KEY_MOD3;
     }
 
     if( rEvent.Buttons )
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 4fc1725..90fe579 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3535,7 +3535,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
 {
     // pressing a modifier generates synthetic mouse moves
     // ignore it if keyboard selection is acive
-    if( HasFocus() && ( rMEvt.GetMode() & MOUSE_MODIFIERCHANGED ) )
+    if( HasFocus() && ( rMEvt.GetMode() & MouseEventModifiers::MODIFIERCHANGED ) )
         return;
 
     if ( ImplHandleMouseMove( rMEvt ) )
@@ -3625,7 +3625,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
 
     if ( (mnWinStyle & TB_WBLINESIZING) == TB_WBLINESIZING )
     {
-        if ( rMEvt.GetMode() & MOUSE_SIMPLEMOVE )
+        if ( rMEvt.GetMode() & MouseEventModifiers::SIMPLEMOVE )
         {
             sal_uInt16 nLinePtr = ImplTestLineSize( this, rMEvt.GetPosPixel() );
             if ( nLinePtr & DOCK_LINEHSIZE )
@@ -4384,7 +4384,7 @@ void ToolBox::Command( const CommandEvent& rCEvt )
 
             if ( mbCommandDrag )
             {
-                MouseEvent aMEvt( aMousePos, 1, MOUSE_SIMPLECLICK,
+                MouseEvent aMEvt( aMousePos, 1, MouseEventModifiers::SIMPLEMOVE,
                                   MOUSE_LEFT, KEY_MOD2 );
                 ToolBox::MouseButtonDown( aMEvt );
                 return;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index b446884..3691241 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1015,7 +1015,7 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p
         mpWindowImpl->mpFrameData->mnClickCount       = 0;
         mpWindowImpl->mpFrameData->mnFirstMouseCode   = 0;
         mpWindowImpl->mpFrameData->mnMouseCode        = 0;
-        mpWindowImpl->mpFrameData->mnMouseMode        = 0;
+        mpWindowImpl->mpFrameData->mnMouseMode        = MouseEventModifiers::NONE;
         mpWindowImpl->mpFrameData->meMapUnit          = MAP_PIXEL;
         mpWindowImpl->mpFrameData->mbHasFocus         = false;
         mpWindowImpl->mpFrameData->mbInMouseMove      = false;
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 5f6c8a6..8fe7d9d 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -362,8 +362,9 @@ IMPL_LINK( Window, ImplTrackTimerHdl, Timer*, pTimer )
         pOutDev->ReMirror( aMousePos );
     }
     MouseEvent      aMEvt( ImplFrameToOutput( aMousePos ),
-                           mpWindowImpl->mpFrameData->mnClickCount, 0,
-                           mpWindowImpl->mpFrameData->mnMouseCode, mpWindowImpl->mpFrameData->mnMouseCode );
+                           mpWindowImpl->mpFrameData->mnClickCount, MouseEventModifiers::NONE,
+                           mpWindowImpl->mpFrameData->mnMouseCode,
+                           mpWindowImpl->mpFrameData->mnMouseCode );
     TrackingEvent   aTEvt( aMEvt, TRACKING_REPEAT );
     Tracking( aTEvt );
 
@@ -430,8 +431,9 @@ void Window::EndTracking( sal_uInt16 nFlags )
             }
 
             MouseEvent      aMEvt( ImplFrameToOutput( aMousePos ),
-                                   mpWindowImpl->mpFrameData->mnClickCount, 0,
-                                   mpWindowImpl->mpFrameData->mnMouseCode, mpWindowImpl->mpFrameData->mnMouseCode );
+                                   mpWindowImpl->mpFrameData->mnClickCount, MouseEventModifiers::NONE,
+                                   mpWindowImpl->mpFrameData->mnMouseCode,
+                                   mpWindowImpl->mpFrameData->mnMouseCode );
             TrackingEvent   aTEvt( aMEvt, nFlags | ENDTRACK_END );
             Tracking( aTEvt );
         }
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index ee864f4..eba9491 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -269,7 +269,7 @@ static long ContextMenuEventLink( void* pCEvent, void* )
 
 bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMouseLeave,
                            long nX, long nY, sal_uLong nMsgTime,
-                           sal_uInt16 nCode, sal_uInt16 nMode )
+                           sal_uInt16 nCode, MouseEventModifiers nMode )
 {
     ImplSVData* pSVData = ImplGetSVData();
     Point       aMousePos( nX, nY );
@@ -309,7 +309,8 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMous
     pWinFrameData->mnLastMouseX = nX;
     pWinFrameData->mnLastMouseY = nY;
     pWinFrameData->mnMouseCode  = nCode;
-    pWinFrameData->mnMouseMode  = nMode & ~(MOUSE_SYNTHETIC | MOUSE_MODIFIERCHANGED);
+    MouseEventModifiers nTmpMask = MouseEventModifiers::SYNTHETIC | MouseEventModifiers::MODIFIERCHANGED;
+    pWinFrameData->mnMouseMode  = nMode & ~nTmpMask;
     if ( bMouseLeave )
     {
         pWinFrameData->mbMouseIn = false;
@@ -388,7 +389,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMous
             {
                 ImplHandleMouseHelpRequest( pChild, aMousePos );
                 if( pWinFrameData->mpMouseMoveWin != pChild )
-                    nMode |= MOUSE_ENTERWINDOW;
+                    nMode |= MouseEventModifiers::ENTERWINDOW;
             }
 
             // Call the hook also, if Window is disabled
@@ -537,7 +538,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMous
             if ( pMouseMoveWin )
             {
                 Point       aLeaveMousePos = pMouseMoveWin->ImplFrameToOutput( aMousePos );
-                MouseEvent  aMLeaveEvt( aLeaveMousePos, nClicks, nMode | MOUSE_LEAVEWINDOW, nCode, nCode );
+                MouseEvent  aMLeaveEvt( aLeaveMousePos, nClicks, nMode | MouseEventModifiers::LEAVEWINDOW, nCode, nCode );
                 NotifyEvent aNLeaveEvt( EVENT_MOUSEMOVE, pMouseMoveWin, &aMLeaveEvt );
                 ImplDelData aDelData;
                 ImplDelData aDelData2;
@@ -570,7 +571,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMous
                 pMouseMoveWin->ImplRemoveDel( &aDelData );
             }
 
-            nMode |= MOUSE_ENTERWINDOW;
+            nMode |= MouseEventModifiers::ENTERWINDOW;
         }
         pWinFrameData->mpMouseMoveWin = pChild;
         if( pChild )
@@ -1925,31 +1926,31 @@ static void ImplHandleUserEvent( ImplSVEvent* pSVEvent )
     }
 }
 
-static sal_uInt16 ImplGetMouseMoveMode( SalMouseEvent* pEvent )
+static MouseEventModifiers ImplGetMouseMoveMode( SalMouseEvent* pEvent )
 {
-    sal_uInt16 nMode = 0;
+    MouseEventModifiers nMode = MouseEventModifiers::NONE;
     if ( !pEvent->mnCode )
-        nMode |= MOUSE_SIMPLEMOVE;
+        nMode |= MouseEventModifiers::SIMPLEMOVE;
     if ( (pEvent->mnCode & MOUSE_LEFT) && !(pEvent->mnCode & KEY_MOD1) )
-        nMode |= MOUSE_DRAGMOVE;
+        nMode |= MouseEventModifiers::DRAGMOVE;
     if ( (pEvent->mnCode & MOUSE_LEFT) && (pEvent->mnCode & KEY_MOD1) )
-        nMode |= MOUSE_DRAGCOPY;
+        nMode |= MouseEventModifiers::DRAGCOPY;
     return nMode;
 }
 
-static sal_uInt16 ImplGetMouseButtonMode( SalMouseEvent* pEvent )
+static MouseEventModifiers ImplGetMouseButtonMode( SalMouseEvent* pEvent )
 {
-    sal_uInt16 nMode = 0;
+    MouseEventModifiers nMode = MouseEventModifiers::NONE;
     if ( pEvent->mnButton == MOUSE_LEFT )
-        nMode |= MOUSE_SIMPLECLICK;
+        nMode |= MouseEventModifiers::SIMPLECLICK;
     if ( (pEvent->mnButton == MOUSE_LEFT) && !(pEvent->mnCode & (MOUSE_MIDDLE | MOUSE_RIGHT)) )
-        nMode |= MOUSE_SELECT;
+        nMode |= MouseEventModifiers::SELECT;
     if ( (pEvent->mnButton == MOUSE_LEFT) && (pEvent->mnCode & KEY_MOD1) &&
          !(pEvent->mnCode & (MOUSE_MIDDLE | MOUSE_RIGHT | KEY_SHIFT)) )
-        nMode |= MOUSE_MULTISELECT;
+        nMode |= MouseEventModifiers::MULTISELECT;
     if ( (pEvent->mnButton == MOUSE_LEFT) && (pEvent->mnCode & KEY_SHIFT) &&
          !(pEvent->mnCode & (MOUSE_MIDDLE | MOUSE_RIGHT | KEY_MOD1)) )
-        nMode |= MOUSE_RANGESELECT;
+        nMode |= MouseEventModifiers::RANGESELECT;
     return nMode;
 }
 
commit adaf5229afa37331da6fac2c4711494f53a2e067
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 6 14:58:23 2014 +0200

    bug in typed flags
    
    /home/noel/libo2/o3tl/qa/test-typed_flags.cxx:50:52:
    error: invalid argument type 'typename o3tl::typed_flags<ConfigurationChangedHint>::Wrap' to unary expression
    ConfigurationChangedHint nHint2  = nHint & ~(ConfigurationChangedHint::ONE | ConfigurationChangedHint::TWO);
                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    
    Change-Id: Ia03e1e7d6afff0bdbb87e82ec076d5ffb820afb2

diff --git a/o3tl/qa/test-typed_flags.cxx b/o3tl/qa/test-typed_flags.cxx
index d5b5ff7..3fe327e 100644
--- a/o3tl/qa/test-typed_flags.cxx
+++ b/o3tl/qa/test-typed_flags.cxx
@@ -46,6 +46,9 @@ public:
 
         nHint &= ConfigurationChangedHint::ONE;
         CPPUNIT_ASSERT( bool(nHint &= ConfigurationChangedHint::ONE) );
+
+        ConfigurationChangedHint nHint2  = nHint & ~(ConfigurationChangedHint::ONE | ConfigurationChangedHint::TWO);
+
     }
 
     // Change the following lines only, if you add, remove or rename


More information about the Libreoffice-commits mailing list