[Libreoffice-commits] core.git: filter/source svx/source tools/source vcl/qa vcl/source
udareechk
udareeck at gmail.com
Mon Oct 30 14:57:24 UTC 2017
filter/source/graphicfilter/ipcd/ipcd.cxx | 6 +++---
filter/source/msfilter/msdffimp.cxx | 4 ++--
svx/source/sdr/contact/objectcontactofobjlistpainter.cxx | 2 +-
svx/source/svdraw/svdfmtf.cxx | 8 ++++----
svx/source/svdraw/svdocirc.cxx | 4 ++--
svx/source/unodraw/unoshape.cxx | 2 +-
tools/source/generic/poly.cxx | 8 ++++----
vcl/qa/cppunit/canvasbitmaptest.cxx | 2 +-
vcl/source/helper/canvastools.cxx | 2 +-
9 files changed, 19 insertions(+), 19 deletions(-)
New commits:
commit f9b3a1db585e103bb93be0b5954de6858ad42c51
Author: udareechk <udareeck at gmail.com>
Date: Wed Sep 27 12:05:23 2017 +0530
tdf#96505 Get rid of cargo cult long integer literals
Removing unnecessary 1L occurrences
Change-Id: I85d4949eacde0dfc0ff7a513f4bf42324e6d34c1
Reviewed-on: https://gerrit.libreoffice.org/42840
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/filter/source/graphicfilter/ipcd/ipcd.cxx b/filter/source/graphicfilter/ipcd/ipcd.cxx
index b83af75cec9a..d4a49be998e4 100644
--- a/filter/source/graphicfilter/ipcd/ipcd.cxx
+++ b/filter/source/graphicfilter/ipcd/ipcd.cxx
@@ -308,17 +308,17 @@ void PCDReader::ReadImage()
nL *= 89024;
nCb -= 156;
nCr -= 137;
- nRed = ( nL + nCr * 119374L + 0x8000 ) >> 16;
+ nRed = ( nL + nCr * 119374 + 0x8000 ) >> 16;
if ( nRed < 0 )
nRed = 0;
if ( nRed > 255)
nRed = 255;
- nGreen = ( nL - nCb * 28198L - nCr * 60761L + 0x8000 ) >> 16;
+ nGreen = ( nL - nCb * 28198 - nCr * 60761 + 0x8000 ) >> 16;
if ( nGreen < 0 )
nGreen = 0;
if ( nGreen > 255 )
nGreen = 255;
- nBlue = ( nL + nCb * 145352L + 0x8000 ) >> 16;
+ nBlue = ( nL + nCb * 145352 + 0x8000 ) >> 16;
if ( nBlue < 0 )
nBlue = 0;
if ( nBlue > 255 )
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 5f2dab8ec0f2..f2d424de9f02 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4763,8 +4763,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
nSpFlags &= ~ShapeFlag::FlipV;
}
- pRet->NbcSetPoint(aPoint1, 0L); // start point
- pRet->NbcSetPoint(aPoint2, 1L); // endpoint
+ pRet->NbcSetPoint(aPoint1, 0); // start point
+ pRet->NbcSetPoint(aPoint2, 1); // endpoint
sal_Int32 n1HorzDist, n1VertDist, n2HorzDist, n2VertDist;
n1HorzDist = n1VertDist = n2HorzDist = n2VertDist = 0;
diff --git a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
index f3362376fac1..ee202580b252 100644
--- a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
+++ b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
@@ -154,7 +154,7 @@ OutputDevice* ObjectContactOfObjListPainter::TryToGetOutputDevice() const
sal_uInt32 ObjectContactOfPagePainter::GetPaintObjectCount() const
{
- return (GetStartPage() ? 1L : 0L);
+ return (GetStartPage() ? 1 : 0);
}
ViewContact& ObjectContactOfPagePainter::GetPaintObjectViewContact(sal_uInt32 /*nIndex*/)
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 60fe1ed4c867..b88a0485577b 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -793,27 +793,27 @@ bool ImpSdrGDIMetaFileImport::CheckLastLineMerge(const basegfx::B2DPolygon& rSrc
if(aDstPoly.getB2DPoint(nMaxDstPnt) == rSrcPoly.getB2DPoint(0))
{
- aDstPoly.append(rSrcPoly, 1L, rSrcPoly.count() - 1);
+ aDstPoly.append(rSrcPoly, 1, rSrcPoly.count() - 1);
bOk = true;
}
else if(aDstPoly.getB2DPoint(0) == rSrcPoly.getB2DPoint(nMaxSrcPnt))
{
basegfx::B2DPolygon aNew(rSrcPoly);
- aNew.append(aDstPoly, 1L, aDstPoly.count() - 1);
+ aNew.append(aDstPoly, 1, aDstPoly.count() - 1);
aDstPoly = aNew;
bOk = true;
}
else if(aDstPoly.getB2DPoint(0) == rSrcPoly.getB2DPoint(0))
{
aDstPoly.flip();
- aDstPoly.append(rSrcPoly, 1L, rSrcPoly.count() - 1);
+ aDstPoly.append(rSrcPoly, 1, rSrcPoly.count() - 1);
bOk = true;
}
else if(aDstPoly.getB2DPoint(nMaxDstPnt) == rSrcPoly.getB2DPoint(nMaxSrcPnt))
{
basegfx::B2DPolygon aNew(rSrcPoly);
aNew.flip();
- aDstPoly.append(aNew, 1L, aNew.count() - 1);
+ aDstPoly.append(aNew, 1, aNew.count() - 1);
bOk = true;
}
}
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index 6809d0cd95b5..6d93e8b04452 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -1030,9 +1030,9 @@ void SdrCircObj::NbcSetSnapRect(const tools::Rectangle& rRect)
sal_uInt32 SdrCircObj::GetSnapPointCount() const
{
if (meCircleKind==OBJ_CIRC) {
- return 1L;
+ return 1;
} else {
- return 3L;
+ return 3;
}
}
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 9b32265423c5..98bb162a0b0d 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -2262,7 +2262,7 @@ bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertySimpl
if( mpModel->IsWriter() )
aPoint += mpObj->GetAnchorPos();
- pMeasureObj->NbcSetPoint( aPoint, pProperty->nWID == OWN_ATTR_MEASURE_START_POS ? 0L : 1L );
+ pMeasureObj->NbcSetPoint( aPoint, pProperty->nWID == OWN_ATTR_MEASURE_START_POS ? 0 : 1 );
pMeasureObj->SetChanged();
pMeasureObj->BroadcastObjectChange();
return true;
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index c44c5ecf7b69..1904d85d5a9d 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -1837,14 +1837,14 @@ Polygon::Polygon(const basegfx::B2DPolygon& rPolygon)
if(bCurve)
{
// #127979# Reduce source point count hard to the limit of the tools Polygon
- if(nB2DLocalCount > ((0x0000ffff / 3L) - 1))
+ if(nB2DLocalCount > ((0x0000ffff / 3) - 1))
{
OSL_FAIL("Polygon::Polygon: Too many points in given B2DPolygon, need to reduce hard to maximum of tools Polygon (!)");
- nB2DLocalCount = ((0x0000ffff / 3L) - 1);
+ nB2DLocalCount = ((0x0000ffff / 3) - 1);
}
// calculate target point count
- const sal_uInt32 nLoopCount(bClosed ? nB2DLocalCount : (nB2DLocalCount ? nB2DLocalCount - 1 : 0L ));
+ const sal_uInt32 nLoopCount(bClosed ? nB2DLocalCount : (nB2DLocalCount ? nB2DLocalCount - 1 : 0 ));
if(nLoopCount)
{
@@ -1940,7 +1940,7 @@ Polygon::Polygon(const basegfx::B2DPolygon& rPolygon)
if(nB2DLocalCount)
{
// point list creation
- const sal_uInt32 nTargetCount(nB2DLocalCount + (bClosed ? 1L : 0L));
+ const sal_uInt32 nTargetCount(nB2DLocalCount + (bClosed ? 1 : 0));
mpImplPolygon = new ImplPolygon( static_cast< sal_uInt16 >(nTargetCount) );
sal_uInt16 nIndex(0);
diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx
index 734e3ca28fed..f8ad6160d256 100644
--- a/vcl/qa/cppunit/canvasbitmaptest.cxx
+++ b/vcl/qa/cppunit/canvasbitmaptest.cxx
@@ -190,7 +190,7 @@ void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp,
CPPUNIT_ASSERT_MESSAGE( "8bit or less: missing palette",
xPal.is());
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Palette incorrect entry count",
- static_cast<sal_Int32>(1L << nOriginalDepth), xPal->getNumberOfEntries());
+ static_cast<sal_Int32>(1 << nOriginalDepth), xPal->getNumberOfEntries());
uno::Sequence<double> aIndex;
CPPUNIT_ASSERT_MESSAGE( "Palette is not read-only",
!xPal->setIndex(aIndex,true,0));
diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx
index ef2732c6443c..8920265af010 100644
--- a/vcl/source/helper/canvastools.cxx
+++ b/vcl/source/helper/canvastools.cxx
@@ -293,7 +293,7 @@ namespace vcl
aAlpha = ::Bitmap( aPixelSize,
sal::static_int_cast<sal_uInt16>(nAlphaDepth),
&::Bitmap::GetGreyPalette(
- sal::static_int_cast<sal_uInt16>(1L << nAlphaDepth)) );
+ sal::static_int_cast<sal_uInt16>(1 << nAlphaDepth)) );
{ // limit scoped access
Bitmap::ScopedWriteAccess pWriteAccess( aBitmap );
More information about the Libreoffice-commits
mailing list