diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-07 12:30:39 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-07 14:53:36 +0200 |
commit | 31d902d3c00fdc5f088aff433b7ebf308a718339 (patch) | |
tree | 07b113a7e8d6bc7f6ba89bd5b6af002a594e6120 /svtools | |
parent | adaf5229afa37331da6fac2c4711494f53a2e067 (diff) |
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
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/brwbox/brwbox2.cxx | 9 | ||||
-rw-r--r-- | svtools/source/brwbox/datwin.cxx | 2 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/tabbar.cxx | 4 |
4 files changed, 8 insertions, 9 deletions
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 64abdb2072e3..7e7e7eab5e2f 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 f27af1cd60c5..027eb0353253 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 154ead8e29cb..60e6fc2515db 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 2e8fa764f6b8..10fb75782778 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 ) { |