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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jul 17 06:40:32 UTC 2018


 sc/source/filter/excel/excimp8.cxx |    4 ++--
 sc/source/filter/excel/impop.cxx   |    9 +++++----
 sc/source/filter/excel/read.cxx    |    2 +-
 sc/source/filter/inc/imp_op.hxx    |    4 ++--
 sc/source/ui/inc/tpcalc.hxx        |    4 ++--
 sc/source/ui/optdlg/tpcalc.cxx     |    4 ++--
 6 files changed, 14 insertions(+), 13 deletions(-)

New commits:
commit 100f66cfa594454a4f06998e6a346b8f42c052b1
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jul 16 16:52:00 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jul 17 08:40:23 2018 +0200

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

diff --git a/sc/source/ui/inc/tpcalc.hxx b/sc/source/ui/inc/tpcalc.hxx
index 4e43b776fa62..313434461e7a 100644
--- a/sc/source/ui/inc/tpcalc.hxx
+++ b/sc/source/ui/inc/tpcalc.hxx
@@ -70,8 +70,8 @@ private:
 
     VclPtr<CheckBox>       m_pBtnThread;
 
-    ScDocOptions*          pOldOptions;
-    ScDocOptions*          pLocalOptions;
+    std::unique_ptr<ScDocOptions> pOldOptions;
+    std::unique_ptr<ScDocOptions> pLocalOptions;
     sal_uInt16             nWhichCalc;
 
 private:
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index dc9ae0e28284..3f7f11da2d60 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -75,8 +75,8 @@ ScTpCalcOptions::~ScTpCalcOptions()
 
 void ScTpCalcOptions::dispose()
 {
-    delete pOldOptions;
-    delete pLocalOptions;
+    pOldOptions.reset();
+    pLocalOptions.reset();
     m_pBtnIterate.clear();
     m_pFtSteps.clear();
     m_pEdSteps.clear();
commit 1926e76d9a7ac54b00526afb94debef89108d00c
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jul 16 16:01:15 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jul 17 08:40:08 2018 +0200

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

diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index 0acb857079bf..739a636c36a1 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -188,8 +188,8 @@ ImportExcel8::ImportExcel8( XclImpRootData& rImpData, SvStream& rStrm ) :
     ImportExcel( rImpData, rStrm )
 {
     // replace BIFF2-BIFF5 formula importer with BIFF8 formula importer
-    delete pFormConv;
-    pFormConv = pExcRoot->pFmlaConverter = new ExcelToSc8( GetRoot() );
+    pFormConv.reset(new ExcelToSc8( GetRoot() ));
+    pExcRoot->pFmlaConverter = pFormConv.get();
 }
 
 ImportExcel8::~ImportExcel8()
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index f1bf316f6640..d206b5d278f3 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -129,10 +129,11 @@ ImportExcel::ImportExcel( XclImpRootData& rImpData, SvStream& rStrm ):
     pExcRoot->pShrfmlaBuff.reset( new SharedFormulaBuffer( pExcRoot ) );     //&aShrfrmlaBuff;
     pExcRoot->pExtNameBuff.reset( new ExtNameBuff ( *this ) );
 
-    pOutlineListBuffer = new XclImpOutlineListBuffer;
+    pOutlineListBuffer.reset(new XclImpOutlineListBuffer);
 
     // ab Biff8
-    pFormConv = pExcRoot->pFmlaConverter = new ExcelToSc( GetRoot() );
+    pFormConv.reset(new ExcelToSc( GetRoot() ));
+    pExcRoot->pFmlaConverter = pFormConv.get();
 
     bTabTruncated = false;
 
@@ -154,9 +155,9 @@ ImportExcel::~ImportExcel()
 {
     GetDoc().SetSrcCharSet( GetTextEncoding() );
 
-    delete pOutlineListBuffer;
+    pOutlineListBuffer.reset();
 
-    delete pFormConv;
+    pFormConv.reset();
 }
 
 void ImportExcel::SetLastFormula( SCCOL nCol, SCROW nRow, double fVal, sal_uInt16 nXF, ScFormulaCell* pCell )
diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index 903b6fca70fc..2da672b01fde 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -1074,7 +1074,7 @@ ErrCode ImportExcel8::Read()
                     case EXC_ID_SUPBOOK:        rLinkMgr.ReadSupbook( maStrm );     break;
                     case EXC_ID_XCT:            rLinkMgr.ReadXct( maStrm );         break;
                     case EXC_ID_CRN:            rLinkMgr.ReadCrn( maStrm );         break;
-                    case EXC_ID_EXTERNNAME:     rLinkMgr.ReadExternname( maStrm, pFormConv );  break;
+                    case EXC_ID_EXTERNNAME:     rLinkMgr.ReadExternname( maStrm, pFormConv.get() );  break;
 
                     case EXC_ID_MSODRAWINGGROUP:rObjMgr.ReadMsoDrawingGroup( maStrm ); break;
 
diff --git a/sc/source/filter/inc/imp_op.hxx b/sc/source/filter/inc/imp_op.hxx
index 2d4bdf0e678f..9ac4abd7992a 100644
--- a/sc/source/filter/inc/imp_op.hxx
+++ b/sc/source/filter/inc/imp_op.hxx
@@ -97,14 +97,14 @@ protected:
     ScfUInt32Vec            maSheetOffsets;
     ScRange                 maScOleSize;        /// Visible range if embedded.
 
-    ExcelToSc*              pFormConv;          // formula-converter
+    std::unique_ptr<ExcelToSc> pFormConv;          // formula-converter
 
     XclImpOutlineBuffer*    pColOutlineBuff;
     XclImpOutlineBuffer*    pRowOutlineBuff;
     XclImpColRowSettings*   pColRowBuff;        // Col/Row settings 1 table
 
     typedef std::vector< std::unique_ptr<XclImpOutlineDataBuffer> > XclImpOutlineListBuffer;
-    XclImpOutlineListBuffer* pOutlineListBuffer;
+    std::unique_ptr<XclImpOutlineListBuffer> pOutlineListBuffer;
 
     LastFormulaMapType maLastFormulaCells; // Keep track of last formula cells in each column.
     LastFormula* mpLastFormula;


More information about the Libreoffice-commits mailing list