From c85142eb63c61de68aa7dbb10b2bcb8b48b870f9 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Mon, 9 Jan 2012 18:04:58 +0100 Subject: Fix more incorrect iterator re-use. Follow-up fix for 540963d879296ef81f883305057e63465b2ff586 std::algos use iterator arguments by value, and may change them. --- slideshow/source/engine/animationnodes/basecontainernode.cxx | 3 +-- slideshow/source/engine/eventmultiplexer.cxx | 4 ++-- slideshow/source/engine/tools.cxx | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'slideshow') diff --git a/slideshow/source/engine/animationnodes/basecontainernode.cxx b/slideshow/source/engine/animationnodes/basecontainernode.cxx index bf00001cc19d..fd816544f0c7 100644 --- a/slideshow/source/engine/animationnodes/basecontainernode.cxx +++ b/slideshow/source/engine/animationnodes/basecontainernode.cxx @@ -113,10 +113,9 @@ void BaseContainerNode::appendChildNode( AnimationNodeSharedPtr const& pNode ) bool BaseContainerNode::isChildNode( AnimationNodeSharedPtr const& pNode ) const { // find given notifier in child vector - VectorOfNodes::const_iterator const iBegin( maChildren.begin() ); VectorOfNodes::const_iterator const iEnd( maChildren.end() ); VectorOfNodes::const_iterator const iFind( - std::find( iBegin, iEnd, pNode ) ); + std::find( maChildren.begin(), iEnd, pNode ) ); return (iFind != iEnd); } diff --git a/slideshow/source/engine/eventmultiplexer.cxx b/slideshow/source/engine/eventmultiplexer.cxx index 8bb0f08d7857..d162718e9742 100644 --- a/slideshow/source/engine/eventmultiplexer.cxx +++ b/slideshow/source/engine/eventmultiplexer.cxx @@ -617,10 +617,10 @@ bool EventMultiplexerImpl::notifyMouseHandlers( // find corresponding view (to map mouse position into user // coordinate space) UnoViewVector::const_iterator aIter; - const UnoViewVector::const_iterator aBegin( mrViewContainer.begin() ); const UnoViewVector::const_iterator aEnd ( mrViewContainer.end() ); if( (aIter=::std::find_if( - aBegin, aEnd, + mrViewContainer.begin(), + aEnd, boost::bind( std::equal_to< uno::Reference< presentation::XSlideShowView > >(), boost::cref( xView ), diff --git a/slideshow/source/engine/tools.cxx b/slideshow/source/engine/tools.cxx index e36f4ee47d44..7dabb90b060e 100644 --- a/slideshow/source/engine/tools.cxx +++ b/slideshow/source/engine/tools.cxx @@ -472,7 +472,7 @@ namespace slideshow pArray + nLen, NamedValueComparator( rSearchKey ) ); - if( pFound == pArray + nLen ) + if( pFound == rSequence.getConstArray() + nLen ) return false; return true; -- cgit