summaryrefslogtreecommitdiff
path: root/vcl/source/bitmap
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2024-03-17 22:46:07 +0900
committerTomaž Vajngerl <quikee@gmail.com>2024-03-22 01:48:12 +0100
commit71efd6046488b952f679936ea1c4a415f4989b18 (patch)
treeeac057d1046d80974e87c3f0cf6bd21932d71bfc /vcl/source/bitmap
parent397d87b9786bebd1ab76f18b472c731bd9ed7884 (diff)
vcl: remove SetSizePixel from BitmapEx
Makes no sense (and would case serious problems) to set the size (pixel) from the outside of the BitmapEx. Change-Id: Iab597f755d45be2380884ec6685d119fcc8b1e98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164946 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/source/bitmap')
-rw-r--r--vcl/source/bitmap/BitmapEx.cxx17
1 files changed, 6 insertions, 11 deletions
diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx
index 4246861679e4..87c500272160 100644
--- a/vcl/source/bitmap/BitmapEx.cxx
+++ b/vcl/source/bitmap/BitmapEx.cxx
@@ -63,7 +63,7 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize )
return;
maBitmap = Bitmap(aSize, rBitmapEx.maBitmap.getPixelFormat());
- SetSizePixel(aSize);
+ maBitmapSize = aSize;
if( rBitmapEx.IsAlpha() )
maAlphaMask = AlphaMask( aSize );
@@ -75,7 +75,7 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize )
BitmapEx::BitmapEx(Size aSize, vcl::PixelFormat ePixelFormat)
{
maBitmap = Bitmap(aSize, ePixelFormat);
- SetSizePixel(aSize);
+ maBitmapSize = aSize;
}
BitmapEx::BitmapEx( const OUString& rIconName )
@@ -251,11 +251,6 @@ BitmapChecksum BitmapEx::GetChecksum() const
return nCrc;
}
-void BitmapEx::SetSizePixel(const Size& rNewSize)
-{
- maBitmapSize = rNewSize;
-}
-
bool BitmapEx::Invert()
{
bool bRet = false;
@@ -294,7 +289,7 @@ bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag
maAlphaMask.Scale( rScaleX, rScaleY, nScaleFlag );
}
- SetSizePixel(maBitmap.GetSizePixel());
+ maBitmapSize = maBitmap.GetSizePixel();
SAL_WARN_IF( !maAlphaMask.IsEmpty() && maBitmap.GetSizePixel() != maAlphaMask.GetSizePixel(), "vcl",
"BitmapEx::Scale(): size mismatch for bitmap and alpha mask." );
@@ -352,7 +347,7 @@ bool BitmapEx::Rotate( Degree10 nAngle10, const Color& rFillColor )
maAlphaMask.Rotate( nAngle10, COL_ALPHA_TRANSPARENT );
}
- SetSizePixel(maBitmap.GetSizePixel());
+ maBitmapSize = maBitmap.GetSizePixel();
SAL_WARN_IF(!maAlphaMask.IsEmpty() && maBitmap.GetSizePixel() != maAlphaMask.GetSizePixel(), "vcl",
"BitmapEx::Rotate(): size mismatch for bitmap and alpha mask.");
@@ -372,7 +367,7 @@ bool BitmapEx::Crop( const tools::Rectangle& rRectPixel )
if( bRet && !maAlphaMask.IsEmpty() )
maAlphaMask.Crop( rRectPixel );
- SetSizePixel(maBitmap.GetSizePixel());
+ maBitmapSize = maBitmap.GetSizePixel();
SAL_WARN_IF(!maAlphaMask.IsEmpty() && maBitmap.GetSizePixel() != maAlphaMask.GetSizePixel(), "vcl",
"BitmapEx::Crop(): size mismatch for bitmap and alpha mask.");
@@ -401,7 +396,7 @@ void BitmapEx::Expand( sal_Int32 nDX, sal_Int32 nDY, bool bExpandTransparent )
maAlphaMask.Expand( nDX, nDY, &aColor );
}
- SetSizePixel(maBitmap.GetSizePixel());
+ maBitmapSize = maBitmap.GetSizePixel();
SAL_WARN_IF(!maAlphaMask.IsEmpty() && maBitmap.GetSizePixel() != maAlphaMask.GetSizePixel(), "vcl",
"BitmapEx::Expand(): size mismatch for bitmap and alpha mask.");