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/source/msfilter/msdffimp.cxx | |
parent | nfc: use std::min in fly.cxx:CalcRel (diff) | |
download | core-91db89b73c4059bc2af86d91752b89d2497034c7.tar.gz core-91db89b73c4059bc2af86d91752b89d2497034c7.zip |
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/source/msfilter/msdffimp.cxx')
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 10 |
1 files changed, 3 insertions, 7 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++ ) |