diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2012-09-23 23:39:56 +0900 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2012-09-24 11:06:26 +0000 |
commit | 5a23e1c62898ee432858a11733d1765a2075948c (patch) | |
tree | 6fb38e5f7012110dc83983825030e99233725582 /sw | |
parent | 57d2f9b7744eea76496af1f4101398ec4f6caf70 (diff) |
refactor code with <algorithm>
Change-Id: I774492928a909a0768ebcdc9cb56651146659351
Reviewed-on: https://gerrit.libreoffice.org/677
Reviewed-by: Noel Power <noel.power@suse.com>
Tested-by: Noel Power <noel.power@suse.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/access/accmap.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/access/acctable.cxx | 15 |
2 files changed, 6 insertions, 19 deletions
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index f47346cb6d80..a96de1ada157 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 9c39db2fc5e8..fd5d98487c97 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, |