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

Albert Thuswaldner albert.thuswaldner at gmail.com
Sun Oct 4 23:20:34 PDT 2015


 sc/source/filter/excel/excimp8.cxx |   13 ++++++-------
 sc/source/filter/inc/excimp8.hxx   |    6 ++----
 2 files changed, 8 insertions(+), 11 deletions(-)

New commits:
commit 7d82dfca4d78841930a4411371c3d211badeccdb
Author: Albert Thuswaldner <albert.thuswaldner at gmail.com>
Date:   Sun Oct 4 11:43:44 2015 +0200

    tdf#93243 replace boost::bind with C++11 lambdas in excimp8.cxx
    
    Change-Id: I810b524ce59703ca298e3c171f590c5dd75396de
    Reviewed-on: https://gerrit.libreoffice.org/19122
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index eba2d5c..e1ecf4b 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -846,7 +846,7 @@ void XclImpAutoFilterData::EnableRemoveFilter()
 void XclImpAutoFilterBuffer::Insert( RootData* pRoot, const ScRange& rRange)
 {
     if( !GetByTab( rRange.aStart.Tab() ) )
-        maFilters.push_back( new XclImpAutoFilterData( pRoot, rRange) );
+        maFilters.push_back( XclImpAutoFilterSharePtr(new XclImpAutoFilterData( pRoot, rRange) ));
 }
 
 void XclImpAutoFilterBuffer::AddAdvancedRange( const ScRange& rRange )
@@ -865,17 +865,16 @@ void XclImpAutoFilterBuffer::AddExtractPos( const ScRange& rRange )
 
 void XclImpAutoFilterBuffer::Apply()
 {
-    std::for_each(maFilters.begin(),maFilters.end(),
-        boost::bind(&XclImpAutoFilterData::Apply,_1));
+    for( const auto& rFilterPtr : maFilters )
+        rFilterPtr->Apply();
 }
 
 XclImpAutoFilterData* XclImpAutoFilterBuffer::GetByTab( SCTAB nTab )
 {
-    boost::ptr_vector<XclImpAutoFilterData>::iterator it;
-    for( it = maFilters.begin(); it != maFilters.end(); ++it )
+    for( const auto& rFilterPtr : maFilters )
     {
-        if( it->Tab() == nTab )
-            return &(*it);
+        if( rFilterPtr->Tab() == nTab )
+            return rFilterPtr.get();
     }
     return NULL;
 }
diff --git a/sc/source/filter/inc/excimp8.hxx b/sc/source/filter/inc/excimp8.hxx
index e50cfd4..2ce1135 100644
--- a/sc/source/filter/inc/excimp8.hxx
+++ b/sc/source/filter/inc/excimp8.hxx
@@ -22,8 +22,6 @@
 
 #include <string.h>
 
-#include <boost/ptr_container/ptr_vector.hpp>
-
 #include "imp_op.hxx"
 #include "root.hxx"
 #include "excscen.hxx"
@@ -123,8 +121,8 @@ public:
     XclImpAutoFilterData*       GetByTab( SCTAB nTab );
 
 private:
-
-    boost::ptr_vector<XclImpAutoFilterData> maFilters;
+    typedef std::shared_ptr<XclImpAutoFilterData> XclImpAutoFilterSharePtr;
+    std::vector<XclImpAutoFilterSharePtr> maFilters;
 };
 
 #endif


More information about the Libreoffice-commits mailing list