summaryrefslogtreecommitdiff
path: root/vcl/source/window/splitwin.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-12 08:33:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-15 07:29:22 +0100
commit2849b82894f4325021162605fb911bcb27fb8fca (patch)
tree2e86fbcb6df7d51a57f3fa878672c3fd563d5861 /vcl/source/window/splitwin.cxx
parent397d5cbc3c04da7693e2e1f3e99b0d8e431bfff2 (diff)
loplugin:useuniqueptr in ImplSplitSet
Change-Id: Ibade5376c545fe5281ac171385bbb2aa02627512 Reviewed-on: https://gerrit.libreoffice.org/47837 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/window/splitwin.cxx')
-rw-r--r--vcl/source/window/splitwin.cxx19
1 files changed, 6 insertions, 13 deletions
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 23b11f52ffe4..5e8c26c094eb 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -85,8 +85,8 @@ public:
~ImplSplitSet();
std::vector< ImplSplitItem > mvItems;
- Wallpaper* mpWallpaper;
- Bitmap* mpBitmap;
+ std::unique_ptr<Wallpaper> mpWallpaper;
+ std::unique_ptr<Bitmap> mpBitmap;
long mnLastSize;
long mnSplitSize;
sal_uInt16 mnId;
@@ -128,15 +128,8 @@ ImplSplitSet::ImplSplitSet() :
ImplSplitSet::~ImplSplitSet()
{
- if ( mpWallpaper ) {
- delete mpWallpaper;
- mpWallpaper = nullptr;
- }
-
- if ( mpBitmap ) {
- delete mpBitmap;
- mpBitmap = nullptr;
- }
+ mpWallpaper.reset();
+ mpBitmap.reset();
}
/** Check whether the given size is inside the valid range defined by
@@ -944,7 +937,7 @@ void SplitWindow::ImplDrawBack(vcl::RenderContext& rRenderContext, ImplSplitSet*
mnDX - mnRightBorder - 1,
mnDY - mnBottomBorder - 1);
- ImplDrawBack(rRenderContext, aRect, pSet->mpWallpaper, pSet->mpBitmap);
+ ImplDrawBack(rRenderContext, aRect, pSet->mpWallpaper.get(), pSet->mpBitmap.get());
}
}
@@ -958,7 +951,7 @@ void SplitWindow::ImplDrawBack(vcl::RenderContext& rRenderContext, ImplSplitSet*
Point aPoint(rItems[i].mnLeft, rItems[i].mnTop);
Size aSize(rItems[i].mnWidth, rItems[i].mnHeight);
tools::Rectangle aRect(aPoint, aSize);
- ImplDrawBack(rRenderContext, aRect, pSet->mpWallpaper, pSet->mpBitmap);
+ ImplDrawBack(rRenderContext, aRect, pSet->mpWallpaper.get(), pSet->mpBitmap.get());
}
}
}