summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-10 14:49:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-11 08:17:42 +0200
commit1476d95b6ed3afa35cccc46f61865ea938b62144 (patch)
tree7d89eea8c9a61cb8676389d2c066792e7b8b30fe /sw
parent9a9d407977494b405479b138a33fc6f8f1e2911d (diff)
loplugin:useuniqueptr in StylePool::createIterator
Change-Id: I1a7bdfc00352c25f5d2db9ef195000d16f909537 Reviewed-on: https://gerrit.libreoffice.org/60263 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/swstylemanager.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/sw/source/core/doc/swstylemanager.cxx b/sw/source/core/doc/swstylemanager.cxx
index 40ca237164b8..0bef02b0ae08 100644
--- a/sw/source/core/doc/swstylemanager.cxx
+++ b/sw/source/core/doc/swstylemanager.cxx
@@ -43,7 +43,7 @@ public:
void SwStyleCache::addCompletePool( StylePool& rPool )
{
- IStylePoolIteratorAccess *pIter = rPool.createIterator();
+ std::unique_ptr<IStylePoolIteratorAccess> pIter = rPool.createIterator();
std::shared_ptr<SfxItemSet> pStyle = pIter->getNext();
while( pStyle.get() )
{
@@ -51,7 +51,6 @@ void SwStyleCache::addCompletePool( StylePool& rPool )
mMap[ aName ] = pStyle;
pStyle = pIter->getNext();
}
- delete pIter;
}
class SwStyleManager : public IStyleAccess
@@ -140,7 +139,7 @@ void SwStyleManager::getAllStyles( std::vector<std::shared_ptr<SfxItemSet>> &rSt
{
StylePool& rAutoPool = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? aAutoCharPool : aAutoParaPool;
// setup <StylePool> iterator, which skips unused styles and ignorable items
- IStylePoolIteratorAccess *pIter = rAutoPool.createIterator( true, true );
+ std::unique_ptr<IStylePoolIteratorAccess> pIter = rAutoPool.createIterator( true, true );
std::shared_ptr<SfxItemSet> pStyle = pIter->getNext();
while( pStyle.get() )
{
@@ -148,7 +147,6 @@ void SwStyleManager::getAllStyles( std::vector<std::shared_ptr<SfxItemSet>> &rSt
pStyle = pIter->getNext();
}
- delete pIter;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */