diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-30 19:35:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-03 08:41:11 +0200 |
commit | d3971ec256450e6783920b46f672048b29719949 (patch) | |
tree | f4722d0e2bc321cf71b49b7573cf38640e9b28fc /tools/source | |
parent | f50bf3c5225b49b3c6f77f882e35305e5dc5ccd3 (diff) |
new loplugin:blockblock
Change-Id: I7b68b70fa4c7234e8882f7627026959a596968fd
Reviewed-on: https://gerrit.libreoffice.org/43025
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools/source')
-rw-r--r-- | tools/source/generic/poly.cxx | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index db15b735e664..bd012725e0f6 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -1559,25 +1559,23 @@ SvStream& ReadPolygon( SvStream& rIStream, tools::Polygon& rPoly ) else rPoly.mpImplPolygon->ImplSetSize( nPoints, false ); - { - // Determine whether we need to write through operators + // Determine whether we need to write through operators #if (SAL_TYPES_SIZEOFLONG) == 4 #ifdef OSL_BIGENDIAN - if ( rIStream.GetEndian() == SvStreamEndian::BIG ) + if ( rIStream.GetEndian() == SvStreamEndian::BIG ) #else - if ( rIStream.GetEndian() == SvStreamEndian::LITTLE ) + if ( rIStream.GetEndian() == SvStreamEndian::LITTLE ) #endif - rIStream.ReadBytes(rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point)); - else + rIStream.ReadBytes(rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point)); + else #endif + { + for( i = 0; i < nPoints; i++ ) { - for( i = 0; i < nPoints; i++ ) - { - sal_Int32 nTmpX(0), nTmpY(0); - rIStream.ReadInt32( nTmpX ).ReadInt32( nTmpY ); - rPoly.mpImplPolygon->mpPointAry[i].X() = nTmpX; - rPoly.mpImplPolygon->mpPointAry[i].Y() = nTmpY; - } + sal_Int32 nTmpX(0), nTmpY(0); + rIStream.ReadInt32( nTmpX ).ReadInt32( nTmpY ); + rPoly.mpImplPolygon->mpPointAry[i].X() = nTmpX; + rPoly.mpImplPolygon->mpPointAry[i].Y() = nTmpY; } } @@ -1592,26 +1590,24 @@ SvStream& WritePolygon( SvStream& rOStream, const tools::Polygon& rPoly ) // Write number of points rOStream.WriteUInt16( nPoints ); - { - // Determine whether we need to write through operators + // Determine whether we need to write through operators #if (SAL_TYPES_SIZEOFLONG) == 4 #ifdef OSL_BIGENDIAN - if ( rOStream.GetEndian() == SvStreamEndian::BIG ) + if ( rOStream.GetEndian() == SvStreamEndian::BIG ) #else - if ( rOStream.GetEndian() == SvStreamEndian::LITTLE ) + if ( rOStream.GetEndian() == SvStreamEndian::LITTLE ) #endif - { - if ( nPoints ) - rOStream.WriteBytes(rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point)); - } - else + { + if ( nPoints ) + rOStream.WriteBytes(rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point)); + } + else #endif + { + for( i = 0; i < nPoints; i++ ) { - for( i = 0; i < nPoints; i++ ) - { - rOStream.WriteInt32( rPoly.mpImplPolygon->mpPointAry[i].X() ) - .WriteInt32( rPoly.mpImplPolygon->mpPointAry[i].Y() ); - } + rOStream.WriteInt32( rPoly.mpImplPolygon->mpPointAry[i].X() ) + .WriteInt32( rPoly.mpImplPolygon->mpPointAry[i].Y() ); } } |