diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-19 16:21:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-20 12:54:55 +0100 |
commit | 7b8a0b7c0dcf8380a6bd2d458d0e20ffc6a5d355 (patch) | |
tree | 388b2fba4742064ed47c51f0a2688cb53de405ce /svtools/source/graphic | |
parent | b7da3f2d2518a8b92b0242e311bb31267acd1cd0 (diff) |
loplugin:changetoolsgen in svtools
Change-Id: I63271ee3126368868db7e7e859aaaa76b15e559e
Reviewed-on: https://gerrit.libreoffice.org/50023
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools/source/graphic')
-rw-r--r-- | svtools/source/graphic/grfmgr.cxx | 32 | ||||
-rw-r--r-- | svtools/source/graphic/grfmgr2.cxx | 20 | ||||
-rw-r--r-- | svtools/source/graphic/provider.cxx | 8 |
3 files changed, 30 insertions, 30 deletions
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 51f474d2b563..5e0c2e57a83b 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -274,16 +274,16 @@ bool GraphicObject::ImplGetCropParams( OutputDevice const * pOut, Point& rPt, Si const long nNewRight = nNewLeft + FRound( aSize100.Width() * fScale ) - 1; fScale = static_cast<double>(rSz.Width()) / aSize100.Width(); - rPt.X() += FRound( nNewLeft * fScale ); - rSz.Width() = FRound( ( nNewRight - nNewLeft + 1 ) * fScale ); + rPt.AdjustX(FRound( nNewLeft * fScale ) ); + rSz.setWidth( FRound( ( nNewRight - nNewLeft + 1 ) * fScale ) ); fScale = static_cast<double>(aSize100.Height()) / nTotalHeight; const long nNewTop = -FRound( ( ( pAttr->GetMirrorFlags() & BmpMirrorFlags::Vertical ) ? pAttr->GetBottomCrop() : pAttr->GetTopCrop() ) * fScale ); const long nNewBottom = nNewTop + FRound( aSize100.Height() * fScale ) - 1; fScale = static_cast<double>(rSz.Height()) / aSize100.Height(); - rPt.Y() += FRound( nNewTop * fScale ); - rSz.Height() = FRound( ( nNewBottom - nNewTop + 1 ) * fScale ); + rPt.AdjustY(FRound( nNewTop * fScale ) ); + rSz.setHeight( FRound( ( nNewBottom - nNewTop + 1 ) * fScale ) ); if( nRot10 ) { @@ -464,16 +464,16 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, // mirrored horizontically if( aSz.Width() < 0 ) { - aPt.X() += aSz.Width() + 1; - aSz.Width() = -aSz.Width(); + aPt.AdjustX(aSz.Width() + 1 ); + aSz.setWidth( -aSz.Width() ); aAttr.SetMirrorFlags( aAttr.GetMirrorFlags() ^ BmpMirrorFlags::Horizontal ); } // mirrored vertically if( aSz.Height() < 0 ) { - aPt.Y() += aSz.Height() + 1; - aSz.Height() = -aSz.Height(); + aPt.AdjustY(aSz.Height() + 1 ); + aSz.setHeight( -aSz.Height() ); aAttr.SetMirrorFlags( aAttr.GetMirrorFlags() ^ BmpMirrorFlags::Vertical ); } @@ -786,10 +786,10 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo const double fFactorX(static_cast<double>(aBitmapEx.GetSizePixel().Width()) / aSrcSizePixel.Width()); const double fFactorY(static_cast<double>(aBitmapEx.GetSizePixel().Height()) / aSrcSizePixel.Height()); - aCropLeftTop.Width() = basegfx::fround(aCropLeftTop.Width() * fFactorX); - aCropLeftTop.Height() = basegfx::fround(aCropLeftTop.Height() * fFactorY); - aCropRightBottom.Width() = basegfx::fround(aCropRightBottom.Width() * fFactorX); - aCropRightBottom.Height() = basegfx::fround(aCropRightBottom.Height() * fFactorY); + aCropLeftTop.setWidth( basegfx::fround(aCropLeftTop.Width() * fFactorX) ); + aCropLeftTop.setHeight( basegfx::fround(aCropLeftTop.Height() * fFactorY) ); + aCropRightBottom.setWidth( basegfx::fround(aCropRightBottom.Width() * fFactorX) ); + aCropRightBottom.setHeight( basegfx::fround(aCropRightBottom.Height() * fFactorY) ); aSrcSizePixel = aBitmapEx.GetSizePixel(); } @@ -834,10 +834,10 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo aCropRightBottom.Height() < 0 ) { Size aNewSize( aAnim.GetDisplaySizePixel() ); - aNewSize.Width() += aCropRightBottom.Width() < 0 ? -aCropRightBottom.Width() : 0; - aNewSize.Width() += aCropLeftTop.Width() < 0 ? -aCropLeftTop.Width() : 0; - aNewSize.Height() += aCropRightBottom.Height() < 0 ? -aCropRightBottom.Height() : 0; - aNewSize.Height() += aCropLeftTop.Height() < 0 ? -aCropLeftTop.Height() : 0; + aNewSize.AdjustWidth(aCropRightBottom.Width() < 0 ? -aCropRightBottom.Width() : 0 ); + aNewSize.AdjustWidth(aCropLeftTop.Width() < 0 ? -aCropLeftTop.Width() : 0 ); + aNewSize.AdjustHeight(aCropRightBottom.Height() < 0 ? -aCropRightBottom.Height() : 0 ); + aNewSize.AdjustHeight(aCropLeftTop.Height() < 0 ? -aCropLeftTop.Height() : 0 ); aAnim.SetDisplaySizePixel( aNewSize ); } diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 584c31daa07f..bc3dab23f454 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -1733,7 +1733,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent if (!pTileGraphic->Draw(&rVDev, aCurrPos, aTileInfo.aTileSizePixel, pAttr, nFlags)) return false; - aCurrPos.X() += aTileInfo.aTileSizePixel.Width(); + aCurrPos.AdjustX(aTileInfo.aTileSizePixel.Width() ); } #ifdef DBG_TEST @@ -1747,14 +1747,14 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent // now fill one column from aTileInfo.aNextTileTopLeft.Y() all // the way to the bottom - aCurrPos.X() = aTileInfo.aTileTopLeft.X(); - aCurrPos.Y() = aTileInfo.aNextTileTopLeft.Y(); + aCurrPos.setX( aTileInfo.aTileTopLeft.X() ); + aCurrPos.setY( aTileInfo.aNextTileTopLeft.Y() ); for (int nY=0; nY < aTileInfo.nTilesEmptyY; nY += nMSBFactor) { if (!pTileGraphic->Draw(&rVDev, aCurrPos, aTileInfo.aTileSizePixel, pAttr, nFlags)) return false; - aCurrPos.Y() += aTileInfo.aTileSizePixel.Height(); + aCurrPos.AdjustY(aTileInfo.aTileSizePixel.Height() ); } #ifdef DBG_TEST @@ -1805,7 +1805,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent // we don't draw beyond the right or bottom border. for (int nY=0; nY < aTileInfo.nTilesEmptyY && nY < nExponent*nMSBFactor; nY += nMSBFactor) { - aCurrPos.X() = aTileInfo.aNextTileTopLeft.X(); + aCurrPos.setX( aTileInfo.aNextTileTopLeft.X() ); for (int nX=0; nX < aTileInfo.nTilesEmptyX && nX < nExponent*nMSBFactor; nX += nMSBFactor) { @@ -1814,10 +1814,10 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent else if (!pTileGraphic->Draw(&rVDev, aCurrPos, aTileInfo.aTileSizePixel, pAttr, nFlags)) return false; - aCurrPos.X() += aTileInfo.aTileSizePixel.Width(); + aCurrPos.AdjustX(aTileInfo.aTileSizePixel.Width() ); } - aCurrPos.Y() += aTileInfo.aTileSizePixel.Height(); + aCurrPos.AdjustY(aTileInfo.aTileSizePixel.Height() ); } #ifdef DBG_TEST @@ -1959,7 +1959,7 @@ bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel, for( nY=0; nY < nNumTilesY; ++nY ) { - aCurrPos.X() = rPosPixel.X(); + aCurrPos.setX( rPosPixel.X() ); for( nX=0; nX < nNumTilesX; ++nX ) { @@ -1974,10 +1974,10 @@ bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel, bDrawInPixel ? rTileSizePixel : aTileSizeLogic, pAttr, nFlags ); - aCurrPos.X() += rTileSizePixel.Width(); + aCurrPos.AdjustX(rTileSizePixel.Width() ); } - aCurrPos.Y() += rTileSizePixel.Height(); + aCurrPos.AdjustY(rTileSizePixel.Height() ); } if( bDrawInPixel ) diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index 0c4a481021dd..f0dddfc5610c 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -514,10 +514,10 @@ void ImplCalculateCropRect( ::Graphic const & rGraphic, const text::GraphicCrop& { double fSourceSizePixelWidth = static_cast<double>(aSourceSizePixel.Width()); double fSourceSizePixelHeight= static_cast<double>(aSourceSizePixel.Height()); - rGraphicCropPixel.Left() = static_cast< sal_Int32 >((fSourceSizePixelWidth * rGraphicCropLogic.Left ) / aSize100thMM.Width()); - rGraphicCropPixel.Top() = static_cast< sal_Int32 >((fSourceSizePixelHeight * rGraphicCropLogic.Top ) / aSize100thMM.Height()); - rGraphicCropPixel.Right() = static_cast< sal_Int32 >(( fSourceSizePixelWidth * ( aSize100thMM.Width() - rGraphicCropLogic.Right ) ) / aSize100thMM.Width() ); - rGraphicCropPixel.Bottom() = static_cast< sal_Int32 >(( fSourceSizePixelHeight * ( aSize100thMM.Height() - rGraphicCropLogic.Bottom ) ) / aSize100thMM.Height() ); + rGraphicCropPixel.SetLeft( static_cast< sal_Int32 >((fSourceSizePixelWidth * rGraphicCropLogic.Left ) / aSize100thMM.Width()) ); + rGraphicCropPixel.SetTop( static_cast< sal_Int32 >((fSourceSizePixelHeight * rGraphicCropLogic.Top ) / aSize100thMM.Height()) ); + rGraphicCropPixel.SetRight( static_cast< sal_Int32 >(( fSourceSizePixelWidth * ( aSize100thMM.Width() - rGraphicCropLogic.Right ) ) / aSize100thMM.Width() ) ); + rGraphicCropPixel.SetBottom( static_cast< sal_Int32 >(( fSourceSizePixelHeight * ( aSize100thMM.Height() - rGraphicCropLogic.Bottom ) ) / aSize100thMM.Height() ) ); } } |