chart2/source/view/inc/VDataSeries.hxx | 4 ++-- chart2/source/view/main/VDataSeries.cxx | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-)
New commits: commit 23f8c4786681c120022fb726f03ec248517136f4 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Fri Dec 15 20:42:04 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Dec 16 10:44:56 2023 +0100 unique_ptr to optional in chart2 Change-Id: Ia61bbedc8a96ac7525eb24997f99546ed26e377c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160835 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx index 0ab4fffe0e93..65f7247bc197 100644 --- a/chart2/source/view/inc/VDataSeries.hxx +++ b/chart2/source/view/inc/VDataSeries.hxx @@ -246,8 +246,8 @@ private: //member mutable std::optional<css::chart2::DataPointLabel> m_oLabel_AttributedPoint; - mutable std::unique_ptr<tNameSequence> m_apLabelPropNames_AttributedPoint; - mutable std::unique_ptr<tAnySequence> m_apLabelPropValues_AttributedPoint; + mutable std::optional<tNameSequence> m_oLabelPropNames_AttributedPoint; + mutable std::optional<tAnySequence> m_oLabelPropValues_AttributedPoint; mutable std::optional<css::chart2::Symbol> m_oSymbolProperties_AttributedPoint; mutable std::optional<css::chart2::Symbol> m_oSymbolProperties_InvisibleSymbolForSelection; mutable sal_Int32 m_nCurrentAttributedPoint; diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index abfc7766d762..845e6d6ef0db 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -933,8 +933,8 @@ void VDataSeries::adaptPointCache( sal_Int32 nNewPointIndex ) const if( m_nCurrentAttributedPoint != nNewPointIndex ) { m_oLabel_AttributedPoint.reset(); - m_apLabelPropNames_AttributedPoint.reset(); - m_apLabelPropValues_AttributedPoint.reset(); + m_oLabelPropNames_AttributedPoint.reset(); + m_oLabelPropValues_AttributedPoint.reset(); m_oSymbolProperties_AttributedPoint.reset(); m_nCurrentAttributedPoint = nNewPointIndex; } @@ -987,18 +987,18 @@ bool VDataSeries::getTextLabelMultiPropertyLists( sal_Int32 index if( isAttributedDataPoint( index ) ) { adaptPointCache( index ); - if (!m_apLabelPropValues_AttributedPoint) + if (!m_oLabelPropValues_AttributedPoint) { // Cache these properties for this point. - m_apLabelPropNames_AttributedPoint.reset(new tNameSequence); - m_apLabelPropValues_AttributedPoint.reset(new tAnySequence); + m_oLabelPropNames_AttributedPoint.emplace(); + m_oLabelPropValues_AttributedPoint.emplace(); xTextProp.set( getPropertiesOfPoint( index )); PropertyMapper::getTextLabelMultiPropertyLists( - xTextProp, *m_apLabelPropNames_AttributedPoint, *m_apLabelPropValues_AttributedPoint); + xTextProp, *m_oLabelPropNames_AttributedPoint, *m_oLabelPropValues_AttributedPoint); bDoDynamicFontResize = true; } - pPropNames = m_apLabelPropNames_AttributedPoint.get(); - pPropValues = m_apLabelPropValues_AttributedPoint.get(); + pPropNames = &*m_oLabelPropNames_AttributedPoint; + pPropValues = &*m_oLabelPropValues_AttributedPoint; } else {