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

Noel Grandin noel.grandin at collabora.co.uk
Mon Mar 5 06:28:55 UTC 2018


 filter/source/msfilter/eschesdo.cxx  |    8 +++-----
 filter/source/msfilter/eschesdo.hxx  |    2 +-
 filter/source/msfilter/msdffimp.cxx  |    5 +----
 include/filter/msfilter/msdffimp.hxx |    4 ++--
 4 files changed, 7 insertions(+), 12 deletions(-)

New commits:
commit cab19696ce0a441e83ff1012de014265a6d4c471
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Feb 28 15:35:29 2018 +0200

    loplugin:useuniqueptr in SvxMSDffManager
    
    Change-Id: I2e3ef185d370ccacc0d1e99b5f9e732a829fdc55
    Reviewed-on: https://gerrit.libreoffice.org/50693
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index ec6311454449..5cf0b9f90d8b 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4248,8 +4248,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
     if ( aObjData.bOpt2 )
     {
         maShapeRecords.Current()->SeekToBegOfRecord( rSt );
-        delete pSecPropSet;
-        pSecPropSet = new DffPropertyReader( *this );
+        pSecPropSet.reset( new DffPropertyReader( *this ) );
         pSecPropSet->ReadPropSet( rSt, nullptr );
     }
 
@@ -5698,8 +5697,6 @@ SvxMSDffManager::SvxMSDffManager( SvStream& rStCtrl_, const OUString& rBaseURL )
 
 SvxMSDffManager::~SvxMSDffManager()
 {
-    delete pSecPropSet;
-    delete m_pBLIPInfos;
 }
 
 void SvxMSDffManager::InitSvxMSDffManager( sal_uInt32 nOffsDgg_, SvStream* pStData_, sal_uInt32 nOleConvFlags )
diff --git a/include/filter/msfilter/msdffimp.hxx b/include/filter/msfilter/msdffimp.hxx
index 0600f7dbdfde..aafb47b3bc88 100644
--- a/include/filter/msfilter/msdffimp.hxx
+++ b/include/filter/msfilter/msdffimp.hxx
@@ -397,7 +397,7 @@ public:
 */
 class MSFILTER_DLLPUBLIC SvxMSDffManager : public DffPropertyReader
 {
-    SvxMSDffBLIPInfos*      m_pBLIPInfos;
+    std::unique_ptr<SvxMSDffBLIPInfos>      m_pBLIPInfos;
     std::unique_ptr<SvxMSDffShapeInfos_ByTxBxComp> m_xShapeInfosByTxBxComp;
     std::unique_ptr<SvxMSDffShapeInfos_ById> m_xShapeInfosById;
     SvxMSDffShapeOrders     m_aShapeOrders;
@@ -528,7 +528,7 @@ protected:
     virtual bool ShapeHasText(sal_uLong nShapeId, sal_uLong nFilePos) const;
 
 public:
-    DffPropertyReader* pSecPropSet;
+    std::unique_ptr<DffPropertyReader> pSecPropSet;
     std::map<sal_uInt32,OString> aEscherBlipCache;
 
     DffRecordManager    maShapeRecords;
commit e7fe6de011c34223352ad6b60d47a442b44ac5c9
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Feb 28 15:09:28 2018 +0200

    loplugin:useuniqueptr in ImplEESdrWriter
    
    Change-Id: I60374a643e2ab91a6dec60b69e0b23f041bd8b01
    Reviewed-on: https://gerrit.libreoffice.org/50692
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index e8a47aa877e5..19fb9483eed7 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -857,7 +857,6 @@ ImplEESdrWriter::~ImplEESdrWriter()
     Reference<css::lang::XComponent> xComp(mXDrawPage, UNO_QUERY);
     if (xComp.is())
         xComp->dispose();
-    delete mpSolverContainer;
 }
 
 
@@ -881,7 +880,7 @@ bool ImplEESdrWriter::ImplInitPage( const SdrPage& rPage )
             return false;
         mpSdrPage = &rPage;
 
-        mpSolverContainer = new EscherSolverContainer;
+        mpSolverContainer.reset( new EscherSolverContainer );
     }
     else
         pSvxDrawPage = SvxDrawPage::getImplementation(mXDrawPage);
@@ -904,7 +903,7 @@ bool ImplEESdrWriter::ImplInitUnoShapes( const Reference< XShapes >& rxShapes )
     if( !ImplInitPageValues() )    // ImplEESdrWriter
         return false;
 
-    mpSolverContainer = new EscherSolverContainer;
+    mpSolverContainer.reset( new EscherSolverContainer );
     return true;
 }
 
@@ -924,8 +923,7 @@ void ImplEESdrWriter::ImplFlushSolverContainer()
     if ( mpSolverContainer )
     {
         mpSolverContainer->WriteSolver( mpEscherEx->GetStream() );
-        delete mpSolverContainer;
-        mpSolverContainer = nullptr;
+        mpSolverContainer.reset();
     }
 }
 
diff --git a/filter/source/msfilter/eschesdo.hxx b/filter/source/msfilter/eschesdo.hxx
index ea905c82f7c9..431c4520b762 100644
--- a/filter/source/msfilter/eschesdo.hxx
+++ b/filter/source/msfilter/eschesdo.hxx
@@ -115,7 +115,7 @@ class ImplEESdrWriter
     EscherExHostAppData*    mpHostAppData;
     bool                    mbIsTitlePossible;
     const SdrPage*          mpSdrPage;
-    EscherSolverContainer*  mpSolverContainer;
+    std::unique_ptr<EscherSolverContainer> mpSolverContainer;
 
     bool                ImplInitPageValues();
     void                ImplWritePage( EscherSolverContainer& rSolver );


More information about the Libreoffice-commits mailing list