Kaydet (Commit) 2bba6d49 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SdrPaintWindow

Change-Id: Ia5a57913b607c0c055a525094ac03c5c3022abb4
Reviewed-on: https://gerrit.libreoffice.org/53713Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst a1ce78b0
......@@ -23,6 +23,7 @@
#include <rtl/ref.hxx>
#include <vcl/virdev.hxx>
#include <svx/svxdllapi.h>
#include <memory>
class SdrPaintView;
......@@ -78,7 +79,7 @@ private:
rtl::Reference< sdr::overlay::OverlayManager > mxOverlayManager;
// The PreRenderDevice for PreRendering
SdrPreRenderDevice* mpPreRenderDevice;
std::unique_ptr<SdrPreRenderDevice> mpPreRenderDevice;
// The RedrawRegion used for rendering
vcl::Region maRedrawRegion;
......@@ -123,7 +124,7 @@ public:
void PreparePreRenderDevice();
void DestroyPreRenderDevice();
void OutputPreRenderDevice(const vcl::Region& rExpandedRegion);
SdrPreRenderDevice* GetPreRenderDevice() const { return mpPreRenderDevice; }
SdrPreRenderDevice* GetPreRenderDevice() const { return mpPreRenderDevice.get(); }
// RedrawRegion
const vcl::Region& GetRedrawRegion() const { return maRedrawRegion;}
......
......@@ -292,7 +292,7 @@ void SdrPaintWindow::PreparePreRenderDevice()
{
if(!mpPreRenderDevice)
{
mpPreRenderDevice = new SdrPreRenderDevice(*mpOutputDevice.get());
mpPreRenderDevice.reset(new SdrPreRenderDevice(*mpOutputDevice));
}
}
else
......@@ -308,11 +308,7 @@ void SdrPaintWindow::PreparePreRenderDevice()
void SdrPaintWindow::DestroyPreRenderDevice()
{
if(mpPreRenderDevice)
{
delete mpPreRenderDevice;
mpPreRenderDevice = nullptr;
}
mpPreRenderDevice.reset();
}
void SdrPaintWindow::OutputPreRenderDevice(const vcl::Region& rExpandedRegion)
......
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