diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-17 15:31:36 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-02-28 14:24:41 +0100 |
commit | c3ab932f8b2f3a52383ce0db3ff67c925b138bde (patch) | |
tree | 48a9899f1ac5a4f29b6814c2e6c6717300cad137 /src/core/clipboard_qt.cpp | |
parent | 26b4267a3b00ebedb560169d09f974cd87a6a370 (diff) |
Adaptations for Chromium 79
Fixes: QTBUG-80737
Fixes: QTBUG-81556
Fixes: QTBUG-81614
Change-Id: Ie6a69cdbf46d0508bff226f1b8fed28a618e1949
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/clipboard_qt.cpp')
-rw-r--r-- | src/core/clipboard_qt.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp index 44dd84f37..ef7a05299 100644 --- a/src/core/clipboard_qt.cpp +++ b/src/core/clipboard_qt.cpp @@ -105,13 +105,13 @@ Clipboard *Clipboard::Create() namespace QtWebEngineCore { -void ClipboardQt::WriteObjects(ui::ClipboardBuffer type, const ObjectMap &objects) +void ClipboardQt::WritePortableRepresentations(ui::ClipboardBuffer type, const ObjectMap &objects) { DCHECK(CalledOnValidThread()); DCHECK(IsSupportedClipboardBuffer(type)); - for (ObjectMap::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) - DispatchObject(static_cast<ObjectType>(iter->first), iter->second); + for (const auto &object : objects) + DispatchPortableRepresentation(object.first, object.second); // Commit the accumulated data. if (uncommittedData) @@ -120,15 +120,22 @@ void ClipboardQt::WriteObjects(ui::ClipboardBuffer type, const ObjectMap &object : QClipboard::Selection); if (type == ui::ClipboardBuffer::kCopyPaste && IsSupportedClipboardBuffer(ui::ClipboardBuffer::kSelection)) { - ObjectMap::const_iterator text_iter = objects.find(ObjectType::kText); + ObjectMap::const_iterator text_iter = objects.find(PortableFormat::kText); if (text_iter != objects.end()) { // Copy text and SourceTag to the selection clipboard. - ObjectMap::const_iterator next_iter = text_iter; - WriteObjects(ui::ClipboardBuffer::kSelection, ObjectMap(text_iter, ++next_iter, base::KEEP_FIRST_OF_DUPES)); + WritePortableRepresentations(ui::ClipboardBuffer::kSelection, + ObjectMap(text_iter, text_iter + 1)); } } } +void ClipboardQt::WritePlatformRepresentations(ui::ClipboardBuffer buffer, std::vector<ui::Clipboard::PlatformRepresentation> platform_representations) +{ + DCHECK(CalledOnValidThread()); + DCHECK(IsSupportedClipboardBuffer(buffer)); + DispatchPlatformRepresentations(std::move(platform_representations)); +} + void ClipboardQt::WriteText(const char *text_data, size_t text_len) { getUncommittedData()->setText(QString::fromUtf8(text_data, text_len)); |