diff options
author | Michael Stahl <mstahl@redhat.com> | 2018-01-19 21:09:30 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2018-01-22 09:34:48 +0100 |
commit | d68df7842d5d30ac63eb0b1b127a62386c32a120 (patch) | |
tree | c90cc8208ecc432bcf9bdaa74ca3902b590fafc2 | |
parent | 67c11b0398cc12b9cfe81566eb0e158446411333 (diff) |
chart2: std::iterator is deprecated in C++17
And it's immediately obvious why, if you look at the elegant and concise
replacement code that doesn't trigger deprecation warnings.
Change-Id: Ie4b3ca83951a89f7ac4d172086c23c7457087ba3
Reviewed-on: https://gerrit.libreoffice.org/48223
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | chart2/source/controller/dialogs/DialogModel.cxx | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx index bea059e0b26c..86beb8eb7a11 100644 --- a/chart2/source/controller/dialogs/DialogModel.cxx +++ b/chart2/source/controller/dialogs/DialogModel.cxx @@ -126,9 +126,9 @@ void lcl_createRoleIndexMap( lcl_tRoleIndexMap & rOutMap ) rOutMap[ "values-size" ] = ++nIndex; } -struct lcl_DataSeriesContainerAppend : public - std::iterator< std::output_iterator_tag, Reference< XDataSeriesContainer > > +struct lcl_DataSeriesContainerAppend { + typedef Reference< XDataSeriesContainer > value_type; typedef std::vector< ::chart::DialogModel::tSeriesWithChartTypeByName > tContainerType; explicit lcl_DataSeriesContainerAppend( tContainerType * rCnt ) @@ -174,9 +174,9 @@ private: tContainerType * m_rDestCnt; }; -struct lcl_RolesWithRangeAppend : public - std::iterator< std::output_iterator_tag, Reference< data::XLabeledDataSequence > > +struct lcl_RolesWithRangeAppend { + typedef Reference< data::XLabeledDataSequence > value_type; typedef ::chart::DialogModel::tRolesWithRanges tContainerType; explicit lcl_RolesWithRangeAppend( tContainerType * rCnt, @@ -234,6 +234,25 @@ private: OUString m_aRoleForLabelSeq; }; +} + +namespace std +{ + template<> struct iterator_traits<lcl_DataSeriesContainerAppend> + { + typedef std::output_iterator_tag iterator_category; + typedef Reference< XDataSeriesContainer > value_type; + }; + + template<> struct iterator_traits<lcl_RolesWithRangeAppend> + { + typedef std::output_iterator_tag iterator_category; + typedef Reference< data::XLabeledDataSequence > value_type; + }; +} + +namespace { + void lcl_SetSequenceRole( const Reference< data::XDataSequence > & xSeq, const OUString & rRole ) |