diff options
author | Daniel Robertson <danlrobertson89@gmail.com> | 2015-09-27 19:21:35 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-10-08 09:06:46 +0000 |
commit | 391f181c9f82fec1988ce2c364c7afd1b0f49719 (patch) | |
tree | 0bc55266bc35ddabf8bd29d658e0b8d2b81683a4 /chart2/source/controller/dialogs/DataBrowser.cxx | |
parent | 1d0839fb98b8ec672e22b21867297317c8a961ee (diff) |
chart2: replace for_each with range-based for
Replace complex uses of ::std::for_each with a range-based for-loop.
Change-Id: I6f3d8488a63a5bed271ab70ad6f024e9869906cc
Reviewed-on: https://gerrit.libreoffice.org/19143
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'chart2/source/controller/dialogs/DataBrowser.cxx')
-rw-r--r-- | chart2/source/controller/dialogs/DataBrowser.cxx | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index d318371ab7f7..d62e13dba099 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -401,14 +401,6 @@ Image SeriesHeader::GetChartTypeImage( return aResult; } -struct applyChangesFunctor : public ::std::unary_function< std::shared_ptr< SeriesHeader >, void > -{ - void operator() ( std::shared_ptr< SeriesHeader > spHeader ) - { - spHeader->applyChanges(); - } -}; - } // namespace impl namespace @@ -541,7 +533,8 @@ bool DataBrowser::MaySwapColumns() const void DataBrowser::clearHeaders() { - ::std::for_each( m_aSeriesHeaders.begin(), m_aSeriesHeaders.end(), impl::applyChangesFunctor()); + for( const auto& spHeader : m_aSeriesHeaders ) + spHeader->applyChanges(); m_aSeriesHeaders.clear(); } @@ -1183,7 +1176,8 @@ bool DataBrowser::EndEditing() SaveModified(); // apply changes made to series headers - ::std::for_each( m_aSeriesHeaders.begin(), m_aSeriesHeaders.end(), impl::applyChangesFunctor()); + for( const auto& spHeader : m_aSeriesHeaders ) + spHeader->applyChanges(); if( m_bDataValid ) return true; |