summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@suse.com>2012-01-09 18:04:58 +0100
committerThorsten Behrens <tbehrens@suse.com>2012-01-10 12:29:05 +0100
commitf4f4be98ba753657f914f16abaec79865bea99d0 (patch)
treedbfe940b03559214e0818195dd18a9f2be81b578
parent1e0de54d88a79c99f0671f608f7de096cb721537 (diff)
Fix more incorrect iterator re-use.
Follow-up fix for 540963d879296ef81f883305057e63465b2ff586 std::algos use iterator arguments by value, and may change them.
-rw-r--r--canvas/source/tools/spriteredrawmanager.cxx16
-rw-r--r--slideshow/source/engine/animationnodes/basecontainernode.cxx3
-rw-r--r--slideshow/source/engine/eventmultiplexer.cxx4
-rw-r--r--slideshow/source/engine/tools.cxx2
4 files changed, 11 insertions, 14 deletions
diff --git a/canvas/source/tools/spriteredrawmanager.cxx b/canvas/source/tools/spriteredrawmanager.cxx
index af2c27905b1c..991452fbe20a 100644
--- a/canvas/source/tools/spriteredrawmanager.cxx
+++ b/canvas/source/tools/spriteredrawmanager.cxx
@@ -411,16 +411,11 @@ namespace canvas
if( nNumSprites > 3 || nNumSprites < 1 )
return false;
- const SpriteConnectedRanges::ComponentListType::const_iterator aBegin(
- rUpdateArea.maComponentList.begin() );
- const SpriteConnectedRanges::ComponentListType::const_iterator aEnd(
- rUpdateArea.maComponentList.end() );
-
// now, calc the _true_ update area, by merging all sprite's
// true update areas into one rectangle
- ::basegfx::B2DRange aTrueArea( aBegin->second.getUpdateArea() );
- ::std::for_each( aBegin,
- aEnd,
+ ::basegfx::B2DRange aTrueArea( rUpdateArea.maComponentList.begin()->second.getUpdateArea() );
+ ::std::for_each( rUpdateArea.maComponentList.begin(),
+ rUpdateArea.maComponentList.end(),
::boost::bind( (void (basegfx::B2DRange::*)(const basegfx::B2DRange&))(
&basegfx::B2DRange::expand),
aTrueArea,
@@ -428,9 +423,12 @@ namespace canvas
::boost::bind( ::o3tl::select2nd<AreaComponent>(),
_1 ) ) ) );
+ const SpriteConnectedRanges::ComponentListType::const_iterator aEnd(
+ rUpdateArea.maComponentList.end() );
+
// and check whether _any_ of the sprites tells that its area
// update will not be opaque.
- return (::std::find_if( aBegin,
+ return (::std::find_if( rUpdateArea.maComponentList.begin(),
aEnd,
::boost::bind( &SpriteRedrawManager::isAreaUpdateNotOpaque,
this,
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;