Windows: Fix clipboard test.
Return the QMimeData set on the Ole object if we own it. Change-Id: I08de0968e04a7356fed1255feb495f7b85e7a6f8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
parent
7ac4bf8a40
commit
5b7a1ca85b
@ -311,6 +311,8 @@ QMimeData *QWindowsClipboard::mimeData(QClipboard::Mode mode)
|
||||
qDebug() << __FUNCTION__ << mode;
|
||||
if (mode != QClipboard::Clipboard)
|
||||
return 0;
|
||||
if (ownsClipboard())
|
||||
return m_data->mimeData();
|
||||
return &m_retrievalData;
|
||||
}
|
||||
|
||||
@ -329,7 +331,8 @@ void QWindowsClipboard::setMimeData(QMimeData *mimeData, QClipboard::Mode mode)
|
||||
|
||||
const HRESULT src = OleSetClipboard(m_data);
|
||||
if (src != S_OK) {
|
||||
qErrnoWarning("OleSetClipboard: Failed to set data on clipboard: %s",
|
||||
qErrnoWarning("OleSetClipboard: Failed to set mime data (%s) on clipboard: %s",
|
||||
qPrintable(mimeData->formats().join(QStringLiteral(", "))),
|
||||
QWindowsContext::comErrorString(src).constData());
|
||||
releaseIData();
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user