Kaydet (Commit) c85142eb authored tarafından Thorsten Behrens's avatar Thorsten Behrens

Fix more incorrect iterator re-use.

Follow-up fix for 540963d8
std::algos use iterator arguments by value, and may change them.
üst 540963d8
...@@ -412,16 +412,11 @@ namespace canvas ...@@ -412,16 +412,11 @@ namespace canvas
if( nNumSprites > 3 || nNumSprites < 1 ) if( nNumSprites > 3 || nNumSprites < 1 )
return false; 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 // now, calc the _true_ update area, by merging all sprite's
// true update areas into one rectangle // true update areas into one rectangle
::basegfx::B2DRange aTrueArea( aBegin->second.getUpdateArea() ); ::basegfx::B2DRange aTrueArea( rUpdateArea.maComponentList.begin()->second.getUpdateArea() );
::std::for_each( aBegin, ::std::for_each( rUpdateArea.maComponentList.begin(),
aEnd, rUpdateArea.maComponentList.end(),
::boost::bind( (void (basegfx::B2DRange::*)(const basegfx::B2DRange&))( ::boost::bind( (void (basegfx::B2DRange::*)(const basegfx::B2DRange&))(
&basegfx::B2DRange::expand), &basegfx::B2DRange::expand),
aTrueArea, aTrueArea,
...@@ -429,9 +424,12 @@ namespace canvas ...@@ -429,9 +424,12 @@ namespace canvas
::boost::bind( ::o3tl::select2nd<AreaComponent>(), ::boost::bind( ::o3tl::select2nd<AreaComponent>(),
_1 ) ) ) ); _1 ) ) ) );
const SpriteConnectedRanges::ComponentListType::const_iterator aEnd(
rUpdateArea.maComponentList.end() );
// and check whether _any_ of the sprites tells that its area // and check whether _any_ of the sprites tells that its area
// update will not be opaque. // update will not be opaque.
return (::std::find_if( aBegin, return (::std::find_if( rUpdateArea.maComponentList.begin(),
aEnd, aEnd,
::boost::bind( &SpriteRedrawManager::isAreaUpdateNotOpaque, ::boost::bind( &SpriteRedrawManager::isAreaUpdateNotOpaque,
this, this,
......
...@@ -113,10 +113,9 @@ void BaseContainerNode::appendChildNode( AnimationNodeSharedPtr const& pNode ) ...@@ -113,10 +113,9 @@ void BaseContainerNode::appendChildNode( AnimationNodeSharedPtr const& pNode )
bool BaseContainerNode::isChildNode( AnimationNodeSharedPtr const& pNode ) const bool BaseContainerNode::isChildNode( AnimationNodeSharedPtr const& pNode ) const
{ {
// find given notifier in child vector // find given notifier in child vector
VectorOfNodes::const_iterator const iBegin( maChildren.begin() );
VectorOfNodes::const_iterator const iEnd( maChildren.end() ); VectorOfNodes::const_iterator const iEnd( maChildren.end() );
VectorOfNodes::const_iterator const iFind( VectorOfNodes::const_iterator const iFind(
std::find( iBegin, iEnd, pNode ) ); std::find( maChildren.begin(), iEnd, pNode ) );
return (iFind != iEnd); return (iFind != iEnd);
} }
......
...@@ -617,10 +617,10 @@ bool EventMultiplexerImpl::notifyMouseHandlers( ...@@ -617,10 +617,10 @@ bool EventMultiplexerImpl::notifyMouseHandlers(
// find corresponding view (to map mouse position into user // find corresponding view (to map mouse position into user
// coordinate space) // coordinate space)
UnoViewVector::const_iterator aIter; UnoViewVector::const_iterator aIter;
const UnoViewVector::const_iterator aBegin( mrViewContainer.begin() );
const UnoViewVector::const_iterator aEnd ( mrViewContainer.end() ); const UnoViewVector::const_iterator aEnd ( mrViewContainer.end() );
if( (aIter=::std::find_if( if( (aIter=::std::find_if(
aBegin, aEnd, mrViewContainer.begin(),
aEnd,
boost::bind( std::equal_to< uno::Reference< boost::bind( std::equal_to< uno::Reference<
presentation::XSlideShowView > >(), presentation::XSlideShowView > >(),
boost::cref( xView ), boost::cref( xView ),
......
...@@ -472,7 +472,7 @@ namespace slideshow ...@@ -472,7 +472,7 @@ namespace slideshow
pArray + nLen, pArray + nLen,
NamedValueComparator( rSearchKey ) ); NamedValueComparator( rSearchKey ) );
if( pFound == pArray + nLen ) if( pFound == rSequence.getConstArray() + nLen )
return false; return false;
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment