diff options
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/itemset.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index 398a74896084..784e23a33e22 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -1397,11 +1397,11 @@ bool SfxItemSet::Equals(const SfxItemSet &rCmp, bool bComparePool) const return true; } -SfxItemSet *SfxItemSet::Clone(bool bItems, SfxItemPool *pToPool ) const +std::unique_ptr<SfxItemSet> SfxItemSet::Clone(bool bItems, SfxItemPool *pToPool ) const { if (pToPool && pToPool != m_pPool) { - SfxItemSet *pNewSet = new SfxItemSet(*pToPool, m_pWhichRanges); + std::unique_ptr<SfxItemSet> pNewSet(new SfxItemSet(*pToPool, m_pWhichRanges)); if ( bItems ) { SfxWhichIter aIter(*pNewSet); @@ -1417,9 +1417,9 @@ SfxItemSet *SfxItemSet::Clone(bool bItems, SfxItemPool *pToPool ) const return pNewSet; } else - return bItems + return std::unique_ptr<SfxItemSet>(bItems ? new SfxItemSet(*this) - : new SfxItemSet(*m_pPool, m_pWhichRanges); + : new SfxItemSet(*m_pPool, m_pWhichRanges)); } void SfxItemSet::PutDirect(const SfxPoolItem &rItem) @@ -1692,17 +1692,17 @@ void SfxItemSet::DisableItem(sal_uInt16 nWhich) Put( SfxVoidItem(0), nWhich ); } -SfxItemSet *SfxAllItemSet::Clone(bool bItems, SfxItemPool *pToPool ) const +std::unique_ptr<SfxItemSet> SfxAllItemSet::Clone(bool bItems, SfxItemPool *pToPool ) const { if (pToPool && pToPool != m_pPool) { - SfxAllItemSet *pNewSet = new SfxAllItemSet( *pToPool ); + std::unique_ptr<SfxAllItemSet> pNewSet(new SfxAllItemSet( *pToPool )); if ( bItems ) pNewSet->Set( *this ); - return pNewSet; + return std::unique_ptr<SfxItemSet>(pNewSet.release()); // clang3.8 does not seem to be able to upcast std::unique_ptr } else - return bItems ? new SfxAllItemSet(*this) : new SfxAllItemSet(*m_pPool); + return std::unique_ptr<SfxItemSet>(bItems ? new SfxAllItemSet(*this) : new SfxAllItemSet(*m_pPool)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |