summaryrefslogtreecommitdiff
path: root/vcl/source/bitmap/BitmapTools.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-05-08 10:48:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-05-08 13:06:21 +0200
commit772ce2e0a98a7acc2b80bdf1143782849151e77b (patch)
treee10de9c7cd76bc82f33be38df26c6ab54ae10d22 /vcl/source/bitmap/BitmapTools.cxx
parentc5c83c8e6c4ddbb7f1fa88b9ab0a67ccbb2627c3 (diff)
unique_ptr->optional for Bitmap
since Bitmap is really just a tiny wrapper around SalBmp Change-Id: Ie2c9be40f6abba72c600c6778ec42d0689c66558 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151498 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/bitmap/BitmapTools.cxx')
-rw-r--r--vcl/source/bitmap/BitmapTools.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx
index 164a5606debb..beec528b2f0e 100644
--- a/vcl/source/bitmap/BitmapTools.cxx
+++ b/vcl/source/bitmap/BitmapTools.cxx
@@ -160,11 +160,11 @@ BitmapEx CreateFromData(sal_uInt8 const *pData, sal_Int32 nWidth, sal_Int32 nHei
assert(pWrite.get());
if( !pWrite )
return BitmapEx();
- std::unique_ptr<AlphaMask> pAlphaMask;
+ std::optional<AlphaMask> pAlphaMask;
AlphaScopedWriteAccess xMaskAcc;
if (nBitCount == 32)
{
- pAlphaMask.reset( new AlphaMask( Size(nWidth, nHeight) ) );
+ pAlphaMask.emplace( Size(nWidth, nHeight) );
xMaskAcc = AlphaScopedWriteAccess(*pAlphaMask);
}
if (nBitCount == 1)
@@ -244,11 +244,11 @@ BitmapEx CreateFromData( RawBitmap&& rawBitmap )
assert(pWrite.get());
if( !pWrite )
return BitmapEx();
- std::unique_ptr<AlphaMask> pAlphaMask;
+ std::optional<AlphaMask> pAlphaMask;
AlphaScopedWriteAccess xMaskAcc;
if (nBitCount == 32)
{
- pAlphaMask.reset( new AlphaMask( rawBitmap.maSize ) );
+ pAlphaMask.emplace( rawBitmap.maSize );
xMaskAcc = AlphaScopedWriteAccess(*pAlphaMask);
}