diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-09-23 19:15:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-24 10:50:23 +0200 |
commit | 5c30291e8672cbdd3e61f3c6b18444da2d959024 (patch) | |
tree | 0ea47608c29af20b77ee791f28178baa061aec5a /chart2/source | |
parent | abc0b90d7fe05c00e17251f3215b1f007813edb4 (diff) |
no need to allocate this SfxItemSet on the heap
Change-Id: I4bca43340ab530b8d12b91968a7e7184b894776d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122552
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source')
3 files changed, 10 insertions, 10 deletions
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx index 56e9c4611f24..2897313ceff1 100644 --- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx +++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx @@ -308,10 +308,10 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel const sal_uInt16 nNoArrowNoShadowDlg = 1101; -void SchAttribTabDlg::setSymbolInformation( std::unique_ptr<SfxItemSet> pSymbolShapeProperties, +void SchAttribTabDlg::setSymbolInformation( SfxItemSet&& rSymbolShapeProperties, std::unique_ptr<Graphic> pAutoSymbolGraphic ) { - m_pSymbolShapeProperties = std::move(pSymbolShapeProperties); + m_oSymbolShapeProperties.emplace(std::move(rSymbolShapeProperties)); m_pAutoSymbolGraphic = std::move(pAutoSymbolGraphic); } @@ -495,8 +495,8 @@ void SchAttribTabDlg::PageCreated(const OString& rId, SfxTabPage &rPage) if( m_pParameter->HasSymbolProperties() ) { aSet.Put(OfaPtrItem(SID_OBJECT_LIST,m_pViewElementListProvider->GetSymbolList())); - if( m_pSymbolShapeProperties ) - aSet.Put(SfxTabDialogItem(SID_ATTR_SET,*m_pSymbolShapeProperties)); + if( m_oSymbolShapeProperties ) + aSet.Put(SfxTabDialogItem(SID_ATTR_SET, *m_oSymbolShapeProperties)); if( m_pAutoSymbolGraphic ) aSet.Put(SvxGraphicItem(*m_pAutoSymbolGraphic)); } diff --git a/chart2/source/controller/inc/dlg_ObjectProperties.hxx b/chart2/source/controller/inc/dlg_ObjectProperties.hxx index 3a7e87fbe6dc..deb096dcdc95 100644 --- a/chart2/source/controller/inc/dlg_ObjectProperties.hxx +++ b/chart2/source/controller/inc/dlg_ObjectProperties.hxx @@ -114,7 +114,7 @@ private: const ViewElementListProvider* const m_pViewElementListProvider; SvNumberFormatter* m_pNumberFormatter; - std::unique_ptr<SfxItemSet> m_pSymbolShapeProperties; + std::optional<SfxItemSet> m_oSymbolShapeProperties; std::unique_ptr<Graphic> m_pAutoSymbolGraphic; double m_fAxisMinorStepWidthForErrorBarDecimals; @@ -133,7 +133,7 @@ public: //pSymbolShapeProperties: Properties to be set on the symbollist shapes //pAutoSymbolGraphic: Graphic to be shown if AutoSymbol gets selected - void setSymbolInformation( std::unique_ptr<SfxItemSet> pSymbolShapeProperties, std::unique_ptr<Graphic> pAutoSymbolGraphic ); + void setSymbolInformation( SfxItemSet&& rSymbolShapeProperties, std::unique_ptr<Graphic> pAutoSymbolGraphic ); void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth ); diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx index 57eadfb63ca9..965df27134f6 100644 --- a/chart2/source/controller/main/ChartController_Properties.cxx +++ b/chart2/source/controller/main/ChartController_Properties.cxx @@ -769,13 +769,13 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard( , uno::Reference< lang::XMultiServiceFactory >( getModel(), uno::UNO_QUERY ) , wrapper::GraphicObjectType::FilledDataPoint ); - std::unique_ptr<SfxItemSet> pSymbolShapeProperties(new SfxItemSet( aSymbolItemConverter.CreateEmptyItemSet() )); - aSymbolItemConverter.FillItemSet( *pSymbolShapeProperties ); + SfxItemSet aSymbolShapeProperties(aSymbolItemConverter.CreateEmptyItemSet() ); + aSymbolItemConverter.FillItemSet( aSymbolShapeProperties ); sal_Int32 const nStandardSymbol=0;//@todo get from somewhere - std::unique_ptr<Graphic> pAutoSymbolGraphic(new Graphic( aViewElementListProvider.GetSymbolGraphic( nStandardSymbol, pSymbolShapeProperties.get() ) )); + std::unique_ptr<Graphic> pAutoSymbolGraphic(new Graphic( aViewElementListProvider.GetSymbolGraphic( nStandardSymbol, &aSymbolShapeProperties ) )); // note: the dialog takes the ownership of pSymbolShapeProperties and pAutoSymbolGraphic - aDlg.setSymbolInformation( std::move(pSymbolShapeProperties), std::move(pAutoSymbolGraphic) ); + aDlg.setSymbolInformation( std::move(aSymbolShapeProperties), std::move(pAutoSymbolGraphic) ); } if( aDialogParameter.HasStatisticProperties() ) { |