From 62a9f00bd30d15cde7b33bee2632c939534aaac6 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 4 Oct 2021 14:54:06 +0300 Subject: [PATCH] Return display_name from CefDragData::GetFileNames if available When dropping from Microsoft 365 Outlook the path will be "temp.tmp" while display_name contains the original file name. --- libcef/common/drag_data_impl.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libcef/common/drag_data_impl.cc b/libcef/common/drag_data_impl.cc index 7fbd282c1..79d9a1293 100644 --- a/libcef/common/drag_data_impl.cc +++ b/libcef/common/drag_data_impl.cc @@ -120,8 +120,12 @@ bool CefDragDataImpl::GetFileNames(std::vector& names) { return false; std::vector::const_iterator it = data_.filenames.begin(); - for (; it != data_.filenames.end(); ++it) - names.push_back(it->path.value()); + for (; it != data_.filenames.end(); ++it) { + auto name = it->display_name.value(); + if (name.empty()) + name = it->path.value(); + names.push_back(name); + } return true; }