summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorsahil <gautamsahil1947@gmail.com>2023-08-23 22:03:34 +0530
committerHossein <hossein@libreoffice.org>2023-10-25 11:27:28 +0200
commite558cbed9b350f2e6cbe948d648471499e0deffc (patch)
tree81c088e6771aaaa817e34c8d226900218785bcee /sc/source
parent0c50fe53acbd0ee98e93d52e9967f94543301473 (diff)
tdf#114441 - Convert use of sal_uLong to better integer types
nUpdateInterval (sal_uLong --> sal_uInt64) because it is passed as argument to Timer::SetTimeout function that takes a sal_uInt64 func CalcUpdateInterval (sal_uLong --> sal_uInt64 return type) because this function is only being called once, and in that call, the return value is passed to a function which takes sal_uInt64 type int. line 412 (https://opengrok.libreoffice.org/xref/core/sc/source/ui/view/select.cxx?r=b6b26421#412) two lines after which it is passed to a function ... and the function changed in vcl/source/window/seleng.cxx is the one to which the value of nUpdateInterval is being passed as explained in the lines above. Change-Id: I73441c2d3520a222ddb39b8c0c205b4dd61d4751 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156015 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/inc/select.hxx2
-rw-r--r--sc/source/ui/view/select.cxx12
2 files changed, 7 insertions, 7 deletions
diff --git a/sc/source/ui/inc/select.hxx b/sc/source/ui/inc/select.hxx
index e1223f91e793..299463afddd2 100644
--- a/sc/source/ui/inc/select.hxx
+++ b/sc/source/ui/inc/select.hxx
@@ -49,7 +49,7 @@ private:
ScSplitPos GetWhich() const;
- sal_uLong CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos,
+ sal_uInt64 CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos,
bool bLeftScroll, bool bTopScroll, bool bRightScroll, bool bBottomScroll );
public:
diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx
index 961f511131ba..d972c9b4eb8d 100644
--- a/sc/source/ui/view/select.cxx
+++ b/sc/source/ui/view/select.cxx
@@ -60,10 +60,10 @@ ScSplitPos ScViewFunctionSet::GetWhich() const
return m_pViewData->GetActivePart();
}
-sal_uLong ScViewFunctionSet::CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos,
+sal_uInt64 ScViewFunctionSet::CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos,
bool bLeftScroll, bool bTopScroll, bool bRightScroll, bool bBottomScroll )
{
- sal_uLong nUpdateInterval = SELENG_AUTOREPEAT_INTERVAL_MAX;
+ sal_uInt64 nUpdateInterval = SELENG_AUTOREPEAT_INTERVAL_MAX;
vcl::Window* pWin = m_pEngine->GetWindow();
AbsoluteScreenPixelRectangle aScrRect = pWin->GetDesktopRectPixel();
AbsoluteScreenPixelPoint aRootPos = pWin->OutputToAbsoluteScreenPixel(Point(0,0));
@@ -77,7 +77,7 @@ sal_uLong ScViewFunctionSet::CalcUpdateInterval( const Size& rWinSize, const Poi
if (nHAccelRate > 1.0)
nHAccelRate = 1.0;
- nUpdateInterval = static_cast<sal_uLong>(SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nHAccelRate));
+ nUpdateInterval = SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nHAccelRate);
}
if (bLeftScroll)
@@ -104,7 +104,7 @@ sal_uLong ScViewFunctionSet::CalcUpdateInterval( const Size& rWinSize, const Poi
if (nVAccelRate > 1.0)
nVAccelRate = 1.0;
- sal_uLong nTmp = static_cast<sal_uLong>(SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nVAccelRate));
+ sal_uInt64 nTmp = SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nVAccelRate);
if (nUpdateInterval > nTmp)
nUpdateInterval = nTmp;
}
@@ -118,7 +118,7 @@ sal_uLong ScViewFunctionSet::CalcUpdateInterval( const Size& rWinSize, const Poi
if (nVAccelRate > 1.0)
nVAccelRate = 1.0;
- sal_uLong nTmp = static_cast<sal_uLong>(SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nVAccelRate));
+ sal_uInt64 nTmp = SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nVAccelRate);
if (nUpdateInterval > nTmp)
nUpdateInterval = nTmp;
}
@@ -409,7 +409,7 @@ void ScViewFunctionSet::SetCursorAtPoint( const Point& rPointPixel, bool /* bDon
if (bScroll)
{
// Adjust update interval based on how far the mouse pointer is from the edge.
- sal_uLong nUpdateInterval = CalcUpdateInterval(
+ sal_uInt64 nUpdateInterval = CalcUpdateInterval(
aWinSize, aEffPos, bLeftScroll, bTopScroll, bRightScroll, bBottomScroll);
m_pEngine->SetUpdateInterval(nUpdateInterval);
}