[Libreoffice-commits] core.git: 2 commits - chart2/inc chart2/Library_chartcore.mk chart2/source include/o3tl sc/inc sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Mon May 12 10:47:24 PDT 2014


 chart2/Library_chartcore.mk                 |    1 
 chart2/inc/ChartView.hxx                    |    2 
 chart2/source/view/inc/GL3DBarChart.hxx     |   10 +--
 chart2/source/view/inc/GL3DPlotterBase.hxx  |   28 ++++++++
 chart2/source/view/main/ChartView.cxx       |   91 ++++++++++++++--------------
 chart2/source/view/main/GL3DPlotterBase.cxx |   18 +++++
 include/o3tl/deleter.hxx                    |   34 ++++++++++
 sc/inc/stlalgorithm.hxx                     |   13 ----
 sc/source/core/data/column.cxx              |    3 
 sc/source/core/data/columnspanset.cxx       |    4 -
 sc/source/core/data/document.cxx            |    4 -
 sc/source/core/data/dptabres.cxx            |    6 -
 sc/source/core/data/table3.cxx              |    4 -
 sc/source/core/tool/chartlis.cxx            |    7 +-
 sc/source/core/tool/rangelst.cxx            |    6 -
 sc/source/filter/xcl97/xcl97rec.cxx         |    4 -
 sc/source/ui/unoobj/chart2uno.cxx           |    4 -
 sc/source/ui/view/viewdata.cxx              |    4 -
 18 files changed, 162 insertions(+), 81 deletions(-)

New commits:
commit ef69c15bb98683ca6a70ad2f0b92fec54f7a23e0
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon May 12 13:44:20 2014 -0400

    Have ChartView keep the instance of GL3D chart object between rendering.
    
    Change-Id: I49419d20bf283fba1c31d8516972b0ca7fddcb5b

diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk
index e4e1fee..97245ca 100644
--- a/chart2/Library_chartcore.mk
+++ b/chart2/Library_chartcore.mk
@@ -103,6 +103,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\
     chart2/source/view/main/Clipping \
     chart2/source/view/main/DataPointSymbolSupplier \
     chart2/source/view/main/DrawModelWrapper \
+    chart2/source/view/main/GL3DPlotterBase \
     chart2/source/view/main/GL3DRenderer \
     chart2/source/view/main/LabelPositionHelper \
     chart2/source/view/main/Linear3DTransformation \
diff --git a/chart2/inc/ChartView.hxx b/chart2/inc/ChartView.hxx
index 0ba3bf8..69f1eed 100644
--- a/chart2/inc/ChartView.hxx
+++ b/chart2/inc/ChartView.hxx
@@ -54,6 +54,7 @@ class VCoordinateSystem;
 class DrawModelWrapper;
 class SeriesPlotterContainer;
 class VDataSeries;
+class GL3DPlotterBase;
 
 enum TimeBasedMode
 {
@@ -271,6 +272,7 @@ private: //member
 
     ::com::sun::star::awt::Rectangle m_aResultingDiagramRectangleExcludingAxes;
 
+    boost::shared_ptr<GL3DPlotterBase> m_pGL3DPlotter;
     TimeBasedInfo maTimeBased;
     osl::Mutex maTimeMutex;
 };
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index 86115de..7a1733e 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -10,6 +10,8 @@
 #ifndef CHART2_GL3DBARCHART_HXX
 #define CHART2_GL3DBARCHART_HXX
 
+#include <GL3DPlotterBase.hxx>
+
 #include <vector>
 #include <boost/ptr_container/ptr_vector.hpp>
 #include "VDataSeries.hxx"
@@ -27,7 +29,7 @@ class OpenGL3DRenderer;
 
 }
 
