summaryrefslogtreecommitdiff
path: root/sc/source/ui/app
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-01-17 16:47:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-01-18 07:49:24 +0100
commita7ea04397bf8c6749c84fe8f0d9afc80e4cf6bb2 (patch)
treeffd6367aa8269a85f74cc7e2b687a1df5deb1c8a /sc/source/ui/app
parent60b0526ea4929ce273de499f552a4d478a973d10 (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/ui/app')
-rw-r--r--sc/source/ui/app/inputhdl.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index aabcc77ec6a4..622967c15fcf 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2747,7 +2747,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
// Find common (cell) attributes before RemoveAdjust
if ( pActiveViewSh && bUniformAttribs )
{
- SfxItemSet* pCommonAttrs = nullptr;
+ std::unique_ptr<SfxItemSet> pCommonAttrs;
for (sal_uInt16 nId = EE_CHAR_START; nId <= EE_CHAR_END; nId++)
{
SfxItemState eState = aOldAttribs.GetItemState( nId, false, &pItem );
@@ -2757,7 +2757,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
*pItem != pEditDefaults->Get(nId) )
{
if ( !pCommonAttrs )
- pCommonAttrs = new SfxItemSet( mpEditEngine->GetEmptyItemSet() );
+ pCommonAttrs.reset(new SfxItemSet( mpEditEngine->GetEmptyItemSet() ));
pCommonAttrs->Put( *pItem );
}
}
@@ -2766,8 +2766,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
{
ScDocument* pDoc = pActiveViewSh->GetViewData().GetDocument();
pCellAttrs = o3tl::make_unique<ScPatternAttr>(pDoc->GetPool());
- pCellAttrs->GetFromEditItemSet( pCommonAttrs );
- delete pCommonAttrs;
+ pCellAttrs->GetFromEditItemSet( pCommonAttrs.get() );
}
}