From 6ad6a8fd4bb683ae9394cc6ad4320a299992d003 Mon Sep 17 00:00:00 2001 From: Brian Yoon Date: Tue, 26 May 2026 08:26:10 -0700 Subject: [PATCH] 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 --- vcl/inc/scrwnd.hxx | 4 ++-- vcl/source/window/scrwnd.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vcl/inc/scrwnd.hxx b/vcl/inc/scrwnd.hxx index 358b89145eb5..c5614ab77356 100644 --- a/vcl/inc/scrwnd.hxx +++ b/vcl/inc/scrwnd.hxx @@ -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 diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx index cb9771039c16..119aef8b2948 100644 --- a/vcl/source/window/scrwnd.cxx +++ b/vcl/source/window/scrwnd.cxx @@ -60,7 +60,7 @@ ImplWheelWindow::ImplWheelWindow( vcl::Window* pParent ) : const bool bVert( nFlags & StartAutoScrollFlags::Vert ); // calculate maximum speed distance - mnMaxWidth = static_cast( 0.4 * hypot( static_cast(aSize.Width()), aSize.Height() ) ); + mnMaxWidth = static_cast( 0.4 * hypot( static_cast(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(hypot( static_cast(nDistX), nDistY )); + mnActDist = static_cast(hypot( static_cast(nDistX), nDistY )); const PointerStyle eActStyle = ImplGetMousePointer( nDistX, nDistY ); const StartAutoScrollFlags nFlags = ImplGetSVData()->mpWinData->mnAutoScrollFlags;