diff options
author | Mario J. Rugiero <mrugiero@gmail.com> | 2015-10-30 00:26:23 -0300 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-30 06:04:59 +0000 |
commit | f53343320101bfe650f5fe2cdf95f94995778037 (patch) | |
tree | 93cb0269c225e6d74b3bca94f754ac0cbfa46200 /xmloff/source/chart | |
parent | 26d5407a5f653e55ec9255117760886bcec4fe15 (diff) |
xmloff tree cleanup
- Replaces for_each(*.begin(), *.end(), ...) by its range based for loop equivalents.
- Replaces boost::bind calls by C++11 lambdas.
- Cleans a few hacks made to workaround boost::bind limitations.
Change-Id: Ie88cc651a2a835b03d5037e54e2a61ca93866310
Reviewed-on: https://gerrit.libreoffice.org/19678
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'xmloff/source/chart')
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 568e3e938c74..ed226f5d0e69 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -713,18 +713,6 @@ struct lcl_TableData ::std::vector< sal_Int32 > aHiddenColumns; }; -// ::std::bind2nd( ::std::mem_fun_ref( &T::resize ), nSize ) does not work -template< class T > - struct lcl_resize - { - lcl_resize( typename T::size_type nSize, typename T::value_type fDefaultValue ) : m_nSize( nSize ), m_fDefaultValue( fDefaultValue ) {} - void operator()( T & t ) - { t.resize( m_nSize, m_fDefaultValue ); } - private: - typename T::size_type m_nSize; - typename T::value_type m_fDefaultValue; - }; - typedef ::std::map< sal_Int32, SchXMLExportHelper_Impl::tLabelValuesDataPair > lcl_DataSequenceMap; @@ -818,8 +806,9 @@ lcl_TableData lcl_getDataForLocalTable( aResult.aDataInRows.resize( nNumRows ); double fNan = 0.0; ::rtl::math::setNan( &fNan ); - ::std::for_each( aResult.aDataInRows.begin(), aResult.aDataInRows.end(), - lcl_resize< t2DNumberContainer::value_type >( nNumColumns, fNan )); + + for (auto& aData: aResult.aDataInRows) + aData.resize(nNumColumns, fNan); aResult.aColumnDescriptions.resize( nNumColumns ); aResult.aComplexColumnDescriptions.realloc( nNumColumns ); aResult.aRowDescriptions.resize( nNumRows ); |