[Libreoffice-commits] core.git: chart2/source

Stephan Bergmann sbergman at redhat.com
Thu Apr 6 14:02:56 UTC 2017


 chart2/source/controller/main/ChartTransferable.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 724ddb9177fd38c80f60d3d957d7be4be813c069
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 6 16:02:24 2017 +0200

    loplugin:useuniqueptr
    
    Change-Id: I33aafc7351c5fdc2c677d0be123f666211255ccb

diff --git a/chart2/source/controller/main/ChartTransferable.cxx b/chart2/source/controller/main/ChartTransferable.cxx
index b427669a459c..e5d1e1f4cb55 100644
--- a/chart2/source/controller/main/ChartTransferable.cxx
+++ b/chart2/source/controller/main/ChartTransferable.cxx
@@ -17,8 +17,13 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <memory>
+
 #include "ChartTransferable.hxx"
 
+#include <o3tl/make_unique.hxx>
 #include <sot/exchange.hxx>
 #include <sot/storage.hxx>
 #include <unotools/streamwrap.hxx>
@@ -43,7 +48,7 @@ ChartTransferable::ChartTransferable( SdrModel* pDrawModel, SdrObject* pSelected
     :m_pMarkedObjModel( nullptr )
     ,m_bDrawing( bDrawing )
 {
-    SdrExchangeView * pExchgView( new SdrView( pDrawModel ));
+    std::unique_ptr<SdrExchangeView> pExchgView(o3tl::make_unique<SdrView>( pDrawModel ));
     SdrPageView* pPv = pExchgView->ShowSdrPage( pDrawModel->GetPage( 0 ));
     if( pSelectedObj )
         pExchgView->MarkObj( pSelectedObj, pPv );
@@ -55,7 +60,6 @@ ChartTransferable::ChartTransferable( SdrModel* pDrawModel, SdrObject* pSelected
     {
         m_pMarkedObjModel = pExchgView->GetMarkedObjModel();
     }
-    delete pExchgView;
 }
 
 ChartTransferable::~ChartTransferable()


More information about the Libreoffice-commits mailing list