summaryrefslogtreecommitdiff
path: root/chart2
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
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')
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx14
-rw-r--r--chart2/source/controller/inc/ItemPropertyMap.hxx35
-rw-r--r--chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx10
-rw-r--r--chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx12
-rw-r--r--chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx13
-rw-r--r--chart2/source/controller/itemsetwrapper/MultipleItemConverter.cxx8
-rw-r--r--chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx13
-rw-r--r--chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx12
-rw-r--r--chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx13
-rw-r--r--chart2/source/controller/main/ChartController_Insert.cxx38
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx6
-rw-r--r--chart2/source/controller/main/CommandDispatch.cxx29
-rw-r--r--chart2/source/inc/DisposeHelper.hxx34
-rw-r--r--chart2/source/tools/InternalDataProvider.cxx4
14 files changed, 77 insertions, 164 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;
diff --git a/chart2/source/controller/inc/ItemPropertyMap.hxx b/chart2/source/controller/inc/ItemPropertyMap.hxx
index d62aa0e59c4b..f2fa063fdeef 100644
--- a/chart2/source/controller/inc/ItemPropertyMap.hxx
+++ b/chart2/source/controller/inc/ItemPropertyMap.hxx
@@ -32,41 +32,6 @@ typedef ::std::map< ItemConverter::tWhichIdType, ::std::pair< ItemConverter::tPr
typedef ::comphelper::MakeMap< ItemConverter::tWhichIdType, ::std::pair< ItemConverter::tPropertyNameType, ItemConverter::tMemberIdType > >
MakeItemPropertyMap;
-class FillItemSetFunc : public ::std::unary_function< ItemConverter *, void >
-{
-public:
- explicit FillItemSetFunc( SfxItemSet & rOutItemSet ) :
- m_rOutItemSet( rOutItemSet )
- {}
-
- void operator() ( ItemConverter * pConv )
- {
- pConv->FillItemSet( m_rOutItemSet );
- }
-
-private:
- SfxItemSet & m_rOutItemSet;
-};
-
-class ApplyItemSetFunc : public ::std::unary_function< ItemConverter *, void >
-{
-public:
- explicit ApplyItemSetFunc( const SfxItemSet & rItemSet,
- bool & rOutResult ) :
- m_rItemSet( rItemSet ),
- m_rOutResult( rOutResult )
- {}
-
- void operator() ( ItemConverter * pConv )
- {
- m_rOutResult = pConv->ApplyItemSet( m_rItemSet ) || m_rOutResult;
- }
-
-private:
- const SfxItemSet & m_rItemSet;
- bool & m_rOutResult;
-};
-
}}
#endif
diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
index b155a46d85f7..59f0b791ccf0 100644
--- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
@@ -30,6 +30,7 @@
#include "CommonConverters.hxx"
#include "ChartTypeHelper.hxx"
#include <unonames.hxx>
+#include <memory>
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
@@ -42,7 +43,6 @@
#include <svx/chrtitem.hxx>
#include <svl/intitem.hxx>
#include <rtl/math.hxx>
-#include <boost/checked_delete.hpp>
#include <algorithm>
@@ -110,12 +110,13 @@ AxisItemConverter::~AxisItemConverter()
delete m_pExplicitScale;
delete m_pExplicitIncrement;
- ::std::for_each(m_aConverters.begin(), m_aConverters.end(), boost::checked_deleter<ItemConverter>());
+ ::std::for_each(m_aConverters.begin(), m_aConverters.end(), std::default_delete<ItemConverter>());
}
void AxisItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const
{
- ::std::for_each( m_aConverters.begin(), m_aConverters.end(), FillItemSetFunc( rOutItemSet ));
+ for( const auto& pConv : m_aConverters )
+ pConv->FillItemSet( rOutItemSet );
// own items
ItemConverter::FillItemSet( rOutItemSet );
@@ -125,7 +126,8 @@ bool AxisItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
{
bool bResult = false;
- ::std::for_each( m_aConverters.begin(), m_aConverters.end(), ApplyItemSetFunc( rItemSet, bResult ));
+ for( const auto& pConv : m_aConverters )
+ bResult = pConv->ApplyItemSet( rItemSet ) || bResult;
// own items
return ItemConverter::ApplyItemSet( rItemSet ) || bResult;
diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index 6f0a74fe3055..d92caaac7848 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -46,10 +46,10 @@
#include <com/sun/star/graphic/XGraphic.hpp>
#include <svx/tabline.hxx>
-#include <boost/checked_delete.hpp>
#include <functional>
#include <algorithm>
+#include <memory>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
@@ -240,13 +240,13 @@ DataPointItemConverter::DataPointItemConverter(
DataPointItemConverter::~DataPointItemConverter()
{
- ::std::for_each(m_aConverters.begin(), m_aConverters.end(), boost::checked_deleter<ItemConverter>());
+ ::std::for_each(m_aConverters.begin(), m_aConverters.end(), std::default_delete<ItemConverter>());
}
void DataPointItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const
{
- ::std::for_each( m_aConverters.begin(), m_aConverters.end(),
- FillItemSetFunc( rOutItemSet ));
+ for( const auto& pConv : m_aConverters )
+ pConv->FillItemSet( rOutItemSet );
// own items
ItemConverter::FillItemSet( rOutItemSet );
@@ -262,8 +262,8 @@ bool DataPointItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
{
bool bResult = false;
- ::std::for_each( m_aConverters.begin(), m_aConverters.end(),
- ApplyItemSetFunc( rItemSet, bResult ));
+ for( const auto& pConv : m_aConverters )
+ bResult = pConv->ApplyItemSet( rItemSet ) || bResult;
// own items
return ItemConverter::ApplyItemSet( rItemSet ) || bResult;
diff --git a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
index 26d3038f9b76..41b65a980bc6 100644
--- a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
@@ -32,8 +32,7 @@
#include <functional>
#include <algorithm>
-
-#include <boost/checked_delete.hpp>
+#include <memory>
using namespace ::com::sun::star;
@@ -61,13 +60,13 @@ LegendItemConverter::LegendItemConverter(
LegendItemConverter::~LegendItemConverter()
{
- ::std::for_each( m_aConverters.begin(), m_aConverters.end(), boost::checked_deleter<ItemConverter>());
+ ::std::for_each( m_aConverters.begin(), m_aConverters.end(), std::default_delete<ItemConverter>());
}
void LegendItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const
{
- ::std::for_each( m_aConverters.begin(), m_aConverters.end(),
- FillItemSetFunc( rOutItemSet ));
+ for( const auto& pConv : m_aConverters )
+ pConv->FillItemSet( rOutItemSet );
// own items
ItemConverter::FillItemSet( rOutItemSet );
@@ -77,8 +76,8 @@ bool LegendItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
{
bool bResult = false;
- ::std::for_each( m_aConverters.begin(), m_aConverters.end(),
- ApplyItemSetFunc( rItemSet, bResult ));
+ for( const auto& pConv : m_aConverters )
+ bResult = pConv->ApplyItemSet( rItemSet ) || bResult;
// own items
return ItemConverter::ApplyItemSet( rItemSet ) || bResult;
diff --git a/chart2/source/controller/itemsetwrapper/MultipleItemConverter.cxx b/chart2/source/controller/itemsetwrapper/MultipleItemConverter.cxx
index fd94ccdb1ffe..32dd551f2987 100644
--- a/chart2/source/controller/itemsetwrapper/MultipleItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/MultipleItemConverter.cxx
@@ -21,7 +21,7 @@
#include "ItemPropertyMap.hxx"
#include <algorithm>
-#include <boost/checked_delete.hpp>
+#include <memory>
using namespace ::com::sun::star;
@@ -33,7 +33,7 @@ MultipleItemConverter::MultipleItemConverter( SfxItemPool& rItemPool )
}
MultipleItemConverter::~MultipleItemConverter()
{
- ::std::for_each( m_aConverters.begin(), m_aConverters.end(), boost::checked_deleter<ItemConverter>());
+ ::std::for_each( m_aConverters.begin(), m_aConverters.end(), std::default_delete<ItemConverter>());
}
void MultipleItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const
@@ -58,8 +58,8 @@ bool MultipleItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
{
bool bResult = false;
- ::std::for_each( m_aConverters.begin(), m_aConverters.end(),
- ApplyItemSetFunc( rItemSet, bResult ));
+ for( const auto& pConv : m_aConverters )
+ bResult = pConv->ApplyItemSet( rItemSet ) || bResult;
// no own items
return bResult;
diff --git a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx
index abfd7527dcda..c5143e5d35de 100644
--- a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx
@@ -31,8 +31,7 @@
#include <functional>
#include <algorithm>
-
-#include <boost/checked_delete.hpp>
+#include <memory>
using namespace ::com::sun::star;
@@ -69,13 +68,13 @@ RegressionEquationItemConverter::RegressionEquationItemConverter(
RegressionEquationItemConverter::~RegressionEquationItemConverter()
{
- ::std::for_each(m_aConverters.begin(), m_aConverters.end(), boost::checked_deleter<ItemConverter>());
+ ::std::for_each(m_aConverters.begin(), m_aConverters.end(), std::default_delete<ItemConverter>());
}
void RegressionEquationItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const
{
- ::std::for_each( m_aConverters.begin(), m_aConverters.end(),
- FillItemSetFunc( rOutItemSet ));
+ for( const auto& pConv : m_aConverters )
+ pConv->FillItemSet( rOutItemSet );
// own items
ItemConverter::FillItemSet( rOutItemSet );
@@ -85,8 +84,8 @@ bool RegressionEquationItemConverter::ApplyItemSet( const SfxItemSet & rItemSet
{
bool bResult = false;
- ::std::for_each( m_aConverters.begin(), m_aConverters.end(),
- ApplyItemSetFunc( rItemSet, bResult ));
+ for( const auto& pConv : m_aConverters )
+ bResult = pConv->ApplyItemSet( rItemSet );
// own items
return ItemConverter::ApplyItemSet( rItemSet ) || bResult;
diff --git a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
index 6ac914bada20..57f755c0451a 100644
--- a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
@@ -34,10 +34,10 @@
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
#include <svx/tabline.hxx>
-#include <boost/checked_delete.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
#include <com/sun/star/chart2/Symbol.hpp>
+#include <memory>
using namespace com::sun::star;
using namespace com::sun::star::chart2;
@@ -212,13 +212,13 @@ TextLabelItemConverter::TextLabelItemConverter(
TextLabelItemConverter::~TextLabelItemConverter()
{
- std::for_each(maConverters.begin(), maConverters.end(), boost::checked_deleter<ItemConverter>());
+ std::for_each(maConverters.begin(), maConverters.end(), std::default_delete<ItemConverter>());
}
void TextLabelItemConverter::FillItemSet( SfxItemSet& rOutItemSet ) const
{
- std::for_each(maConverters.begin(), maConverters.end(),
- FillItemSetFunc(rOutItemSet));
+ for( const auto& pConv : maConverters )
+ pConv->FillItemSet( rOutItemSet );
// own items
ItemConverter::FillItemSet(rOutItemSet);
@@ -228,8 +228,8 @@ bool TextLabelItemConverter::ApplyItemSet( const SfxItemSet& rItemSet )
{
bool bResult = false;
- std::for_each(maConverters.begin(), maConverters.end(),
- ApplyItemSetFunc(rItemSet, bResult));
+ for( const auto& pConv: maConverters )
+ bResult = pConv->ApplyItemSet( rItemSet ) || bResult;
// own items
return ItemConverter::ApplyItemSet(rItemSet) || bResult;
diff --git a/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx
index 8750cd1d5b77..568c37217162 100644
--- a/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx
@@ -31,8 +31,7 @@
#include <functional>
#include <algorithm>
-
-#include <boost/checked_delete.hpp>
+#include <memory>
using namespace ::com::sun::star;
@@ -127,13 +126,13 @@ TitleItemConverter::TitleItemConverter(
TitleItemConverter::~TitleItemConverter()
{
- ::std::for_each(m_aConverters.begin(), m_aConverters.end(), boost::checked_deleter<ItemConverter>());
+ ::std::for_each(m_aConverters.begin(), m_aConverters.end(), std::default_delete<ItemConverter>());
}
void TitleItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const
{
- ::std::for_each( m_aConverters.begin(), m_aConverters.end(),
- FillItemSetFunc( rOutItemSet ));
+ for( const auto& pConv : m_aConverters )
+ pConv->FillItemSet( rOutItemSet );
// own items
ItemConverter::FillItemSet( rOutItemSet );
@@ -143,8 +142,8 @@ bool TitleItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
{
bool bResult = false;
- ::std::for_each( m_aConverters.begin(), m_aConverters.end(),
- ApplyItemSetFunc( rItemSet, bResult ));
+ for( const auto& pConv : m_aConverters )
+ bResult = pConv->ApplyItemSet( rItemSet ) || bResult;
// own items
return ItemConverter::ApplyItemSet( rItemSet ) || bResult;
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index 5fe25b433d8c..5ca647ffee02 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -67,27 +67,18 @@ using ::com::sun::star::uno::Sequence;
namespace
{
-struct lcl_InsertMeanValueLine
-{
-public:
- explicit lcl_InsertMeanValueLine( const uno::Reference< uno::XComponentContext > & xContext ) :
- m_xContext( xContext )
- {}
- void operator()( const uno::Reference< chart2::XDataSeries > & xSeries )
+void lcl_InsertMeanValueLine( const uno::Reference< uno::XComponentContext > & xContext,
+ const uno::Reference< chart2::XDataSeries > & xSeries )
+{
+ uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
+ xSeries, uno::UNO_QUERY );
+ if( xRegCurveCnt.is())
{
- uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
- xSeries, uno::UNO_QUERY );
- if( xRegCurveCnt.is())
- {
- ::chart::RegressionCurveHelper::addMeanValueLine(
- xRegCurveCnt, m_xContext, uno::Reference< beans::XPropertySet >( xSeries, uno::UNO_QUERY ));
- }
+ ::chart::RegressionCurveHelper::addMeanValueLine(
+ xRegCurveCnt, xContext, uno::Reference< beans::XPropertySet >( xSeries, uno::UNO_QUERY ));
}
-
-private:
- uno::Reference< uno::XComponentContext > m_xContext;
-};
+}
} // anonymous namespace
@@ -317,8 +308,9 @@ void ChartController::executeDispatch_InsertMeanValue()
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::INSERT, SCH_RESSTR( STR_OBJECT_AVERAGE_LINE )),
m_xUndoManager );
- lcl_InsertMeanValueLine( m_xCC ).operator()(
- ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getModel() ));
+ lcl_InsertMeanValueLine( m_xCC,
+ ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(),
+ getModel() ) );
aUndoGuard.commit();
}
@@ -334,13 +326,15 @@ void ChartController::executeDispatch_InsertMenu_MeanValues()
if( xSeries.is() )
{
//if a series is selected insert mean value only for that series:
- lcl_InsertMeanValueLine( m_xCC ).operator()(xSeries);
+ lcl_InsertMeanValueLine( m_xCC, xSeries );
}
else
{
::std::vector< uno::Reference< chart2::XDataSeries > > aSeries(
DiagramHelper::getDataSeriesFromDiagram( ChartModelHelper::findDiagram( getModel() )));
- ::std::for_each( aSeries.begin(), aSeries.end(), lcl_InsertMeanValueLine( m_xCC ));
+
+ for( const auto& xSrs : aSeries )
+ lcl_InsertMeanValueLine( m_xCC, xSrs );
}
aUndoGuard.commit();
}
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 2156dabb99f2..2240eae61fbf 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -217,8 +217,10 @@ void ChartController::executeDispatch_NewArrangement()
// regression curve equations
::std::vector< Reference< chart2::XRegressionCurve > > aRegressionCurves(
RegressionCurveHelper::getAllRegressionCurvesNotMeanValueLine( xDiagram ));
- ::std::for_each( aRegressionCurves.begin(), aRegressionCurves.end(),
- RegressionCurveHelper::resetEquationPosition );
+
+ // reset equation position
+ for( const auto& xCurve : aRegressionCurves )
+ RegressionCurveHelper::resetEquationPosition( xCurve );
aUndoGuard.commit();
}
diff --git a/chart2/source/controller/main/CommandDispatch.cxx b/chart2/source/controller/main/CommandDispatch.cxx
index 4886210cce6b..592d8a501a21 100644
--- a/chart2/source/controller/main/CommandDispatch.cxx
+++ b/chart2/source/controller/main/CommandDispatch.cxx
@@ -33,31 +33,18 @@ using ::com::sun::star::uno::Sequence;
namespace
{
template< class Map >
- struct lcl_DisposeAndClearAndDeleteMapElement :
- public ::std::unary_function< typename Map::value_type, void >
- {
- explicit lcl_DisposeAndClearAndDeleteMapElement( const Reference< uno::XInterface > & xEventSource ) :
- m_aEvent( xEventSource )
- {}
- void operator() ( typename Map::value_type & rElement )
- {
- if( rElement.second )
- {
- rElement.second->disposeAndClear( m_aEvent );
- delete rElement.second;
- }
- }
- private:
- lang::EventObject m_aEvent;
- };
-
-template< class Map >
void lcl_DisposeAndClearAndDeleteAllMapElements(
Map & rMap,
const Reference< uno::XInterface > & xEventSource )
{
- ::std::for_each( rMap.begin(), rMap.end(),
- lcl_DisposeAndClearAndDeleteMapElement< Map >( xEventSource ));
+ for( const auto& rElement : rMap )
+ {
+ if( rElement.second )
+ {
+ rElement.second->disposeAndClear( xEventSource );
+ delete rElement.second;
+ }
+ }
}
} // anonymous namespace
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
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index 39fdf185ae6b..b9fe727a5119 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -392,7 +392,9 @@ InternalDataProvider::InternalDataProvider(
// data series
::std::vector< Reference< chart2::XDataSeries > > aSeriesVector( ChartModelHelper::getDataSeries( xChartDoc ));
- ::std::for_each( aSeriesVector.begin(), aSeriesVector.end(), lcl_internalizeSeries( m_aInternalData, *this, bConnectToModel, m_bDataInColumns ) );
+ lcl_internalizeSeries ftor( m_aInternalData, *this, bConnectToModel, m_bDataInColumns );
+ for( const auto& rxScreen : aSeriesVector )
+ ftor( rxScreen );
}
}
catch( const uno::Exception & ex )