diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-17 16:47:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-18 07:49:24 +0100 |
commit | a7ea04397bf8c6749c84fe8f0d9afc80e4cf6bb2 (patch) | |
tree | ffd6367aa8269a85f74cc7e2b687a1df5deb1c8a /sc/source/core/data/patattr.cxx | |
parent | 60b0526ea4929ce273de499f552a4d478a973d10 (diff) |
use unique_ptr in sc
Change-Id: I14ccb215e895b607c7244b420ee2cbaea8112b15
Reviewed-on: https://gerrit.libreoffice.org/66549
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/core/data/patattr.cxx')
-rw-r--r-- | sc/source/core/data/patattr.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 1508663e0feb..d9850d7b9ed9 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -1021,7 +1021,7 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD SfxItemState eItemState = pSrcSet->GetItemState( nAttrId, false, &pSrcItem ); if (eItemState==SfxItemState::SET) { - SfxPoolItem* pNewItem = nullptr; + std::unique_ptr<SfxPoolItem> pNewItem; if ( nAttrId == ATTR_VALIDDATA ) { @@ -1036,7 +1036,7 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD if ( pOldData ) nNewIndex = pDestDoc->AddValidationEntry( *pOldData ); } - pNewItem = new SfxUInt32Item( ATTR_VALIDDATA, nNewIndex ); + pNewItem.reset(new SfxUInt32Item( ATTR_VALIDDATA, nNewIndex )); } else if ( nAttrId == ATTR_VALUE_FORMAT && pDestDoc->GetFormatExchangeList() ) { @@ -1047,14 +1047,13 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD if (it != pDestDoc->GetFormatExchangeList()->end()) { sal_uInt32 nNewFormat = it->second; - pNewItem = new SfxUInt32Item( ATTR_VALUE_FORMAT, nNewFormat ); + pNewItem.reset(new SfxUInt32Item( ATTR_VALUE_FORMAT, nNewFormat )); } } if ( pNewItem ) { pDestSet->Put(*pNewItem); - delete pNewItem; } else pDestSet->Put(*pSrcItem); |