summaryrefslogtreecommitdiff
path: root/chart2/source/inc
diff options
context:
space:
mode:
authorDaniel Robertson <danlrobertson89@gmail.com>2015-09-27 19:21:35 -0400
committerJan Holesovsky <kendy@collabora.com>2015-10-08 09:06:46 +0000
commit391f181c9f82fec1988ce2c364c7afd1b0f49719 (patch)
tree0bc55266bc35ddabf8bd29d658e0b8d2b81683a4 /chart2/source/inc
parent1d0839fb98b8ec672e22b21867297317c8a961ee (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/inc')
-rw-r--r--chart2/source/inc/DisposeHelper.hxx34
1 files changed, 2 insertions, 32 deletions
diff --git a/chart2/source/inc/DisposeHelper.hxx b/chart2/source/inc/DisposeHelper.hxx
index 44b54edc7508..a2f1bba814af 100644
--- a/chart2/source/inc/DisposeHelper.hxx
+++ b/chart2/source/inc/DisposeHelper.hxx
@@ -22,10 +22,6 @@
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/lang/XComponent.hpp>
-#include <functional>
-#include <algorithm>
-#include <utility>
-
namespace chart
{
namespace DisposeHelper
@@ -47,37 +43,11 @@ template< class Intf >
rIntf.set( 0 );
}
-template< class T >
- struct DisposeFunctor : public ::std::unary_function< T, void >
-{
- void operator() ( const T & xIntf )
- {
- Dispose< T >( xIntf );
- }
-};
-
-template< typename T >
- struct DisposeFirstOfPairFunctor : public ::std::unary_function< T, void >
-{
- void operator() ( const T & rElem )
- {
- Dispose< typename T::first_type >( rElem.first );
- }
-};
-
-template< typename T >
- struct DisposeSecondOfPairFunctor : public ::std::unary_function< T, void >
-{
- void operator() ( const T & rElem )
- {
- Dispose< typename T::second_type >( rElem.second );
- }
-};
-
template< class Container >
void DisposeAllElements( Container & rContainer )
{
- ::std::for_each( rContainer.begin(), rContainer.end(), DisposeFunctor< typename Container::value_type >());
+ for( const auto& rElem : rContainer )
+ Dispose< typename Container::value_type >( rElem );
}
} // namespace DisposeHelper