diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-26 15:27:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-27 08:36:31 +0200 |
commit | ec2cc68a666b573e226fce94919041538345cd9b (patch) | |
tree | 64d54781c2327853bcff9e7e018e6bb7a449855b /sw/source/filter/basflt | |
parent | 07e5c4381ac405b4379767f9735152b8f0314faa (diff) |
loplugin:useuniqueptr in SwReader::Read
Change-Id: Iff7936e440951e65653ef42ce5a2aebd22a03029
Reviewed-on: https://gerrit.libreoffice.org/61004
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/basflt')
-rw-r--r-- | sw/source/filter/basflt/shellio.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index ccfd9d69c74e..c4bd839976fa 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -150,12 +150,12 @@ ErrCode SwReader::Read( const Reader& rOptions ) mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( RedlineFlags::Ignore ); - SwPaM* pUndoPam = nullptr; + std::unique_ptr<SwPaM> pUndoPam; if( bDocUndo || pCursor ) { // set Pam to the previous node, so that it is not also moved const SwNodeIndex& rTmp = pPam->GetPoint()->nNode; - pUndoPam = new SwPaM( rTmp, rTmp, 0, -1 ); + pUndoPam.reset(new SwPaM( rTmp, rTmp, 0, -1 )); } // store for now all Fly's @@ -316,7 +316,7 @@ ErrCode SwReader::Read( const Reader& rOptions ) mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( RedlineFlags::Ignore ); } - delete pUndoPam; + pUndoPam.reset(); pPam = pPam->GetNext(); if( pPam == pEnd ) |