Kaydet (Commit) 5a7c1bc6 authored tarafından Takeshi Abe's avatar Takeshi Abe Kaydeden (comit) Caolán McNamara

simplify code by replacing std::find_if with std::any_of/std::none_of

Change-Id: Ife6ab3544f73b1de60f5241c68466045161a4d88
Reviewed-on: https://gerrit.libreoffice.org/15615Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst b4d7f824
......@@ -80,11 +80,11 @@ namespace basegfx
return false;
const std::vector<B2DRange>::const_iterator aEnd( maRanges.end() );
return std::find_if( maRanges.begin(),
return std::any_of( maRanges.begin(),
aEnd,
boost::bind<bool>( boost::mem_fn( &B2DRange::overlaps ),
_1,
boost::cref(rRange) ) ) != aEnd;
boost::cref(rRange) ) );
}
B2DPolyPolygon solveCrossovers() const
......
......@@ -401,24 +401,24 @@ Reference<XInterface> CanvasFactory::lookupAndUse(
// check whether given canvas service is listed in the
// sequence of "accelerated canvas implementations"
const bool bIsAcceleratedImpl(
std::find_if(pFirstAccelImpl,
std::any_of(pFirstAccelImpl,
pEndAccelImpl,
boost::bind(&OUString::equals,
boost::cref(aCurrName),
boost::bind(
&OUString::trim,
_1))) != pEndAccelImpl );
_1))) );
// check whether given canvas service is listed in the
// sequence of "antialiasing canvas implementations"
const bool bIsAAImpl(
std::find_if(pFirstAAImpl,
std::any_of(pFirstAAImpl,
pEndAAImpl,
boost::bind(&OUString::equals,
boost::cref(aCurrName),
boost::bind(
&OUString::trim,
_1))) != pEndAAImpl );
_1))) );
// try to instantiate canvas *only* if either accel and AA
// property match preference, *or*, if there's a mismatch, only
......
......@@ -423,12 +423,12 @@ namespace canvas
// and check whether _any_ of the sprites tells that its area
// update will not be opaque.
return (::std::find_if( rUpdateArea.maComponentList.begin(),
return ::std::none_of( rUpdateArea.maComponentList.begin(),
aEnd,
::boost::bind( &SpriteRedrawManager::isAreaUpdateNotOpaque,
this,
::boost::cref(aTrueArea),
_1 ) ) == aEnd );
_1 ) );
}
bool SpriteRedrawManager::areSpritesChanged( const UpdateArea& rUpdateArea ) const
......@@ -440,12 +440,12 @@ namespace canvas
// component (return false)
const SpriteConnectedRanges::ComponentListType::const_iterator aEnd(
rUpdateArea.maComponentList.end() );
return (::std::find_if( rUpdateArea.maComponentList.begin(),
return ::std::any_of( rUpdateArea.maComponentList.begin(),
aEnd,
::boost::bind( &SpriteInfo::needsUpdate,
::boost::bind(
::o3tl::select2nd<SpriteConnectedRanges::ComponentType>(),
_1 ) ) ) != aEnd );
_1 ) ) );
}
SpriteRedrawManager::SpriteRedrawManager() :
......
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