Kaydet (Commit) 9a378c7a authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in BackgroundPreviewImpl

Change-Id: If7a36baa663d052a9a41c126312abff185a14bdc
Reviewed-on: https://gerrit.libreoffice.org/56321
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 641cb17f
......@@ -161,7 +161,7 @@ private:
void recalcDrawPos();
bool bIsBmp;
Bitmap* pBitmap;
std::unique_ptr<Bitmap> pBitmap;
Point aDrawPos;
Size aDrawSize;
::tools::Rectangle aDrawRect;
......@@ -195,8 +195,7 @@ BackgroundPreviewImpl::~BackgroundPreviewImpl()
void BackgroundPreviewImpl::dispose()
{
delete pBitmap;
pBitmap = nullptr;
pBitmap.reset();
vcl::Window::dispose();
}
......@@ -218,9 +217,9 @@ void BackgroundPreviewImpl::NotifyChange( const Bitmap* pNewBitmap )
if (pNewBitmap && pBitmap)
*pBitmap = *pNewBitmap;
else if (pNewBitmap && !pBitmap)
pBitmap = new Bitmap(*pNewBitmap);
pBitmap.reset( new Bitmap(*pNewBitmap) );
else if (!pNewBitmap)
DELETEZ(pBitmap);
pBitmap.reset();
recalcDrawPos();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment