summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-27 20:34:43 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-01-28 11:29:16 +0000
commitf829af4d8087f5521379002797821ab1c678916d (patch)
treece5307a12c7fe3e42470953ed2db038c83a69db7 /svx
parenta2a0e1b2a587d846450a129189ea3c5c324f362d (diff)
coverity#1132708 Unintended sign extension
Change-Id: Iaf73bf619c6dfa8c29b02c35410aadf972a71448
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/dlgctrl.cxx15
1 files changed, 6 insertions, 9 deletions
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 );