summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-11 09:56:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-11 14:08:27 +0200
commite5246409cc384cd2ba321620e92250f7ddf153af (patch)
treeeae4b87b9df1918bc69e081d87449a34ef483a99 /cui/source
parent1c0e591accda7669bec9ccfc23977ce3f7386930 (diff)
return std::unique_ptr from SfxItemSet::Clone
Change-Id: Ie747b5c8ff0b82b9f8d268f9a60dbde41b5f022b Reviewed-on: https://gerrit.libreoffice.org/52712 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/dialogs/iconcdlg.cxx10
-rw-r--r--cui/source/inc/iconcdlg.hxx2
2 files changed, 5 insertions, 7 deletions
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index ebce7af401ac..32800dab81d3 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -149,7 +149,6 @@ IconChoiceDialog::IconChoiceDialog ( vcl::Window* pParent, const OUString& rID,
mnCurrentPageId ( HyperLinkPageType::NONE ),
pSet ( nullptr ),
- pOutSet ( nullptr ),
pExampleSet ( nullptr ),
pRanges ( nullptr )
{
@@ -171,7 +170,7 @@ IconChoiceDialog::IconChoiceDialog ( vcl::Window* pParent, const OUString& rID,
if ( pSet )
{
pExampleSet = new SfxItemSet( *pSet );
- pOutSet = new SfxItemSet( *pSet->GetPool(), pSet->GetRanges() );
+ pOutSet.reset(new SfxItemSet( *pSet->GetPool(), pSet->GetRanges() ));
}
// Buttons
@@ -208,8 +207,7 @@ void IconChoiceDialog::dispose()
delete pRanges;
pRanges = nullptr;
- delete pOutSet;
- pOutSet = nullptr;
+ pOutSet.reset();
m_pIconCtrl.clear();
m_pOKBtn.clear();
@@ -503,7 +501,7 @@ void IconChoiceDialog::SetInputSet( const SfxItemSet* pInSet )
if ( !bSet && !pExampleSet && !pOutSet )
{
pExampleSet = new SfxItemSet( *pSet );
- pOutSet = new SfxItemSet( *pSet->GetPool(), pSet->GetRanges() );
+ pOutSet.reset(new SfxItemSet( *pSet->GetPool(), pSet->GetRanges() ));
}
}
@@ -623,7 +621,7 @@ void IconChoiceDialog::Ok()
if ( !pExampleSet && pSet )
pOutSet = pSet->Clone( false ); // without items
else if ( pExampleSet )
- pOutSet = new SfxItemSet( *pExampleSet );
+ pOutSet.reset(new SfxItemSet( *pExampleSet ));
}
for ( size_t i = 0, nCount = maPageList.size(); i < nCount; ++i )
diff --git a/cui/source/inc/iconcdlg.hxx b/cui/source/inc/iconcdlg.hxx
index 759c9a0999b0..f65ebc645c34 100644
--- a/cui/source/inc/iconcdlg.hxx
+++ b/cui/source/inc/iconcdlg.hxx
@@ -111,7 +111,7 @@ private:
VclPtr<VclVBox> m_pTabContainer;
const SfxItemSet* pSet;
- SfxItemSet* pOutSet;
+ std::unique_ptr<SfxItemSet> pOutSet;
SfxItemSet* pExampleSet;
sal_uInt16* pRanges;