-class GL3DBarChart
+class GL3DBarChart : public GL3DPlotterBase
 {
 public:
     GL3DBarChart(
@@ -35,11 +37,11 @@ public:
         const boost::ptr_vector<VDataSeries>& rDataSeries, OpenGLWindow& rContext,
         ExplicitCategoriesProvider& rCatProvider );
 
-    ~GL3DBarChart();
+    virtual ~GL3DBarChart();
 
-    void create3DShapes();
+    virtual void create3DShapes() SAL_OVERRIDE;
 
-    void render();
+    virtual void render() SAL_OVERRIDE;
 
 private:
     css::uno::Reference<css::chart2::XChartType> mxChartType;
diff --git a/chart2/source/view/inc/GL3DPlotterBase.hxx b/chart2/source/view/inc/GL3DPlotterBase.hxx
new file mode 100644
index 0000000..9c89008
--- /dev/null
+++ b/chart2/source/view/inc/GL3DPlotterBase.hxx
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef CHART2_GL3DPLOTTERBASE_HXX
+#define CHART2_GL3DPLOTTERBASE_HXX
+
+namespace chart {
+
+class GL3DPlotterBase
+{
+public:
+    virtual ~GL3DPlotterBase();
+
+    virtual void create3DShapes() = 0;
+    virtual void render() = 0;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 13f4bf7..49c3202 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -2461,11 +2461,12 @@ void ChartView::createShapes()
     }
     else
     {
+        m_pGL3DPlotter.reset();
+
         // hide OpenGL window for now in normal charts
         OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow();
         if(pWindow)
             pWindow->Show(false);
-
     }
 #endif
 
@@ -3114,61 +3115,65 @@ IMPL_LINK_NOARG(ChartView, UpdateTimeBased)
 
 void ChartView::createShapes3D()
 {
-    uno::Reference< XDiagram > xDiagram( mrChartModel.getFirstDiagram() );
-    uno::Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY );
-    if( !xCooSysContainer.is())
-        return;
+    if (!m_pGL3DPlotter)
+    {
+        uno::Reference< XDiagram > xDiagram( mrChartModel.getFirstDiagram() );
+        uno::Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY );
+        if( !xCooSysContainer.is())
+            return;
 
-    uno::Sequence< uno::Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() );
-    boost::ptr_vector<VDataSeries> aDataSeries;
+        uno::Sequence< uno::Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() );
+        boost::ptr_vector<VDataSeries> aDataSeries;
 
-    if (aCooSysList.getLength() != 1)
-        // Supporting multiple coordinates in a truly 3D chart (which implies
-        // it's a Cartesian coordinate system) is a bit of a challenge, if not
-        // impossible.
-        return;
+        if (aCooSysList.getLength() != 1)
+            // Supporting multiple coordinates in a truly 3D chart (which implies
+            // it's a Cartesian coordinate system) is a bit of a challenge, if not
+            // impossible.
+            return;
 
-    uno::Reference<XCoordinateSystem> xCooSys( aCooSysList[0] );
+        uno::Reference<XCoordinateSystem> xCooSys( aCooSysList[0] );
 
-    //iterate through all chart types in the current coordinate system
-    uno::Reference< XChartTypeContainer > xChartTypeContainer( xCooSys, uno::UNO_QUERY );
-    OSL_ASSERT( xChartTypeContainer.is());
-    if( !xChartTypeContainer.is() )
-        return;
+        //iterate through all chart types in the current coordinate system
+        uno::Reference< XChartTypeContainer > xChartTypeContainer( xCooSys, uno::UNO_QUERY );
+        OSL_ASSERT( xChartTypeContainer.is());
+        if( !xChartTypeContainer.is() )
+            return;
 
-    uno::Sequence< uno::Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() );
-    if (aChartTypeList.getLength() != 1)
-        // Likewise, we can't really support multiple chart types here.
-        return;
+        uno::Sequence< uno::Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() );
+        if (aChartTypeList.getLength() != 1)
+            // Likewise, we can't really support multiple chart types here.
+            return;
 
-    uno::Reference< XChartType > xChartType( aChartTypeList[0] );
+        uno::Reference< XChartType > xChartType( aChartTypeList[0] );
 
