diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-22 14:37:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-22 21:51:01 +0200 |
commit | 3c0373016afa69fd9a1086a037bdd28793431e09 (patch) | |
tree | 19d4b4c9dacfa654793eec704505fe02a02f101a | |
parent | 735a230c00f06392d9076b08d5bf573f4ba30e7d (diff) |
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@collabora.co.uk>
-rw-r--r-- | sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx | 12 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx | 6 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLTrackedChangesContext.cxx | 6 |
3 files changed, 12 insertions, 12 deletions
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, |