From 31d902d3c00fdc5f088aff433b7ebf308a718339 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 7 Nov 2014 12:30:39 +0200 Subject: 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 --- 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 +++++++--- 4 files changed, 17 insertions(+), 9 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 95755160dde5..613e74fe0827 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 889a2bf19df5..74e1f5974c3e 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 c98211e1bcc5..1f19ac34ccbd 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 51d134e60364..0e3c0ded7220 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; } -- cgit