[Libreoffice-commits] core.git: include/svx svx/source
Noel Grandin
noel.grandin at collabora.co.uk
Wed May 2 06:28:29 UTC 2018
include/svx/sdrpaintwindow.hxx | 5 +++--
svx/source/svdraw/sdrpaintwindow.cxx | 8 ++------
2 files changed, 5 insertions(+), 8 deletions(-)
New commits:
commit 2bba6d49fefd2f58b1771baee5786e1c49883b5c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue May 1 19:22:34 2018 +0200
loplugin:useuniqueptr in SdrPaintWindow
Change-Id: Ia5a57913b607c0c055a525094ac03c5c3022abb4
Reviewed-on: https://gerrit.libreoffice.org/53713
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/svx/sdrpaintwindow.hxx b/include/svx/sdrpaintwindow.hxx
index f36f5c8089a4..92d928da71d2 100644
--- a/include/svx/sdrpaintwindow.hxx
+++ b/include/svx/sdrpaintwindow.hxx
@@ -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;}
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx
index 1a2c6b3d3dab..e357dd089bb7 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -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)
More information about the Libreoffice-commits
mailing list