summaryrefslogtreecommitdiff
path: root/vcl/source/control/edit.cxx
diff options
context:
space:
mode:
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& )