summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/WebCore/platform/qt/PasteboardQt.cpp9
-rw-r--r--Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp4
2 files changed, 9 insertions, 4 deletions
diff --git a/Source/WebCore/platform/qt/PasteboardQt.cpp b/Source/WebCore/platform/qt/PasteboardQt.cpp
index 1d69398cf..2bcdd5ffa 100644
--- a/Source/WebCore/platform/qt/PasteboardQt.cpp
+++ b/Source/WebCore/platform/qt/PasteboardQt.cpp
@@ -208,8 +208,13 @@ void Pasteboard::writeURL(const KURL& url, const String& title, Frame*)
if (!m_writableData)
m_writableData = new QMimeData;
- if (!title.isEmpty())
- m_writableData->setText(title);
+
+ QString urlString = url.string();
+ m_writableData->setText(urlString);
+
+ QString html = QStringLiteral("<a href=\"") + urlString + QStringLiteral("\">") + QString(title) + QStringLiteral("</a>");
+ m_writableData->setHtml(html);
+
m_writableData->setUrls(QList<QUrl>() << url);
if (isForCopyAndPaste())
updateSystemPasteboard();
diff --git a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
index 9f0e7a564..13fbe88d3 100644
--- a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
@@ -1113,10 +1113,10 @@ void QWebPageAdapter::triggerAction(QWebPageAdapter::MenuAction action, QWebHitT
#if defined(Q_WS_X11)
bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
Pasteboard::generalPasteboard()->setSelectionMode(true);
- editor.copyURL(hitTestResult->linkUrl, WTF::String());
+ editor.copyURL(hitTestResult->linkUrl, hitTestResult->linkText);
Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
#endif
- editor.copyURL(hitTestResult->linkUrl, WTF::String());
+ editor.copyURL(hitTestResult->linkUrl, hitTestResult->linkText);
break;
}
case OpenImageInNewWindow: