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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Aug 22 19:51:28 UTC 2018


 sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx |   12 ++++++------
 sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx |    6 +++---
 sc/source/filter/xml/XMLTrackedChangesContext.cxx      |    6 +++---
 3 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 3c0373016afa69fd9a1086a037bdd28793431e09
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Aug 22 14:37:21 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Aug 22 21:51:01 2018 +0200

    pass ScMyCellInfo around by std::unique_ptr
    
    Change-Id: Ib34fb23c26510c0b2b4e485d2643a75a9c745dec
    Reviewed-on: https://gerrit.libreoffice.org/59449
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
index 3144fe1ece3c..fe0feec6e36f 100644
--- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
+++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
@@ -88,10 +88,10 @@ ScMyDeleted::~ScMyDeleted()
 {
 }
 
-ScMyGenerated::ScMyGenerated(ScMyCellInfo* pTempCellInfo, const ScBigRange& aTempBigRange)
+ScMyGenerated::ScMyGenerated(std::unique_ptr<ScMyCellInfo> pTempCellInfo, const ScBigRange& aTempBigRange)
     : aBigRange(aTempBigRange)
     , nID(0)
-    , pCellInfo(pTempCellInfo)
+    , pCellInfo(std::move(pTempCellInfo))
 {
 }
 
@@ -300,11 +300,11 @@ void ScXMLChangeTrackingImportHelper::AddDeleted(const sal_uInt32 nID)
     pCurrentAction->aDeletedList.push_front(pDeleted);
 }
 
-void ScXMLChangeTrackingImportHelper::AddDeleted(const sal_uInt32 nID, ScMyCellInfo* pCellInfo)
+void ScXMLChangeTrackingImportHelper::AddDeleted(const sal_uInt32 nID, std::unique_ptr<ScMyCellInfo> pCellInfo)
 {
     ScMyDeleted* pDeleted = new ScMyDeleted();
     pDeleted->nID = nID;
-    pDeleted->pCellInfo.reset(pCellInfo);
+    pDeleted->pCellInfo = std::move(pCellInfo);
     pCurrentAction->aDeletedList.push_front(pDeleted);
 }
 
@@ -379,9 +379,9 @@ void ScXMLChangeTrackingImportHelper::GetMultiSpannedRange()
     }
 }
 
-void ScXMLChangeTrackingImportHelper::AddGenerated(ScMyCellInfo* pCellInfo, const ScBigRange& aBigRange)
+void ScXMLChangeTrackingImportHelper::AddGenerated(std::unique_ptr<ScMyCellInfo> pCellInfo, const ScBigRange& aBigRange)
 {
-    ScMyGenerated* pGenerated = new ScMyGenerated(pCellInfo, aBigRange);
+    ScMyGenerated* pGenerated = new ScMyGenerated(std::move(pCellInfo), aBigRange);
     if (pCurrentAction->nActionType == SC_CAT_MOVE)
     {
         static_cast<ScMyMoveAction*>(pCurrentAction)->aGeneratedList.push_back(pGenerated);
diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx
index 2fc3cbd070c5..55b6588ab39c 100644
--- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx
+++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx
@@ -76,7 +76,7 @@ struct ScMyGenerated
     sal_uInt32      nID;
     std::unique_ptr<ScMyCellInfo> pCellInfo;
 
-    ScMyGenerated(ScMyCellInfo* pCellInfo, const ScBigRange& aBigRange);
+    ScMyGenerated(std::unique_ptr<ScMyCellInfo> pCellInfo, const ScBigRange& aBigRange);
     ~ScMyGenerated();
 };
 
@@ -211,13 +211,13 @@ public:
     void SetPosition(const sal_Int32 nPosition, const sal_Int32 nCount, const sal_Int32 nTable);
     void AddDependence(const sal_uInt32 nID) { pCurrentAction->aDependencies.push_front(nID); }
     void AddDeleted(const sal_uInt32 nID);
-    void AddDeleted(const sal_uInt32 nID, ScMyCellInfo* pCellInfo);
+    void AddDeleted(const sal_uInt32 nID, std::unique_ptr<ScMyCellInfo> pCellInfo);
     void SetMultiSpanned(const sal_Int16 nMultiSpanned);
     void SetInsertionCutOff(const sal_uInt32 nID, const sal_Int32 nPosition);
     void AddMoveCutOff(const sal_uInt32 nID, const sal_Int32 nStartPosition, const sal_Int32 nEndPosition);
     void SetMoveRanges(const ScBigRange& aSourceRange, const ScBigRange& aTargetRange);
     void GetMultiSpannedRange();
-    void AddGenerated(ScMyCellInfo* pCellInfo, const ScBigRange& aBigRange);
+    void AddGenerated(std::unique_ptr<ScMyCellInfo> pCellInfo, const ScBigRange& aBigRange);
 
     void EndChangeAction();
 
diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
index c309c73f8c35..1a426bf4fba0 100644
--- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx
+++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
@@ -584,12 +584,12 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLCellContentDeletio
 
 void SAL_CALL ScXMLCellContentDeletionContext::endFastElement( sal_Int32 /*nElement*/ )
 {
-    ScMyCellInfo* pCellInfo(new ScMyCellInfo(maCell, sFormulaAddress, sFormula, eGrammar, sInputString, fValue, nType,
+    std::unique_ptr<ScMyCellInfo> pCellInfo(new ScMyCellInfo(maCell, sFormulaAddress, sFormula, eGrammar, sInputString, fValue, nType,
             nMatrixFlag, nMatrixCols, nMatrixRows));
     if (nID)
-        pChangeTrackingImportHelper->AddDeleted(nID, pCellInfo);
+        pChangeTrackingImportHelper->AddDeleted(nID, std::move(pCellInfo));
     else
-        pChangeTrackingImportHelper->AddGenerated(pCellInfo, aBigRange);
+        pChangeTrackingImportHelper->AddGenerated(std::move(pCellInfo), aBigRange);
 }
 
 ScXMLDependenceContext::ScXMLDependenceContext(  ScXMLImport& rImport,


More information about the Libreoffice-commits mailing list