-    uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
-    OSL_ASSERT( xDataSeriesContainer.is());
-    if( !xDataSeriesContainer.is() )
-        return;
+        uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
+        OSL_ASSERT( xDataSeriesContainer.is());
+        if( !xDataSeriesContainer.is() )
+            return;
 
-    uno::Sequence< uno::Reference< XDataSeries > > aSeriesList( xDataSeriesContainer->getDataSeries() );
-    for( sal_Int32 nS = 0; nS < aSeriesList.getLength(); ++nS )
-    {
-        uno::Reference< XDataSeries > xDataSeries( aSeriesList[nS], uno::UNO_QUERY );
-        if(!xDataSeries.is())
-            continue;
+        uno::Sequence< uno::Reference< XDataSeries > > aSeriesList( xDataSeriesContainer->getDataSeries() );
+        for( sal_Int32 nS = 0; nS < aSeriesList.getLength(); ++nS )
+        {
+            uno::Reference< XDataSeries > xDataSeries( aSeriesList[nS], uno::UNO_QUERY );
+            if(!xDataSeries.is())
+                continue;
 
-        aDataSeries.push_back(new VDataSeries(xDataSeries));
-    }
+            aDataSeries.push_back(new VDataSeries(xDataSeries));
+        }
 
-    OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow();
-    if(!pWindow)
-        return;
+        OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow();
+        if(!pWindow)
+            return;
 
-    boost::scoped_ptr<ExplicitCategoriesProvider> pCatProvider(new ExplicitCategoriesProvider(xCooSys, mrChartModel));
+        boost::scoped_ptr<ExplicitCategoriesProvider> pCatProvider(new ExplicitCategoriesProvider(xCooSys, mrChartModel));
 
-    pWindow->Show();
+        pWindow->Show();
+
+        m_pGL3DPlotter.reset(new GL3DBarChart(xChartType, aDataSeries, *pWindow, *pCatProvider));
+        m_pGL3DPlotter->create3DShapes();
+    }
 
-    GL3DBarChart aBarChart(xChartType, aDataSeries, *pWindow, *pCatProvider);
-    aBarChart.create3DShapes();
-    aBarChart.render();
+    m_pGL3DPlotter->render();
 }
 
 } //namespace chart
