diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-11-27 22:17:40 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-29 12:06:44 +0100 |
commit | 0ded54c33f01d18d2cd06547bd8307bd140cf28f (patch) | |
tree | e250a9a8bb89b2042d9a0bc09f80bf65757eec19 /sot/source/base/formats.cxx | |
parent | 7d311ea864e7cfeb1c8f4ca417911db20d13361e (diff) |
Simplify containers iterations in slideshow, sot, starmath, stoc
Use range-based loop or replace with STL functions
Change-Id: I94792c28b283a0998bf813317e5beb37d93e0c23
Reviewed-on: https://gerrit.libreoffice.org/64125
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sot/source/base/formats.cxx')
-rw-r--r-- | sot/source/base/formats.cxx | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx index 9b7770f146ef..cc8ea22feaaa 100644 --- a/sot/source/base/formats.cxx +++ b/sot/source/base/formats.cxx @@ -1318,20 +1318,8 @@ const SotAction_Impl* GetExchangeDestinationWriterFreeAreaCopy() bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, SotClipboardFormatId nId ) { - auto aIter( rDataFlavorExVector.begin() ); - auto aEnd( rDataFlavorExVector.end() ); - bool bRet = false; - - while( aIter != aEnd ) - { - if( nId == (*aIter++).mnSotId ) - { - bRet = true; - aIter = aEnd; - } - } - - return bRet; + return std::any_of(rDataFlavorExVector.begin(), rDataFlavorExVector.end(), + [nId](const DataFlavorEx& rDataFlavorEx) { return nId == rDataFlavorEx.mnSotId; }); } |