summaryrefslogtreecommitdiff
path: root/vcl/source/control/edit.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-06-15 17:13:48 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-18 09:43:08 +0200
commit452a8e4abe0c416d664078baddff67c1561025ec (patch)
tree037f973aebd5e740d97525ff7aa852515762ae0b /vcl/source/control/edit.cxx
parente1eb7cb04a4c30cec238ab0f54d41a6cdc3299c1 (diff)
Simplify Sequence iterations in vcl
Use range-based loops or replace with comphelper or STL functions Change-Id: If046738084c2d13cc1eaea6a03aaf60b63f62767 Reviewed-on: https://gerrit.libreoffice.org/74104 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/control/edit.cxx')
-rw-r--r--vcl/source/control/edit.cxx18
1 files changed, 6 insertions, 12 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index a1b1af252dc5..57d037546c5f 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2924,18 +2924,12 @@ void Edit::dragEnter( const css::datatransfer::dnd::DropTargetDragEnterEvent& rD
}
// search for string data type
const Sequence< css::datatransfer::DataFlavor >& rFlavors( rDTDE.SupportedDataFlavors );
- sal_Int32 nEle = rFlavors.getLength();
- mpDDInfo->bIsStringSupported = false;
- for( sal_Int32 i = 0; i < nEle; i++ )
- {
- sal_Int32 nIndex = 0;
- const OUString aMimetype = rFlavors[i].MimeType.getToken( 0, ';', nIndex );
- if ( aMimetype == "text/plain" )
- {
- mpDDInfo->bIsStringSupported = true;
- break;
- }
- }
+ mpDDInfo->bIsStringSupported = std::any_of(rFlavors.begin(), rFlavors.end(),
+ [](const css::datatransfer::DataFlavor& rFlavor) {
+ sal_Int32 nIndex = 0;
+ const OUString aMimetype = rFlavor.MimeType.getToken( 0, ';', nIndex );
+ return aMimetype == "text/plain";
+ });
}
void Edit::dragExit( const css::datatransfer::dnd::DropTargetEvent& )