diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-30 12:21:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-01 08:31:18 +0200 |
commit | c6fc14a42e068877af844b2695dea8939517c1ac (patch) | |
tree | f8e1044c552a2caa147dcecb70165cf0860ca078 /vcl/source | |
parent | bde0cc68bd6443c97b4ca061ed7132f478959281 (diff) |
loplugin:singlevalfields
Change-Id: I8b0ae3ae7e742bf5a5078681a51e8a81d5110a17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97527
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/control/calendar.cxx | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/vcl/source/control/calendar.cxx b/vcl/source/control/calendar.cxx index bc6653b95181..c306185f1907 100644 --- a/vcl/source/control/calendar.cxx +++ b/vcl/source/control/calendar.cxx @@ -74,12 +74,10 @@ void Calendar::ImplInit( WinBits nWinStyle ) mbCalc = true; mbFormat = true; mbDrag = false; - mbSelection = false; mbMenuDown = false; mbSpinDown = false; mbPrevIn = false; mbNextIn = false; - mbAllSel = false; OUString aGregorian( "gregorian"); maCalendarWrapper.loadCalendar( aGregorian, @@ -945,11 +943,10 @@ void Calendar::ImplTracking( const Point& rPos, bool bRepeat ) void Calendar::ImplEndTracking( bool bCancel ) { - bool bSelection = mbSelection; + bool bSelection = false; bool bSpinDown = mbSpinDown; mbDrag = false; - mbSelection = false; mbSpinDown = false; mbPrevIn = false; mbNextIn = false; @@ -992,8 +989,7 @@ void Calendar::ImplEndTracking( bool bCancel ) } } - if ( mbAllSel || - (!bCancel && ((maCurDate != maOldCurDate) || (*mpOldSelectTable != *mpSelectTable))) ) + if ( !bCancel && ((maCurDate != maOldCurDate) || (*mpOldSelectTable != *mpSelectTable)) ) Select(); if ( !bSelection && (mnWinStyle & WB_TABSTOP) && !bCancel ) @@ -1034,11 +1030,8 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt ) maOldCurDate = maCurDate; mpOldSelectTable.reset(new IntDateSet( *mpSelectTable )); - if ( !mbSelection ) - { - mbDrag = true; - StartTracking(); - } + mbDrag = true; + StartTracking(); ImplMouseSelect( aTempDate, nHitTest ); } @@ -1054,22 +1047,6 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt ) Control::MouseButtonDown( rMEvt ); } -void Calendar::MouseButtonUp( const MouseEvent& rMEvt ) -{ - if ( rMEvt.IsLeft() && mbSelection ) - ImplEndTracking( false ); - else - Control::MouseButtonUp( rMEvt ); -} - -void Calendar::MouseMove( const MouseEvent& rMEvt ) -{ - if ( mbSelection && rMEvt.GetButtons() ) - ImplTracking( rMEvt.GetPosPixel(), false ); - else - Control::MouseMove( rMEvt ); -} - void Calendar::Tracking( const TrackingEvent& rTEvt ) { Point aMousePos = rTEvt.GetMouseEvent().GetPosPixel(); @@ -1217,7 +1194,7 @@ void Calendar::Command( const CommandEvent& rCEvt ) { if ( rCEvt.GetCommand() == CommandEventId::ContextMenu ) { - if ( !mbSelection && rCEvt.IsMouseEvent() ) + if ( rCEvt.IsMouseEvent() ) { Date aTempDate = maCurDate; sal_uInt16 nHitTest = ImplHitTest( rCEvt.GetMousePosPixel(), aTempDate ); @@ -1501,13 +1478,11 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const void Calendar::EndSelection() { - if ( mbDrag || mbSpinDown || mbSelection ) + if ( mbDrag || mbSpinDown ) { - if ( !mbSelection ) - ReleaseMouse(); + ReleaseMouse(); mbDrag = false; - mbSelection = false; mbSpinDown = false; mbPrevIn = false; mbNextIn = false; |