From 8e7b61c48544b722b1cea41c9e2e6b1e01191be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 27 Apr 2020 21:14:04 +0100 Subject: [PATCH] IsDropFormatSupported can be const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8a1c1d862a998fb0bef912bea5b6b4dd058c127f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93059 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- include/vcl/transfer.hxx | 2 +- vcl/source/treelist/transfer2.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/vcl/transfer.hxx b/include/vcl/transfer.hxx index 234871576031..e374192378fb 100644 --- a/include/vcl/transfer.hxx +++ b/include/vcl/transfer.hxx @@ -476,7 +476,7 @@ public: virtual ~DropTargetHelper(); // typically called by the application in ::AcceptDrop and ::ExecuteDrop and (see above) - bool IsDropFormatSupported( SotClipboardFormatId nFormat ); + bool IsDropFormatSupported(SotClipboardFormatId nFormat) const; const DataFlavorExVector& GetDataFlavorExVector() const {return maFormats; } diff --git a/vcl/source/treelist/transfer2.cxx b/vcl/source/treelist/transfer2.cxx index 349b69609910..26407021ff52 100644 --- a/vcl/source/treelist/transfer2.cxx +++ b/vcl/source/treelist/transfer2.cxx @@ -295,7 +295,7 @@ sal_Int8 DropTargetHelper::ExecuteDrop( const ExecuteDropEvent& ) } -bool DropTargetHelper::IsDropFormatSupported( SotClipboardFormatId nFormat ) +bool DropTargetHelper::IsDropFormatSupported(SotClipboardFormatId nFormat) const { return std::any_of(maFormats.begin(), maFormats.end(), [&](const DataFlavorEx& data) { return data.mnSotId == nFormat; });