diff --git a/chart2/source/view/main/GL3DPlotterBase.cxx b/chart2/source/view/main/GL3DPlotterBase.cxx
new file mode 100644
index 0000000..e342b68
--- /dev/null
+++ b/chart2/source/view/main/GL3DPlotterBase.cxx
@@ -0,0 +1,18 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <GL3DPlotterBase.hxx>
+
+namespace chart {
+
+GL3DPlotterBase::~GL3DPlotterBase() {}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit e2f94a8e2cf1761f5e2b0ae166f6a8bd73e0a15d
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon May 12 10:50:16 2014 -0400

    Move this function object to o3tl.
    
    Change-Id: I9d1710fbed3c5753e84ed343c5136ab87909624d

diff --git a/include/o3tl/deleter.hxx b/include/o3tl/deleter.hxx
new file mode 100644
index 0000000..7f9e50d
--- /dev/null
+++ b/include/o3tl/deleter.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_O3TL_DELETER_HXX
+#define INCLUDED_O3TL_DELETER_HXX
+
+#include <functional>
+
+namespace o3tl {
+
+/**
+ * Function object to allow deleting instances stored in STL containers as
+ * pointers.
+ */
+template<typename T>
+struct default_deleter : public std::unary_function<T*, void>
+{
+    void operator() (T* p)
+    {
+        delete p;
+    }
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/stlalgorithm.hxx b/sc/inc/stlalgorithm.hxx
index d7b4d51..3c70144 100644
--- a/sc/inc/stlalgorithm.hxx
+++ b/sc/inc/stlalgorithm.hxx
@@ -15,19 +15,6 @@
 
 #include <rtl/alloc.h>
 
-/**
- * Function object to allow deleting instances stored in STL containers as
- * pointers.
- */
-template<typename T>
-struct ScDeleteObjectByPtr : public ::std::unary_function<T*, void>
-{
-    void operator() (T* p)
-    {
-        delete p;
-    }
-};
-
 namespace sc {
 
 /**
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 443d8fd..4a25df7 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -51,6 +51,7 @@
 #include <svl/sharedstringpool.hxx>
 #include <editeng/scripttypeitem.hxx>
 #include <editeng/fieldupdater.hxx>
+#include <o3tl/deleter.hxx>
 
 #include <cstring>
 #include <map>
@@ -2227,7 +2228,7 @@ class UpdateRefOnNonCopy : std::unary_function<sc::FormulaGroupEntry, void>
 
         if (!mpUndoDoc->SetFormulaCells(rOldPos, aCells))
             // Insertion failed.  Delete all formula cells.
-            std::for_each(aCells.begin(), aCells.end(), ScDeleteObjectByPtr<ScFormulaCell>());
+            std::for_each(aCells.begin(), aCells.end(), o3tl::default_deleter<ScFormulaCell>());
     }
 
 public:
diff --git a/sc/source/core/data/columnspanset.cxx b/sc/source/core/data/columnspanset.cxx
index b06f9f7..8cef966 100644
--- a/sc/source/core/data/columnspanset.cxx
+++ b/sc/source/core/data/columnspanset.cxx
@@ -8,7 +8,6 @@
  */
 
 #include "columnspanset.hxx"
-#include "stlalgorithm.hxx"
 #include "column.hxx"
 #include "table.hxx"
 #include "document.hxx"
@@ -16,6 +15,7 @@
 #include "markdata.hxx"
 #include "rangelst.hxx"
 #include <fstalgorithm.hxx>
+#include <o3tl/deleter.hxx>
 
 #include <algorithm>
 
@@ -67,7 +67,7 @@ ColumnSpanSet::~ColumnSpanSet()
         if (!pTab)
             continue;
 
-        std::for_each(pTab->begin(), pTab->end(), ScDeleteObjectByPtr<ColumnType>());
+        std::for_each(pTab->begin(), pTab->end(), o3tl::default_deleter<ColumnType>());
         delete pTab;
     }
 }
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index d0db4bd..02a1bbb 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -84,7 +84,6 @@
 #include "externalrefmgr.hxx"
 #include "tabprotection.hxx"
 #include "clipparam.hxx"
-#include "stlalgorithm.hxx"
 #include "defaultsoptions.hxx"
 #include "editutil.hxx"
 #include "stringutil.hxx"
@@ -99,6 +98,7 @@
 #include <tokenstringcontext.hxx>
 
 #include <formula/vectortoken.hxx>
+#include <o3tl/deleter.hxx>
 
 #include <map>
 #include <limits>
@@ -785,7 +785,7 @@ bool ScDocument::DeleteTabs( SCTAB nTab, SCTAB nSheets )
 
                 TableContainer::iterator it = maTabs.begin() + nTab;
                 TableContainer::iterator itEnd = it + nSheets;
-                std::for_each(it, itEnd, ScDeleteObjectByPtr<ScTable>());
+                std::for_each(it, itEnd, o3tl::default_deleter<ScTable>());
                 maTabs.erase(it, itEnd);
                 // UpdateBroadcastAreas must be called between UpdateDeleteTab,
                 // which ends listening, and StartAllListeners, to not modify
diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index 792ebb4..542cf54 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -27,13 +27,13 @@
 #include "dpitemdata.hxx"
 
 #include "document.hxx"
-#include "stlalgorithm.hxx"
 #include "dpresfilter.hxx"
 #include "dputil.hxx"
 
 #include <osl/diagnose.h>
 #include <rtl/math.hxx>
 #include <rtl/strbuf.hxx>
+#include <o3tl/deleter.hxx>
 
 #include <math.h>
 #include <float.h>
@@ -757,7 +757,7 @@ ScDPResultData::ScDPResultData( ScDPSource& rSrc ) :
 
 ScDPResultData::~ScDPResultData()
 {
-    std::for_each(maDimMembers.begin(), maDimMembers.end(), ScDeleteObjectByPtr<ResultMembers>());
+    std::for_each(maDimMembers.begin(), maDimMembers.end(), o3tl::default_deleter<ResultMembers>());
 }
 
 void ScDPResultData::SetMeasureData(
@@ -3550,7 +3550,7 @@ ScDPDataDimension::ScDPDataDimension( const ScDPResultData* pData ) :
 
 ScDPDataDimension::~ScDPDataDimension()
 {
-    std::for_each(maMembers.begin(), maMembers.end(), ScDeleteObjectByPtr<ScDPDataMember>());
+    std::for_each(maMembers.begin(), maMembers.end(), o3tl::default_deleter<ScDPDataMember>());
 }
 
 void ScDPDataDimension::InitFrom( const ScDPResultDimension* pDim )
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 22a2a09..860d077 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -56,13 +56,13 @@
 #include "tokenarray.hxx"
 #include "mtvcellfunc.hxx"
 #include "columnspanset.hxx"
-#include <stlalgorithm.hxx>
 #include <fstalgorithm.hxx>
 #include <listenercontext.hxx>
 #include <sharedformula.hxx>
 #include <refhint.hxx>
 
 #include <svl/sharedstringpool.hxx>
+#include <o3tl/deleter.hxx>
 
 #include <vector>
 #include <boost/scoped_ptr.hpp>
@@ -293,7 +293,7 @@ public:
         delete[] pppInfo;
 
         if (mpRows)
-            std::for_each(mpRows->begin(), mpRows->end(), ScDeleteObjectByPtr<Row>());
+            std::for_each(mpRows->begin(), mpRows->end(), o3tl::default_deleter<Row>());
     }
 
     void SetKeepQuery( bool b ) { mbKeepQuery = b; }
diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx
index db5c6cf..fafbf25 100644
--- a/sc/source/core/tool/chartlis.cxx
+++ b/sc/source/core/tool/chartlis.cxx
@@ -23,7 +23,8 @@
 #include "brdcst.hxx"
 #include "document.hxx"
 #include "reftokenhelper.hxx"
-#include "stlalgorithm.hxx"
+
+#include <o3tl/deleter.hxx>
 
 using namespace com::sun::star;
 using ::std::vector;
@@ -575,7 +576,7 @@ void ScChartListenerCollection::FreeUnused()
     std::for_each(aUsed.begin(), aUsed.end(), InsertChartListener(maListeners));
 
     // Now, delete the ones no longer needed.
-    std::for_each(aUnused.begin(), aUnused.end(), ScDeleteObjectByPtr<ScChartListener>());
+    std::for_each(aUnused.begin(), aUnused.end(), o3tl::default_deleter<ScChartListener>());
 }
 
 void ScChartListenerCollection::FreeUno( const uno::Reference< chart::XChartDataChangeEventListener >& rListener,
@@ -603,7 +604,7 @@ void ScChartListenerCollection::FreeUno( const uno::Reference< chart::XChartData
     std::for_each(aUsed.begin(), aUsed.end(), InsertChartListener(maListeners));
 
     // Now, delete the ones no longer needed.
-    std::for_each(aUnused.begin(), aUnused.end(), ScDeleteObjectByPtr<ScChartListener>());
+    std::for_each(aUnused.begin(), aUnused.end(), o3tl::default_deleter<ScChartListener>());
 }
 
 void ScChartListenerCollection::StartTimer()
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index 37c7a0e..c5b0d21 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -26,7 +26,7 @@
 #include "refupdat.hxx"
 #include "rechead.hxx"
 #include "compiler.hxx"
-#include "stlalgorithm.hxx"
+#include <o3tl/deleter.hxx>
 
 using ::std::vector;
 using ::std::advance;
@@ -1073,7 +1073,7 @@ ScRange* ScRangeList::Remove(size_t nPos)
 
 void ScRangeList::RemoveAll()
 {
-    for_each(maRanges.begin(), maRanges.end(), ScDeleteObjectByPtr<ScRange>());
+    for_each(maRanges.begin(), maRanges.end(), o3tl::default_deleter<ScRange>());
     maRanges.clear();
 }
 
@@ -1196,7 +1196,7 @@ ScRangeList ScRangeList::GetIntersectedRange(const ScRange& rRange) const
 //  ScRangePairList
 ScRangePairList::~ScRangePairList()
 {
-    for_each( maPairs.begin(), maPairs.end(), ScDeleteObjectByPtr<ScRangePair>() );
+    for_each( maPairs.begin(), maPairs.end(), o3tl::default_deleter<ScRangePair>() );
     maPairs.clear();
 }
 
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 5f1853c..abf9d3b 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -56,6 +56,7 @@
 #include <filter/msfilter/msoleexp.hxx>
 
 #include <unotools/localedatawrapper.hxx>
+#include <o3tl/deleter.hxx>
 
 #include <stdio.h>
 
@@ -68,7 +69,6 @@
 #include "docoptio.hxx"
 #include "patattr.hxx"
 #include "tabprotection.hxx"
-#include "stlalgorithm.hxx"
 
 #include <com/sun/star/sheet/XCellAddressable.hpp>
 #include <com/sun/star/sheet/XCellRangeAddressable.hpp>
@@ -109,7 +109,7 @@ XclExpObjList::XclExpObjList( const XclExpRoot& rRoot, XclEscherEx& rEscherEx )
 
 XclExpObjList::~XclExpObjList()
 {
-    ::std::for_each(maObjs.begin(), maObjs.end(), ScDeleteObjectByPtr<XclObj>());
+    std::for_each(maObjs.begin(), maObjs.end(), o3tl::default_deleter<XclObj>());
     delete pMsodrawingPerSheet;
     delete pSolverContainer;
 }
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 29e4efa..e5cb28e 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -32,7 +32,6 @@
 #include "compiler.hxx"
 #include "reftokenhelper.hxx"
 #include "chartlis.hxx"
-#include "stlalgorithm.hxx"
 #include "tokenuno.hxx"
 #include "docsh.hxx"
 #include "cellvalue.hxx"
@@ -55,6 +54,7 @@
 #include <comphelper/processfactory.hxx>
 
 #include <rtl/math.hxx>
+#include <o3tl/deleter.hxx>
 
 SC_SIMPLE_SERVICE_INFO( ScChart2DataProvider, "ScChart2DataProvider",
         "com.sun.star.chart2.data.DataProvider")
@@ -156,7 +156,7 @@ struct TokenTable : boost::noncopyable
     }
     void clear()
     {
-        ::std::for_each(maTokens.begin(), maTokens.end(), ScDeleteObjectByPtr<FormulaToken>());
+        std::for_each(maTokens.begin(), maTokens.end(), o3tl::default_deleter<FormulaToken>());
     }
 
     void push_back( FormulaToken* pToken )
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 7df4869..9b2331f 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -61,6 +61,8 @@
 #include <rtl/ustrbuf.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/string.hxx>
+#include <o3tl/deleter.hxx>
+
 #include <com/sun/star/container/XNameContainer.hpp>
 #include <com/sun/star/document/NamedPropertyValues.hpp>
 
@@ -456,7 +458,7 @@ ScViewData::~ScViewData()
     KillEditView();
     delete pOptions;
     ::std::for_each(
-        maTabData.begin(), maTabData.end(), ScDeleteObjectByPtr<ScViewDataTable>());
+        maTabData.begin(), maTabData.end(), o3tl::default_deleter<ScViewDataTable>());
 }
 
 void ScViewData::UpdateCurrentTab()


More information about the Libreoffice-commits mailing list