[Libreoffice-commits] core.git: include/svx svx/source vcl/inc vcl/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 1 06:32:04 UTC 2020
include/svx/svdmrkv.hxx | 2 +-
svx/source/svdraw/svdmrkv.cxx | 1 -
vcl/inc/calendar.hxx | 6 +-----
vcl/source/control/calendar.cxx | 39 +++++++--------------------------------
4 files changed, 9 insertions(+), 39 deletions(-)
New commits:
commit c6fc14a42e068877af844b2695dea8939517c1ac
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Jun 30 12:21:20 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jul 1 08:31:18 2020 +0200
loplugin:singlevalfields
Change-Id: I8b0ae3ae7e742bf5a5078681a51e8a81d5110a17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97527
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index c7d7a4db4189..bc4016d69801 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -114,7 +114,7 @@ protected:
tools::Rectangle maMarkedPointsRect;
tools::Rectangle maMarkedGluePointsRect;
- sal_uInt16 mnFrameHandlesLimit;
+ static constexpr sal_uInt16 mnFrameHandlesLimit = 50;
SdrDragMode meDragMode; // Persistent
SdrViewEditMode meEditMode; // Persistent
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 037bc7e4ad63..8ff7b08a17ee 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -172,7 +172,6 @@ void SdrMarkView::ImpClearVars()
mpMarkedPV=nullptr;
mbForceFrameHandles=false;
mbPlusHdlAlways=false;
- mnFrameHandlesLimit=50;
mbInsPolyPoint=false;
mbMarkedObjRectDirty=false;
mbMarkedPointsRectsDirty=false;
diff --git a/vcl/inc/calendar.hxx b/vcl/inc/calendar.hxx
index de209dea5f8c..46aea4c63c1f 100644
--- a/vcl/inc/calendar.hxx
+++ b/vcl/inc/calendar.hxx
@@ -151,12 +151,10 @@ class Calendar final : public Control
bool mbCalc:1,
mbFormat:1,
mbDrag:1,
- mbSelection:1,
mbMenuDown:1,
mbSpinDown:1,
mbPrevIn:1,
- mbNextIn:1,
- mbAllSel:1;
+ mbNextIn:1;
Link<Calendar*,void> maSelectHdl;
Link<Calendar*,void> maActivateHdl;
@@ -193,8 +191,6 @@ public:
virtual void dispose() override;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
- virtual void MouseButtonUp( const MouseEvent& rMEvt ) override;
- virtual void MouseMove( const MouseEvent& rMEvt ) override;
virtual void Tracking( const TrackingEvent& rMEvt ) override;
virtual void KeyInput( const KeyEvent& rKEvt ) override;
virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
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;
More information about the Libreoffice-commits
mailing list