diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-09 16:04:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-10 08:31:41 +0200 |
commit | 02329510d45395422556ff2ac0a0e52892aecb77 (patch) | |
tree | d182b152bfa4a3e0f5ad353646d2941d982d64b4 | |
parent | 5c8f9d0d83127df1017e41d3512a629627527a82 (diff) |
loplugin:useuniqueptr in ScCellFormatsEnumeration
Change-Id: I5551b65d4c7fea7e38d7c5b40af7c1803218b960
Reviewed-on: https://gerrit.libreoffice.org/57203
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sc/inc/cellsuno.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx index 9cc132541a83..f36ec2a92573 100644 --- a/sc/inc/cellsuno.hxx +++ b/sc/inc/cellsuno.hxx @@ -1150,7 +1150,7 @@ class ScCellFormatsEnumeration : public cppu::WeakImplHelper< private: ScDocShell* pDocShell; SCTAB nTab; - ScAttrRectIterator* pIter; + std::unique_ptr<ScAttrRectIterator> pIter; ScRange aNext; bool bAtEnd; bool bDirty; diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index b8465626ab9c..9273ed844c47 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -9176,9 +9176,9 @@ ScCellFormatsEnumeration::ScCellFormatsEnumeration(ScDocShell* pDocSh, const ScR OSL_ENSURE( rRange.aStart.Tab() == rRange.aEnd.Tab(), "CellFormatsEnumeration: different tables" ); - pIter = new ScAttrRectIterator( &rDoc, nTab, + pIter.reset( new ScAttrRectIterator( &rDoc, nTab, rRange.aStart.Col(), rRange.aStart.Row(), - rRange.aEnd.Col(), rRange.aEnd.Row() ); + rRange.aEnd.Col(), rRange.aEnd.Row() ) ); Advance_Impl(); } @@ -9188,7 +9188,6 @@ ScCellFormatsEnumeration::~ScCellFormatsEnumeration() if (pDocShell) pDocShell->GetDocument().RemoveUnoObject(*this); - delete pIter; } void ScCellFormatsEnumeration::Advance_Impl() @@ -9240,8 +9239,7 @@ void ScCellFormatsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint ) if ( nId == SfxHintId::Dying ) { pDocShell = nullptr; - delete pIter; - pIter = nullptr; + pIter.reset(); } else if ( nId == SfxHintId::DataChanged ) { |