summaryrefslogtreecommitdiff
path: root/cui/source/options/optchart.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-11 15:14:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-20 09:47:32 +0200
commit4ab105d14148932f6d848b56678e942c50631964 (patch)
tree68789cfcafd1320b90725856b98082fa25e13175 /cui/source/options/optchart.cxx
parent6a99ac6ad5afa0f3c127c1ef2f36ed3f09ebaf17 (diff)
loplugin:useuniqueptr in SvxDefaultColorOptPage
Change-Id: I398ba3828bddf295e99624d7caa8d636e96c360c Reviewed-on: https://gerrit.libreoffice.org/56100 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source/options/optchart.cxx')
-rw-r--r--cui/source/options/optchart.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx
index d9c92433c006..02676c9d63f7 100644
--- a/cui/source/options/optchart.cxx
+++ b/cui/source/options/optchart.cxx
@@ -135,20 +135,20 @@ SvxDefaultColorOptPage::SvxDefaultColorOptPage(vcl::Window* pParent, const SfxIt
m_pValSetColorBox->SetExtraSpacing( 0 );
m_pValSetColorBox->Show();
- pChartOptions = new SvxChartOptions;
+ pChartOptions.reset(new SvxChartOptions);
pColorList = XColorList::CreateStdColorList();
const SfxPoolItem* pItem = nullptr;
if ( rInAttrs.GetItemState( SID_SCH_EDITOPTIONS, false, &pItem ) == SfxItemState::SET )
{
- pColorConfig = static_cast< SvxChartColorTableItem* >(pItem->Clone());
+ pColorConfig.reset(static_cast< SvxChartColorTableItem* >(pItem->Clone()));
}
else
{
SvxChartColorTable aTable;
aTable.useDefault();
- pColorConfig = new SvxChartColorTableItem( SID_SCH_EDITOPTIONS, aTable );
- pColorConfig->SetOptions( pChartOptions );
+ pColorConfig.reset(new SvxChartColorTableItem( SID_SCH_EDITOPTIONS, aTable ));
+ pColorConfig->SetOptions( pChartOptions.get() );
}
Construct();
@@ -167,10 +167,8 @@ void SvxDefaultColorOptPage::dispose()
pChartOptions->SetDefaultColors( pColorConfig->GetColorList() );
pChartOptions->Commit();
- delete pColorConfig;
- pColorConfig = nullptr;
- delete pChartOptions;
- pChartOptions = nullptr;
+ pColorConfig.reset();
+ pChartOptions.reset();
}
m_pLbChartColors.clear();
m_pValSetColorBox.clear();
@@ -198,7 +196,7 @@ VclPtr<SfxTabPage> SvxDefaultColorOptPage::Create( TabPageParent pParent, const
bool SvxDefaultColorOptPage::FillItemSet( SfxItemSet* rOutAttrs )
{
if( pColorConfig )
- rOutAttrs->Put( *static_cast< SfxPoolItem* >(pColorConfig) );
+ rOutAttrs->Put( *pColorConfig );
return true;
}