[Libreoffice-commits] core.git: include/svx svx/source

Stephan Bergmann sbergman at redhat.com
Tue Jun 13 09:25:30 UTC 2017


 include/svx/float3d.hxx         |    2 +-
 svx/source/engine3d/float3d.cxx |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 5df3b28a24825653ca112dd3e709aad3e4f4630a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 13 11:25:05 2017 +0200

    Use unique_ptr for Svx3DWin::mpRemember2DAttributes
    
    Change-Id: I55120a885d74bbd3710a4e02be939a8e4e6a9ba2

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()


More information about the Libreoffice-commits mailing list