Kaydet (Commit) 02329510 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in ScCellFormatsEnumeration

Change-Id: I5551b65d4c7fea7e38d7c5b40af7c1803218b960
Reviewed-on: https://gerrit.libreoffice.org/57203
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 5c8f9d0d
...@@ -1150,7 +1150,7 @@ class ScCellFormatsEnumeration : public cppu::WeakImplHelper< ...@@ -1150,7 +1150,7 @@ class ScCellFormatsEnumeration : public cppu::WeakImplHelper<
private: private:
ScDocShell* pDocShell; ScDocShell* pDocShell;
SCTAB nTab; SCTAB nTab;
ScAttrRectIterator* pIter; std::unique_ptr<ScAttrRectIterator> pIter;
ScRange aNext; ScRange aNext;
bool bAtEnd; bool bAtEnd;
bool bDirty; bool bDirty;
......
...@@ -9176,9 +9176,9 @@ ScCellFormatsEnumeration::ScCellFormatsEnumeration(ScDocShell* pDocSh, const ScR ...@@ -9176,9 +9176,9 @@ ScCellFormatsEnumeration::ScCellFormatsEnumeration(ScDocShell* pDocSh, const ScR
OSL_ENSURE( rRange.aStart.Tab() == rRange.aEnd.Tab(), OSL_ENSURE( rRange.aStart.Tab() == rRange.aEnd.Tab(),
"CellFormatsEnumeration: different tables" ); "CellFormatsEnumeration: different tables" );
pIter = new ScAttrRectIterator( &rDoc, nTab, pIter.reset( new ScAttrRectIterator( &rDoc, nTab,
rRange.aStart.Col(), rRange.aStart.Row(), rRange.aStart.Col(), rRange.aStart.Row(),
rRange.aEnd.Col(), rRange.aEnd.Row() ); rRange.aEnd.Col(), rRange.aEnd.Row() ) );
Advance_Impl(); Advance_Impl();
} }
...@@ -9188,7 +9188,6 @@ ScCellFormatsEnumeration::~ScCellFormatsEnumeration() ...@@ -9188,7 +9188,6 @@ ScCellFormatsEnumeration::~ScCellFormatsEnumeration()
if (pDocShell) if (pDocShell)
pDocShell->GetDocument().RemoveUnoObject(*this); pDocShell->GetDocument().RemoveUnoObject(*this);
delete pIter;
} }
void ScCellFormatsEnumeration::Advance_Impl() void ScCellFormatsEnumeration::Advance_Impl()
...@@ -9240,8 +9239,7 @@ void ScCellFormatsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint ) ...@@ -9240,8 +9239,7 @@ void ScCellFormatsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
if ( nId == SfxHintId::Dying ) if ( nId == SfxHintId::Dying )
{ {
pDocShell = nullptr; pDocShell = nullptr;
delete pIter; pIter.reset();
pIter = nullptr;
} }
else if ( nId == SfxHintId::DataChanged ) else if ( nId == SfxHintId::DataChanged )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment