[Libreoffice-commits] core.git: include/o3tl sc/source

Caolán McNamara caolanm at redhat.com
Mon May 12 12:41:44 PDT 2014


 include/o3tl/deleter.hxx              |   34 ----------------------------------
 sc/source/core/data/column.cxx        |    4 ++--
 sc/source/core/data/columnspanset.cxx |    4 ++--
 sc/source/core/data/document.cxx      |    4 ++--
 sc/source/core/data/dptabres.cxx      |    8 ++++----
 sc/source/core/data/table3.cxx        |    4 ++--
 sc/source/core/tool/chartlis.cxx      |    6 +++---
 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 ++--
 11 files changed, 24 insertions(+), 58 deletions(-)

New commits:
commit 28fe3628ed22a17eeb5a402724fea6558b2ba6bf
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon May 12 20:24:25 2014 +0100

    o3tl::default_deleter->boost::checked_deleter
    
    has the same result
    
    Change-Id: Ifbebcfb26c6fc54d03522c924da86837d7dfa3b9

diff --git a/include/o3tl/deleter.hxx b/include/o3tl/deleter.hxx
deleted file mode 100644
index 7f9e50d..0000000
--- a/include/o3tl/deleter.hxx
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- 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/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 4a25df7..0a5a68e 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -51,11 +51,11 @@
 #include <svl/sharedstringpool.hxx>
 #include <editeng/scripttypeitem.hxx>
 #include <editeng/fieldupdater.hxx>
-#include <o3tl/deleter.hxx>
 
 #include <cstring>
 #include <map>
 #include <cstdio>
+#include <boost/checked_delete.hpp>
 #include <boost/scoped_ptr.hpp>
 
 using ::editeng::SvxBorderLine;
@@ -2228,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(), o3tl::default_deleter<ScFormulaCell>());
+            std::for_each(aCells.begin(), aCells.end(), boost::checked_deleter<ScFormulaCell>());
     }
 
 public:
diff --git a/sc/source/core/data/columnspanset.cxx b/sc/source/core/data/columnspanset.cxx
index 8cef966..e431361 100644
--- a/sc/source/core/data/columnspanset.cxx
+++ b/sc/source/core/data/columnspanset.cxx
@@ -15,7 +15,7 @@
 #include "markdata.hxx"
 #include "rangelst.hxx"
 #include <fstalgorithm.hxx>
-#include <o3tl/deleter.hxx>
+#include <boost/checked_delete.hpp>
 
 #include <algorithm>
 
@@ -67,7 +67,7 @@ ColumnSpanSet::~ColumnSpanSet()
         if (!pTab)
             continue;
 
-        std::for_each(pTab->begin(), pTab->end(), o3tl::default_deleter<ColumnType>());
+        std::for_each(pTab->begin(), pTab->end(), boost::checked_deleter<ColumnType>());
         delete pTab;
     }
 }
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 02a1bbb..bac82bd 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -98,10 +98,10 @@
 #include <tokenstringcontext.hxx>
 
 #include <formula/vectortoken.hxx>
-#include <o3tl/deleter.hxx>
 
 #include <map>
 #include <limits>
+#include <boost/checked_delete.hpp>
 #include <boost/scoped_ptr.hpp>
 
 #include "mtvelements.hxx"
