[Libreoffice-commits] core.git: 2 commits - sfx2/source svtools/source
Julien Nabet
serval2412 at yahoo.fr
Tue Aug 27 14:38:14 PDT 2013
sfx2/source/control/thumbnailviewacc.cxx | 30 ++++++++----------------------
svtools/source/control/valueacc.cxx | 30 ++++++++----------------------
2 files changed, 16 insertions(+), 44 deletions(-)
New commits:
commit 9aca3570c5e4990f591900e3702efa14958776f4
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Tue Aug 27 23:37:32 2013 +0200
Spread "Use std::find()" part2
Change-Id: I58e6f189c950dbaa5b71bb1b040f9eff20c50796
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx
index e92b7ca..01c60af 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -384,18 +384,11 @@ void SAL_CALL ValueSetAcc::removeAccessibleEventListener( const uno::Reference<
if( rxListener.is() )
{
- ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::const_iterator aEnd = mxEventListeners.end();
+ ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter =
+ std::find(mxEventListeners.begin(), mxEventListeners.end(), rxListener);
- for(::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter = mxEventListeners.begin();
- aIter != aEnd;
- ++aIter)
- {
- if( *aIter == rxListener )
- {
- mxEventListeners.erase(aIter);
- break;
- }
- }
+ if (aIter != mxEventListeners.end())
+ mxEventListeners.erase(aIter);
}
}
@@ -1047,18 +1040,11 @@ void SAL_CALL ValueItemAcc::removeAccessibleEventListener( const uno::Reference<
if( rxListener.is() )
{
- ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::const_iterator aEnd = mxEventListeners.end();
+ ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter =
+ std::find(mxEventListeners.begin(), mxEventListeners.end(), rxListener);
- for(::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter = mxEventListeners.begin();
- aIter != aEnd;
- ++aIter)
- {
- if( *aIter == rxListener )
- {
- mxEventListeners.erase(aIter);
- break;
- }
- }
+ if (aIter != mxEventListeners.end())
+ mxEventListeners.erase(aIter);
}
}
commit 834464c787de9935a6f7f1e50c21426fb868df5f
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Tue Aug 27 23:32:10 2013 +0200
Spread "Use std::find()"
Change-Id: I710cc7aeea494c69ae0df720db857d2759e70654
diff --git a/sfx2/source/control/thumbnailviewacc.cxx b/sfx2/source/control/thumbnailviewacc.cxx
index b398186..3f61244 100644
--- a/sfx2/source/control/thumbnailviewacc.cxx
+++ b/sfx2/source/control/thumbnailviewacc.cxx
@@ -307,18 +307,11 @@ void SAL_CALL ThumbnailViewAcc::removeAccessibleEventListener( const uno::Refere
if( rxListener.is() )
{
- std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::const_iterator aEnd = mxEventListeners.end();
+ std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter =
+ std::find(mxEventListeners.begin(), mxEventListeners.end(), rxListener);
- for (std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter = mxEventListeners.begin();
- aIter != aEnd;
- ++aIter)
- {
- if( *aIter == rxListener )
- {
- mxEventListeners.erase( aIter );
- break;
- }
- }
+ if (aIter != mxEventListeners.end())
+ mxEventListeners.erase( aIter );
}
}
@@ -823,18 +816,11 @@ void SAL_CALL ThumbnailViewItemAcc::removeAccessibleEventListener( const uno::Re
if( rxListener.is() )
{
- ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::const_iterator aEnd = mxEventListeners.end();
+ std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter =
+ std::find(mxEventListeners.begin(), mxEventListeners.end(), rxListener);
- for (::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter = mxEventListeners.begin();
- aIter != aEnd;
- ++aIter)
- {
- if( *aIter == rxListener )
- {
- mxEventListeners.erase( aIter );
- break;
- }
- }
+ if (aIter != mxEventListeners.end())
+ mxEventListeners.erase( aIter );
}
}
More information about the Libreoffice-commits
mailing list