diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2018-04-05 16:02:17 +1000 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-04-05 11:03:49 +0200 |
commit | 4eaa447630756f64bceba81e1a787c289c120152 (patch) | |
tree | af31eaf5940c2f5188b7ef82550959e23b9c23a1 | |
parent | 4e9dbb4c81dfd99cfec4a36372b09a96ad4d4133 (diff) |
vcl: ImplAssignWithSize() -> ReassignWithSize()
Change-Id: I278a976028762f5c101dfd46ee62c4aa06bd719d
Reviewed-on: https://gerrit.libreoffice.org/52422
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r-- | include/vcl/bitmap.hxx | 8 | ||||
-rw-r--r-- | vcl/source/bitmap/bitmap.cxx | 24 | ||||
-rw-r--r-- | vcl/source/bitmap/bitmappaint.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap3.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap4.cxx | 8 |
5 files changed, 27 insertions, 19 deletions
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 69108febbe4e..5740fc38eb63 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -662,11 +662,17 @@ public: const BmpFilterParam* pFilterParam = nullptr ); public: + /** ReassignWithSize and recalculate bitmap. + + ReassignWithSizes the bitmap, and recalculates the bitmap size based on the new bitmap. + + @param rBitmap Bitmap to reassign and use for size calculation + */ + SAL_DLLPRIVATE void ReassignWithSize(const Bitmap& rBitmap); SAL_DLLPRIVATE void ImplMakeUnique(); const std::shared_ptr<ImpBitmap>& ImplGetImpBitmap() const { return mxImpBmp; } SAL_DLLPRIVATE void ImplSetImpBitmap( const std::shared_ptr<ImpBitmap>& xImpBmp ); - SAL_DLLPRIVATE void ImplAssignWithSize( const Bitmap& rBitmap ); SAL_DLLPRIVATE bool ImplScaleFast( const double& rScaleX, const double& rScaleY ); SAL_DLLPRIVATE bool ImplScaleInterpolate( const double& rScaleX, const double& rScaleY ); diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx index bf13e87fe68c..86868f70826a 100644 --- a/vcl/source/bitmap/bitmap.cxx +++ b/vcl/source/bitmap/bitmap.cxx @@ -302,20 +302,22 @@ void Bitmap::ImplMakeUnique() } } -void Bitmap::ImplAssignWithSize( const Bitmap& rBitmap ) +void Bitmap::ReassignWithSize(const Bitmap& rBitmap) { - const Size aOldSizePix( GetSizePixel() ); - const Size aNewSizePix( rBitmap.GetSizePixel() ); - const MapMode aOldMapMode( maPrefMapMode ); - Size aNewPrefSize; + const Size aOldSizePix(GetSizePixel()); + const Size aNewSizePix(rBitmap.GetSizePixel()); + const MapMode aOldMapMode(maPrefMapMode); + Size aNewPrefSize; - if( ( aOldSizePix != aNewSizePix ) && aOldSizePix.Width() && aOldSizePix.Height() ) + if ((aOldSizePix != aNewSizePix) && aOldSizePix.Width() && aOldSizePix.Height()) { - aNewPrefSize.setWidth( FRound( maPrefSize.Width() * aNewSizePix.Width() / aOldSizePix.Width() ) ); - aNewPrefSize.setHeight( FRound( maPrefSize.Height() * aNewSizePix.Height() / aOldSizePix.Height() ) ); + aNewPrefSize.setWidth(FRound(maPrefSize.Width() * aNewSizePix.Width() / aOldSizePix.Width())); + aNewPrefSize.setHeight(FRound(maPrefSize.Height() * aNewSizePix.Height() / aOldSizePix.Height())); } else + { aNewPrefSize = maPrefSize; + } *this = rBitmap; @@ -413,7 +415,7 @@ bool Bitmap::Crop( const tools::Rectangle& rRectPixel ) pReadAcc.reset(); if( bRet ) - ImplAssignWithSize( aNewBmp ); + ReassignWithSize( aNewBmp ); } } @@ -810,8 +812,8 @@ bool Bitmap::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor ) pReadAcc.reset(); - if( bRet ) - ImplAssignWithSize( aNewBmp ); + if (bRet) + ReassignWithSize(aNewBmp); } } diff --git a/vcl/source/bitmap/bitmappaint.cxx b/vcl/source/bitmap/bitmappaint.cxx index 942d627b588c..877ec5c195f5 100644 --- a/vcl/source/bitmap/bitmappaint.cxx +++ b/vcl/source/bitmap/bitmappaint.cxx @@ -403,7 +403,7 @@ bool Bitmap::Rotate(long nAngle10, const Color& rFillColor) bRet = !!aRotatedBmp; if (bRet) - ImplAssignWithSize(aRotatedBmp); + ReassignWithSize(aRotatedBmp); } return bRet; diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index ba28fff0f112..24deaffc640b 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -944,8 +944,8 @@ bool Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY ) } pReadAcc.reset(); - if( bRet ) - ImplAssignWithSize( aNewBmp ); + if (bRet) + ReassignWithSize(aNewBmp); } } diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx index 62d0dc418350..b63f5c480fe5 100644 --- a/vcl/source/gdi/bitmap4.cxx +++ b/vcl/source/gdi/bitmap4.cxx @@ -1176,7 +1176,7 @@ bool Bitmap::ImplSeparableBlurFilter(const double radius) } // Swap current bitmap with new bitmap - ImplAssignWithSize( aNewBitmap ); + ReassignWithSize(aNewBitmap); // Do vertical filtering ImplBlurContributions(nHeight, aNumberOfContributions, pBlurVector, pWeights, pPixels, pCount ); @@ -1196,7 +1196,7 @@ bool Bitmap::ImplSeparableBlurFilter(const double radius) return bResult; // Swap current bitmap with new bitmap - ImplAssignWithSize( aNewBitmap ); + ReassignWithSize(aNewBitmap); return true; } @@ -1242,7 +1242,7 @@ bool Bitmap::ImplSeparableUnsharpenFilter(const double radius) { pWriteAcc.reset(); pReadAcc.reset(); pReadAccBlur.reset(); - ImplAssignWithSize ( aResultBitmap ); + ReassignWithSize(aResultBitmap); return true; } @@ -1273,7 +1273,7 @@ bool Bitmap::ImplDuotoneFilter( const sal_uLong nColorOne, const sal_uLong nColo pWriteAcc.reset(); pReadAcc.reset(); - ImplAssignWithSize ( aResultBitmap ); + ReassignWithSize(aResultBitmap); return true; } |