tdf#114441: Use tools::Long for wheel distances

mnMaxWidth stores values from Size::Width()
and Size::Height(). These values are ultimately
derived from Pair::mnA and Pair::mnB, which are
tools::Long values.

mnActDist stores value calculated from nDistX
and nDistY, which are also tools::Long values.

Therefore, use tools::Long for both member
variables to maintain consistency.

Change-Id: If06b7a746ae3a4ffdac14461ba1ab0d8ece1f733
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205732
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Brian Yoon
2026-05-28 09:03:02 +02:00
committed by Michael Weghorn
parent e0a8f228e1
commit 6ad6a8fd4b
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -49,8 +49,8 @@ private:
sal_uInt64 mnRepaintTime;
sal_uInt64 mnTimeout;
WheelMode mnWheelMode;
sal_uLong mnMaxWidth;
sal_uLong mnActDist;
tools::Long mnMaxWidth;
tools::Long mnActDist;
tools::Long mnStepDeltaX; // x component of scroll direction
tools::Long mnStepDeltaY; // y component of scroll direction
tools::Long mnActDeltaX; // x component of scroll distance
+2 -2
View File
@@ -60,7 +60,7 @@ ImplWheelWindow::ImplWheelWindow( vcl::Window* pParent ) :
const bool bVert( nFlags & StartAutoScrollFlags::Vert );
// calculate maximum speed distance
mnMaxWidth = static_cast<sal_uLong>( 0.4 * hypot( static_cast<double>(aSize.Width()), aSize.Height() ) );
mnMaxWidth = static_cast<tools::Long>( 0.4 * hypot( static_cast<double>(aSize.Width()), aSize.Height() ) );
// create wheel window
SetTitleType( FloatWinTitleType::NONE );
@@ -309,7 +309,7 @@ void ImplWheelWindow::MouseMove( const MouseEvent& rMEvt )
const tools::Long nDistX = aMousePos.X() - maCenter.X();
const tools::Long nDistY = aMousePos.Y() - maCenter.Y();
mnActDist = static_cast<sal_uLong>(hypot( static_cast<double>(nDistX), nDistY ));
mnActDist = static_cast<tools::Long>(hypot( static_cast<double>(nDistX), nDistY ));
const PointerStyle eActStyle = ImplGetMousePointer( nDistX, nDistY );
const StartAutoScrollFlags nFlags = ImplGetSVData()->mpWinData->mnAutoScrollFlags;