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.
This commit is contained in:
Marshall Greenblatt 2021-10-04 14:54:06 +03:00
parent eabdf3a2ca
commit 62a9f00bd3
1 changed files with 6 additions and 2 deletions

View File

@ -120,8 +120,12 @@ bool CefDragDataImpl::GetFileNames(std::vector<CefString>& names) {
return false;
std::vector<ui::FileInfo>::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;
}