diff options
Diffstat (limited to 'cui/source/options/optchart.cxx')
-rw-r--r-- | cui/source/options/optchart.cxx | 16 |
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; } |