From 270e41adb0c7a5f3e25e0ea25933de0d5c32ef9c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 3 Nov 2018 16:31:41 +0200 Subject: loplugin:buriedassign in sd..writerfilter Change-Id: I954c12d9e1c493be6ac8c7b15076077b5bff5b74 Reviewed-on: https://gerrit.libreoffice.org/62811 Tested-by: Jenkins Reviewed-by: Noel Grandin --- tools/source/generic/poly.cxx | 14 ++++++++------ tools/source/stream/vcompat.cxx | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'tools') diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 4f4bdf5dffe8..4217531800b5 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -149,16 +149,16 @@ ImplPolygon::ImplPolygon( const tools::Rectangle& rRect, sal_uInt32 nHorzRound, Point* pDstAry = mxPointAry.get(); for( i = 0, nEnd = nSize4; i < nEnd; i++ ) - ( pDstAry[ i ] = pSrcAry[ i ] ) += aTR; + pDstAry[ i ] = pSrcAry[ i ] + aTR; for( nEnd = nEnd + nSize4; i < nEnd; i++ ) - ( pDstAry[ i ] = pSrcAry[ i ] ) += aTL; + pDstAry[ i ] = pSrcAry[ i ] + aTL; for( nEnd = nEnd + nSize4; i < nEnd; i++ ) - ( pDstAry[ i ] = pSrcAry[ i ] ) += aBL; + pDstAry[ i ] = pSrcAry[ i ] + aBL; for( nEnd = nEnd + nSize4; i < nEnd; i++ ) - ( pDstAry[ i ] = pSrcAry[ i ] ) += aBR; + pDstAry[ i ] = pSrcAry[ i ] + aBR; pDstAry[ nEnd ] = pDstAry[ 0 ]; } @@ -1054,7 +1054,8 @@ void Polygon::Optimize( PolyOptimizeFlags nOptimizeFlags ) if( ( mpImplPolygon->mxPointAry[ i ] != mpImplPolygon->mxPointAry[ nLast ] ) && ( !nReduce || ( nReduce < FRound( CalcDistance( nLast, i ) ) ) ) ) { - aNewPoly[ nNewCount++ ] = mpImplPolygon->mxPointAry[ nLast = i ]; + nLast = i; + aNewPoly[ nNewCount++ ] = mpImplPolygon->mxPointAry[ i ]; } } @@ -1292,7 +1293,8 @@ void Polygon::ImplReduceEdges( tools::Polygon& rPoly, const double& rArea, sal_u else { Vector2D aVecB( rPoly[ nIndNext ] ); - double fDistB = ( aVecB -= Vector2D(rPoly[ nIndPrev ] )).GetLength(); + aVecB -= Vector2D(rPoly[ nIndPrev ] ); + double fDistB = aVecB.GetLength(); double fLenWithB = fDist2 + fDist3; double fLenFact = ( fDistB != 0.0 ) ? fLenWithB / fDistB : 1.0; double fTurnPrev = aVec1.Normalize().Scalar( aVec2 ); diff --git a/tools/source/stream/vcompat.cxx b/tools/source/stream/vcompat.cxx index 7e03ef43a0c8..d77f866e06af 100644 --- a/tools/source/stream/vcompat.cxx +++ b/tools/source/stream/vcompat.cxx @@ -32,7 +32,8 @@ VersionCompat::VersionCompat( SvStream& rStm, StreamMode nStreamMode, sal_uInt16 if( StreamMode::WRITE == mnStmMode ) { mpRWStm->WriteUInt16( mnVersion ); - mnTotalSize = ( mnCompatPos = mpRWStm->Tell() ) + 4; + mnCompatPos = mpRWStm->Tell(); + mnTotalSize = mnCompatPos + 4; mpRWStm->SeekRel( 4 ); } else -- cgit v1.2.3