compilerplugins/clang/useuniqueptr.cxx |   11 +++++++++++
 sc/source/filter/xml/xmlcelli.cxx      |   12 ++++--------
 sc/source/filter/xml/xmlcelli.hxx      |    4 ++--
 3 files changed, 17 insertions(+), 10 deletions(-)

New commits:
commit c91956452b5930e46d953668dff51d39746f8cf2
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Fri Apr 6 13:20:46 2018 +0200

    loplugin:useuniqueptr in ScXMLTableRowCellContext
    
    Change-Id: Ie2c50b08eed674c129f0f66eae502c61e565a7f8
    Reviewed-on: https://gerrit.libreoffice.org/52495
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/compilerplugins/clang/useuniqueptr.cxx 
b/compilerplugins/clang/useuniqueptr.cxx
index 3b3e9ff49e81..5d00c1a637e8 100644
--- a/compilerplugins/clang/useuniqueptr.cxx
+++ b/compilerplugins/clang/useuniqueptr.cxx
@@ -32,6 +32,17 @@ public:
 
     virtual void run() override
     {
+        std::string fn(compiler.getSourceManager()
+                           
.getFileEntryForID(compiler.getSourceManager().getMainFileID())
+                           ->getName());
+        loplugin::normalizeDotDotInFilePath(fn);
+        // can't change these because we pass them down to the SfxItemPool 
stuff
+        if (fn == SRCDIR "/sc/source/core/data/docpool.cxx")
+            return;
+        // this just too clever for me
+        if (fn == SRCDIR "/sc/source/core/tool/chgtrack.cxx")
+            return;
+
         TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
     }
 
diff --git a/sc/source/filter/xml/xmlcelli.cxx 
b/sc/source/filter/xml/xmlcelli.cxx
index b1c4f4cf0e3c..cc9ba05135c0 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -124,8 +124,6 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( 
ScXMLImport& rImport,
     ScXMLImportContext( rImport ),
     mpEditEngine(GetScImport().GetEditEngine()),
     mnCurParagraph(0),
-    pDetectiveObjVec(nullptr),
-    pCellRangeSource(nullptr),
     fValue(0.0),
     nMergedRows(1),
     nMatrixRows(0),
@@ -298,8 +296,6 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( 
ScXMLImport& rImport,
 
 ScXMLTableRowCellContext::~ScXMLTableRowCellContext()
 {
-    delete pDetectiveObjVec;
-    delete pCellRangeSource;
 }
 
 void ScXMLTableRowCellContext::LockSolarMutex()
@@ -724,18 +720,18 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL 
ScXMLTableRowCellContex
         {
             bIsEmpty = false;
             if (!pDetectiveObjVec)
-                pDetectiveObjVec = new ScMyImpDetectiveObjVec;
+                pDetectiveObjVec.reset( new ScMyImpDetectiveObjVec );
             pContext = new ScXMLDetectiveContext(
-                rXMLImport, pDetectiveObjVec );
+                rXMLImport, pDetectiveObjVec.get() );
         }
         break;
         case XML_ELEMENT( TABLE, XML_CELL_RANGE_SOURCE ):
         {
             bIsEmpty = false;
             if (!pCellRangeSource)
-                pCellRangeSource = new ScMyImpCellRangeSource();
+                pCellRangeSource.reset(new ScMyImpCellRangeSource());
             pContext = new ScXMLCellRangeSourceContext(
-                rXMLImport, pAttribList, pCellRangeSource );
+                rXMLImport, pAttribList, pCellRangeSource.get() );
         }
         break;
     }
diff --git a/sc/source/filter/xml/xmlcelli.hxx 
b/sc/source/filter/xml/xmlcelli.hxx
index d816dec3ef67..0e567e051910 100644
--- a/sc/source/filter/xml/xmlcelli.hxx
+++ b/sc/source/filter/xml/xmlcelli.hxx
@@ -75,8 +75,8 @@ class ScXMLTableRowCellContext : public ScXMLImportContext
     FieldsType maFields;
 
     std::unique_ptr< ScXMLAnnotationData > mxAnnotationData;
-    ScMyImpDetectiveObjVec* pDetectiveObjVec;
-    ScMyImpCellRangeSource* pCellRangeSource;
+    std::unique_ptr< ScMyImpDetectiveObjVec > pDetectiveObjVec;
+    std::unique_ptr< ScMyImpCellRangeSource > pCellRangeSource;
     double      fValue;
     SCROW       nMergedRows, nMatrixRows, nRepeatedRows;
     SCCOL       nMergedCols, nMatrixCols, nColsRepeated;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to