summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-06-13 11:25:05 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-06-13 11:25:05 +0200
commit5df3b28a24825653ca112dd3e709aad3e4f4630a (patch)
tree4817033369a9e8bee815f8070616463fa2da7856
parenta109a9ef744a7ed36c5084cb26f033ba52b3c3ad (diff)
Use unique_ptr for Svx3DWin::mpRemember2DAttributes
Change-Id: I55120a885d74bbd3710a4e02be939a8e4e6a9ba2
-rw-r--r--include/svx/float3d.hxx2
-rw-r--r--svx/source/engine3d/float3d.cxx10
2 files changed, 6 insertions, 6 deletions
diff --git a/include/svx/float3d.hxx b/include/svx/float3d.hxx
index 10bcfe0cf882..31892bc8ef85 100644
--- a/include/svx/float3d.hxx
+++ b/include/svx/float3d.hxx
@@ -183,7 +183,7 @@ private:
FieldUnit eFUnit;
// ItemSet used to remember set 2d attributes
- SfxItemSet* mpRemember2DAttributes;
+ std::unique_ptr<SfxItemSet> mpRemember2DAttributes;
DECL_LINK( ClickViewTypeHdl, Button*, void );
DECL_LINK( ClickUpdateHdl, Button*, void );
diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx
index 41a97fd226bf..f55dd445ec40 100644
--- a/svx/source/engine3d/float3d.cxx
+++ b/svx/source/engine3d/float3d.cxx
@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <o3tl/make_unique.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/module.hxx>
#include <sfx2/viewfrm.hxx>
@@ -335,8 +338,6 @@ void Svx3DWin::dispose()
DELETEZ( pConvertTo3DItem );
DELETEZ( pConvertTo3DLatheItem );
- delete mpRemember2DAttributes;
-
mpImpl.reset();
m_pBtnGeo.clear();
@@ -466,7 +467,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
if(mpRemember2DAttributes)
mpRemember2DAttributes->ClearItem();
else
- mpRemember2DAttributes = new SfxItemSet(*rAttrs.GetPool(),
+ mpRemember2DAttributes = o3tl::make_unique<SfxItemSet>(*rAttrs.GetPool(),
SDRATTR_START, SDRATTR_SHADOW_LAST,
SDRATTR_3D_FIRST, SDRATTR_3D_LAST,
0, 0);
@@ -2804,8 +2805,7 @@ void Svx3DWin::UpdatePreview()
// document is to be reloaded, destroy remembered ItemSet
void Svx3DWin::DocumentReload()
{
- delete mpRemember2DAttributes;
- mpRemember2DAttributes = nullptr;
+ mpRemember2DAttributes.reset();
}
void Svx3DWin::InitColorLB()