diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-27 15:21:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-27 20:02:00 +0200 |
commit | fd7787b6f0f082db320ebe7b29fc5333587b5d2e (patch) | |
tree | 39d639228b8b0fcd215cbf91e18251aea45041d4 /vcl/source/gdi | |
parent | 832f04d1f78e54bb84c641c11cf90aa2f953fc17 (diff) |
no need to allocate these on the heap
Change-Id: I0740f7194c589d6949a816f365cd54403be72118
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116260
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r-- | vcl/source/gdi/impanmvw.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx index b7329c073ef1..5757d3d36e5c 100644 --- a/vcl/source/gdi/impanmvw.cxx +++ b/vcl/source/gdi/impanmvw.cxx @@ -151,7 +151,9 @@ void ImplAnimView::drawToPos( sal_uLong nPos ) } ScopedVclPtrInstance<VirtualDevice> aVDev; - std::unique_ptr<vcl::Region> xOldClip(!maClip.IsNull() ? new vcl::Region( pRenderContext->GetClipRegion() ) : nullptr); + std::optional<vcl::Region> xOldClip; + if (!maClip.IsNull()) + xOldClip = pRenderContext->GetClipRegion(); aVDev->SetOutputSizePixel( maSzPix, false ); nPos = std::min( nPos, static_cast<sal_uLong>(mpParent->Count()) - 1 ); @@ -270,7 +272,9 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev ) if( !pVDev ) { - std::unique_ptr<vcl::Region> xOldClip(!maClip.IsNull() ? new vcl::Region( pRenderContext->GetClipRegion() ) : nullptr); + std::optional<vcl::Region> xOldClip; + if (!maClip.IsNull()) + xOldClip = pRenderContext->GetClipRegion(); if (xOldClip) pRenderContext->SetClipRegion( maClip ); |