diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-07 10:50:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-26 10:15:18 +0100 |
commit | 91db89b73c4059bc2af86d91752b89d2497034c7 (patch) | |
tree | 70a4eb76497cdc9607a708cb698c5f40d25688cb /filter | |
parent | 6ed9590303b416c958d8d4ae98386f517a332f7f (diff) |
loplugin:useuniqueptr in SvxMSDffSolverContainer
Change-Id: Ied7b60ac59cf1c869232a96e1b2ccb4e1b5cbf53
Reviewed-on: https://gerrit.libreoffice.org/49945
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 10 | ||||
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 6 |
2 files changed, 6 insertions, 10 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 3ffae20be7dc..fa05c6a71e58 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -399,10 +399,6 @@ SvxMSDffSolverContainer::SvxMSDffSolverContainer() SvxMSDffSolverContainer::~SvxMSDffSolverContainer() { - for(SvxMSDffConnectorRule* i : aCList) { - delete i; - } - aCList.clear(); } SvStream& ReadSvxMSDffSolverContainer( SvStream& rIn, SvxMSDffSolverContainer& rContainer ) @@ -419,9 +415,9 @@ SvStream& ReadSvxMSDffSolverContainer( SvStream& rIn, SvxMSDffSolverContainer& r break; if ( aCRule.nRecType == DFF_msofbtConnectorRule ) { - SvxMSDffConnectorRule* pRule = new SvxMSDffConnectorRule; + std::unique_ptr<SvxMSDffConnectorRule> pRule(new SvxMSDffConnectorRule); rIn >> *pRule; - rContainer.aCList.push_back( pRule ); + rContainer.aCList.push_back( std::move(pRule) ); } if (!aCRule.SeekToEndOfRecord(rIn)) break; @@ -435,7 +431,7 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver ) size_t i, nCnt; for ( i = 0, nCnt = rSolver.aCList.size(); i < nCnt; i++ ) { - SvxMSDffConnectorRule* pPtr = rSolver.aCList[ i ]; + SvxMSDffConnectorRule* pPtr = rSolver.aCList[ i ].get(); if ( pPtr->pCObj ) { for ( int nN = 0; nN < 2; nN++ ) diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 28401d7cc4e6..7d018dff716b 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -1237,7 +1237,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi } if (rPersistEntry.xSolverContainer) { - for (SvxMSDffConnectorRule* pPtr : rPersistEntry.xSolverContainer->aCList) + for (auto & pPtr : rPersistEntry.xSolverContainer->aCList) { if ( rObjData.nShapeId == pPtr->nShapeC ) pPtr->pCObj = pRet; @@ -2921,7 +2921,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry* pRet->getSdrPageProperties().PutItemSet(rSlidePersist.pBObj->GetMergedItemSet()); if (rSlidePersist.xSolverContainer) { - for (SvxMSDffConnectorRule* pPtr : rSlidePersist.xSolverContainer->aCList) + for (auto & pPtr : rSlidePersist.xSolverContainer->aCList) { // check connections to the group object if (pPtr->pAObj == rSlidePersist.pBObj) @@ -7659,7 +7659,7 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, const sal_uInt32 // possibly connections to the group object have to be removed. if ( pSolverContainer ) { - for (SvxMSDffConnectorRule* pPtr : pSolverContainer->aCList) + for (auto & pPtr : pSolverContainer->aCList) { // check connections to the group object if ( pPtr->pAObj == pGroup ) |