diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-12 16:08:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-12 19:00:00 +0200 |
commit | 203e3099c17bf245f8fcd52c32c58d47bd241c2b (patch) | |
tree | 805b01deb02d3bc88582fb4812b4d94c94e65d03 /include | |
parent | f4932d61e52d595156af1f63e9fb4bed18b63254 (diff) |
make Bitmap/BitmapEx constructors explicit
and add
BitmapEx::operator=(Bitmap const &)
Image::Image(Bitmap const &)
to lessen the fallout
Change-Id: Iff5fab88d167a7be739c370c9933d36c297bc61c
Reviewed-on: https://gerrit.libreoffice.org/54162
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/bitmap.hxx | 2 | ||||
-rw-r--r-- | include/vcl/bitmapex.hxx | 5 | ||||
-rw-r--r-- | include/vcl/image.hxx | 1 |
3 files changed, 5 insertions, 3 deletions
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 9dfca1de0af1..6ba6dd43378c 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -124,7 +124,7 @@ public: Bitmap(); Bitmap( const Bitmap& rBitmap ); Bitmap( const Size& rSizePixel, sal_uInt16 nBitCount, const BitmapPalette* pPal = nullptr ); - Bitmap( SalBitmap* pSalBitmap ); + explicit Bitmap( SalBitmap* pSalBitmap ); virtual ~Bitmap(); Bitmap& operator=( const Bitmap& rBitmap ); diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx index f52a8dba5fb0..b62c3cb5a2fa 100644 --- a/include/vcl/bitmapex.hxx +++ b/include/vcl/bitmapex.hxx @@ -45,15 +45,16 @@ class SAL_WARN_UNUSED VCL_DLLPUBLIC BitmapEx public: BitmapEx(); - BitmapEx( const OUString& rIconName ); + explicit BitmapEx( const OUString& rIconName ); BitmapEx( const BitmapEx& rBitmapEx ); BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ); - BitmapEx( const Bitmap& rBmp ); + explicit BitmapEx( const Bitmap& rBmp ); BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ); BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ); BitmapEx( const Bitmap& rBmp, const Color& rTransparentColor ); BitmapEx& operator=( const BitmapEx& rBitmapEx ); + BitmapEx& operator=( const Bitmap& rBitmap ) { return operator=(BitmapEx(rBitmap)); } bool operator==( const BitmapEx& rBitmapEx ) const; bool operator!=( const BitmapEx& rBitmapEx ) const { return !(*this==rBitmapEx); } bool operator!() const { return !maBitmap; } diff --git a/include/vcl/image.hxx b/include/vcl/image.hxx index 526243bcf382..6f324c25b852 100644 --- a/include/vcl/image.hxx +++ b/include/vcl/image.hxx @@ -56,6 +56,7 @@ class SAL_WARN_UNUSED VCL_DLLPUBLIC Image public: Image(); explicit Image( const BitmapEx& rBitmapEx ); + explicit Image( const Bitmap& rBitmap ) : Image( BitmapEx(rBitmap) ) {} explicit Image( const css::uno::Reference< css::graphic::XGraphic >& rxGraphic ); explicit Image( const OUString &rPNGFileUrl ); |