[Libreoffice-commits] .: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Sep 24 04:06:46 PDT 2012


 sw/source/core/access/accmap.cxx   |   10 ++++------
 sw/source/core/access/acctable.cxx |   15 ++-------------
 2 files changed, 6 insertions(+), 19 deletions(-)

New commits:
commit 5a23e1c62898ee432858a11733d1765a2075948c
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Sun Sep 23 23:39:56 2012 +0900

    refactor code with <algorithm>
    
    Change-Id: I774492928a909a0768ebcdc9cb56651146659351
    Reviewed-on: https://gerrit.libreoffice.org/677
    Reviewed-by: Noel Power <noel.power at suse.com>
    Tested-by: Noel Power <noel.power at suse.com>

diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index f47346c..a96de1a 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -32,6 +32,7 @@
 #include <vcl/window.hxx>
 #include <svx/svdmodel.hxx>
 #include <svx/unomod.hxx>
+#include <algorithm>
 #include <map>
 #include <list>
 #include <accmap.hxx>
@@ -70,6 +71,7 @@
 #include <dflyobj.hxx>
 #include <prevwpage.hxx>
 #include <switerator.hxx>
+#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::accessibility;
@@ -2283,12 +2285,8 @@ void SwAccessibleMap::FireEvents()
         if( mpEvents )
         {
             mpEvents->SetFiring();
-            SwAccessibleEventList_Impl::iterator aIter = mpEvents->begin();
-            while( aIter != mpEvents->end() )
-            {
-                FireEvent( *aIter );
-                ++aIter;
-            }
+            ::std::for_each(mpEvents->begin(), mpEvents->end(),
+                            boost::bind(&SwAccessibleMap::FireEvent, this, _1));
 
             delete mpEventMap;
             mpEventMap = 0;
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 9c39db2..fd5d984 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -29,6 +29,7 @@
 #include <osl/mutex.hxx>
 #include <rtl/ustrbuf.hxx>
 
+#include <algorithm>
 #include <list>
 #include <set>
 #include <com/sun/star/accessibility/AccessibleRole.hpp>
@@ -409,19 +410,7 @@ sal_Bool SwAccessibleTableData_Impl::CompareExtents(
     if( maExtents.size() != rCmp.maExtents.size() )
         return sal_False;
 
-    Int32PairList_Impl::const_iterator aIter( maExtents.begin() );
-    Int32PairList_Impl::const_iterator aEndIter( maExtents.end() );
-    Int32PairList_Impl::const_iterator aCmpIter( rCmp.maExtents.begin() );
-    while( aIter != aEndIter )
-    {
-        if( *aIter != *aCmpIter )
-            return sal_False;
-
-        ++aIter;
-        ++aCmpIter;
-    }
-
-    return sal_True;
+    return ::std::equal(maExtents.begin(), maExtents.end(), rCmp.maExtents.begin()) ? sal_True : sal_False;
 }
 
 SwAccessibleTableData_Impl::SwAccessibleTableData_Impl( SwAccessibleMap& rAccMap,


More information about the Libreoffice-commits mailing list