diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2015-05-04 09:33:59 +0900 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-05-07 14:03:42 +0000 |
commit | 5a7c1bc635c7e0377bb743d91b0cf385397b7337 (patch) | |
tree | 8c640bf0b8c5a1cc0d749f5cf64fdd5e48945cf1 /canvas | |
parent | b4d7f8248496610a508b8edbcd57b9875e68bd81 (diff) |
simplify code by replacing std::find_if with std::any_of/std::none_of
Change-Id: Ife6ab3544f73b1de60f5241c68466045161a4d88
Reviewed-on: https://gerrit.libreoffice.org/15615
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/factory/cf_service.cxx | 8 | ||||
-rw-r--r-- | canvas/source/tools/spriteredrawmanager.cxx | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx index 3f3c24ef8cd0..427acb7948c4 100644 --- a/canvas/source/factory/cf_service.cxx +++ b/canvas/source/factory/cf_service.cxx @@ -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 diff --git a/canvas/source/tools/spriteredrawmanager.cxx b/canvas/source/tools/spriteredrawmanager.cxx index 7873883c276a..a98a65e261c1 100644 --- a/canvas/source/tools/spriteredrawmanager.cxx +++ b/canvas/source/tools/spriteredrawmanager.cxx @@ -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() : |