@@ -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, o3tl::default_deleter<ScTable>());
+                std::for_each(it, itEnd, boost::checked_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 542cf54..6382ae2 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -33,13 +33,13 @@
 #include <osl/diagnose.h>
 #include <rtl/math.hxx>
 #include <rtl/strbuf.hxx>
-#include <o3tl/deleter.hxx>
 
 #include <math.h>
 #include <float.h>
 #include <algorithm>
-#include <boost/unordered_map.hpp>
+#include <boost/checked_delete.hpp>
 #include <boost/scoped_ptr.hpp>
+#include <boost/unordered_map.hpp>
 
 #include <com/sun/star/sheet/DataResultFlags.hpp>
 #include <com/sun/star/sheet/MemberResultFlags.hpp>
@@ -757,7 +757,7 @@ ScDPResultData::ScDPResultData( ScDPSource& rSrc ) :
 
 ScDPResultData::~ScDPResultData()
 {
-    std::for_each(maDimMembers.begin(), maDimMembers.end(), o3tl::default_deleter<ResultMembers>());
+    std::for_each(maDimMembers.begin(), maDimMembers.end(), boost::checked_deleter<ResultMembers>());
 }
 
 void ScDPResultData::SetMeasureData(
@@ -3550,7 +3550,7 @@ ScDPDataDimension::ScDPDataDimension( const ScDPResultData* pData ) :
 
 ScDPDataDimension::~ScDPDataDimension()
 {
-    std::for_each(maMembers.begin(), maMembers.end(), o3tl::default_deleter<ScDPDataMember>());
+    std::for_each(maMembers.begin(), maMembers.end(), boost::checked_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 860d077..b544711 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -62,9 +62,9 @@
 #include <refhint.hxx>
 
 #include <svl/sharedstringpool.hxx>
-#include <o3tl/deleter.hxx>
 
 #include <vector>
+#include <boost/checked_delete.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <boost/scoped_array.hpp>
 #include <boost/unordered_set.hpp>
@@ -293,7 +293,7 @@ public:
         delete[] pppInfo;
 
         if (mpRows)
-            std::for_each(mpRows->begin(), mpRows->end(), o3tl::default_deleter<Row>());
+            std::for_each(mpRows->begin(), mpRows->end(), boost::checked_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 fafbf25..6e15d77 100644
--- a/sc/source/core/tool/chartlis.cxx
+++ b/sc/source/core/tool/chartlis.cxx
@@ -24,7 +24,7 @@
 #include "document.hxx"
 #include "reftokenhelper.hxx"
 
-#include <o3tl/deleter.hxx>
+#include <boost/checked_delete.hpp>
 
 using namespace com::sun::star;
 using ::std::vector;
@@ -576,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(), o3tl::default_deleter<ScChartListener>());
+    std::for_each(aUnused.begin(), aUnused.end(), boost::checked_deleter<ScChartListener>());
 }
 
 void ScChartListenerCollection::FreeUno( const uno::Reference< chart::XChartDataChangeEventListener >& rListener,
@@ -604,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(), o3tl::default_deleter<ScChartListener>());
+    std::for_each(aUnused.begin(), aUnused.end(), boost::checked_deleter<ScChartListener>());
 }
 
 void ScChartListenerCollection::StartTimer()
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index c5b0d21..e2e63fd 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 <o3tl/deleter.hxx>
+#include <boost/checked_delete.hpp>
 
 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(), o3tl::default_deleter<ScRange>());
+    for_each(maRanges.begin(), maRanges.end(), boost::checked_deleter<ScRange>());
     maRanges.clear();
 }
 
@@ -1196,7 +1196,7 @@ ScRangeList ScRangeList::GetIntersectedRange(const ScRange& rRange) const
 //  ScRangePairList
 ScRangePairList::~ScRangePairList()
 {
-    for_each( maPairs.begin(), maPairs.end(), o3tl::default_deleter<ScRangePair>() );
+    for_each( maPairs.begin(), maPairs.end(), boost::checked_deleter<ScRangePair>() );
     maPairs.clear();
 }
 
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index abf9d3b..bb4eb8c 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -56,7 +56,6 @@
 #include <filter/msfilter/msoleexp.hxx>
 
 #include <unotools/localedatawrapper.hxx>
-#include <o3tl/deleter.hxx>
 
 #include <stdio.h>
 
@@ -78,6 +77,7 @@
 #include <oox/export/utils.hxx>
 #include <oox/export/vmlexport.hxx>
 
+#include <boost/checked_delete.hpp>
 #include <boost/scoped_ptr.hpp>
 
 using namespace ::com::sun::star;
@@ -109,7 +109,7 @@ XclExpObjList::XclExpObjList( const XclExpRoot& rRoot, XclEscherEx& rEscherEx )
 
 XclExpObjList::~XclExpObjList()
 {
-    std::for_each(maObjs.begin(), maObjs.end(), o3tl::default_deleter<XclObj>());
+    std::for_each(maObjs.begin(), maObjs.end(), boost::checked_deleter<XclObj>());
     delete pMsodrawingPerSheet;
     delete pSolverContainer;
 }
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index e5cb28e..0a4b0c8 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -54,7 +54,7 @@
 #include <comphelper/processfactory.hxx>
 
 #include <rtl/math.hxx>
-#include <o3tl/deleter.hxx>
+#include <boost/checked_delete.hpp>
 
 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(), o3tl::default_deleter<FormulaToken>());
+        std::for_each(maTokens.begin(), maTokens.end(), boost::checked_deleter<FormulaToken>());
     }
 
     void push_back( FormulaToken* pToken )
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 9b2331f..50e7b12 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -59,9 +59,9 @@
 #include "stlalgorithm.hxx"
 #include "ViewSettingsSequenceDefines.hxx"
 #include <rtl/ustrbuf.hxx>
+#include <boost/checked_delete.hpp>
 #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>
@@ -458,7 +458,7 @@ ScViewData::~ScViewData()
     KillEditView();
     delete pOptions;
     ::std::for_each(
-        maTabData.begin(), maTabData.end(), o3tl::default_deleter<ScViewDataTable>());
+        maTabData.begin(), maTabData.end(), boost::checked_deleter<ScViewDataTable>());
 }
 
 void ScViewData::UpdateCurrentTab()


More information about the Libreoffice-commits mailing list