From f829af4d8087f5521379002797821ab1c678916d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 27 Jan 2014 20:34:43 +0000 Subject: coverity#1132708 Unintended sign extension Change-Id: Iaf73bf619c6dfa8c29b02c35410aadf972a71448 --- svx/source/dialog/dlgctrl.cxx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'svx') diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 1081bf43d65e..11ecdca74cbf 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -784,10 +784,8 @@ void SvxRectCtl::SetCS(CTL_STYLE eNew) //Logic Pixel long SvxPixelCtl::PointToIndex(const Point &aPt) const { - sal_uInt16 nX, nY; - - nX = (sal_uInt16) ( aPt.X() * nLines / aRectSize.Width() ); - nY = (sal_uInt16) ( aPt.Y() * nLines / aRectSize.Height() ); + sal_Int32 nX = aPt.X() * nLines / aRectSize.Width(); + sal_Int32 nY = aPt.Y() * nLines / aRectSize.Height(); return nX + nY * nLines ; } @@ -796,8 +794,8 @@ Point SvxPixelCtl::IndexToPoint(long nIndex) const { DBG_ASSERT(nIndex >= 0 && nIndex < nSquares ," Check Index"); - sal_uInt16 nXIndex = nIndex % nLines ; - sal_uInt16 nYIndex = sal_uInt16(nIndex / nLines) ; + sal_Int32 nXIndex = nIndex % nLines; + sal_Int32 nYIndex = nIndex / nLines; Point aPtTl; aPtTl.Y() = aRectSize.Height() * nYIndex / nLines + 1; @@ -815,9 +813,8 @@ long SvxPixelCtl::ShowPosition( const Point &pt) { Point aPt = PixelToLogic( pt ); - sal_uInt16 nX, nY; - nX = (sal_uInt16) ( aPt.X() * nLines / aRectSize.Width() ); - nY = (sal_uInt16) ( aPt.Y() * nLines / aRectSize.Height() ); + sal_Int32 nX = aPt.X() * nLines / aRectSize.Width(); + sal_Int32 nY = aPt.Y() * nLines / aRectSize.Height(); ChangePixel( nX + nY * nLines ); -- cgit