Kaydet (Commit) 0d58f51d authored tarafından Luboš Luňák's avatar Luboš Luňák

Revert "tdf#120836 KDE5: Clipboard: don't put images to clipboard"

My previous commit has disabled setting non-text for selection, so
this workaround is no longer needed (and it very much looks like
a workaround, I see no good reason for never putting images
in the clipboard).

This reverts commit c8b0c382.

Change-Id: I0206211e3ff0adcb89f8ca5410831a428e71fb51
Reviewed-on: https://gerrit.libreoffice.org/72370
Tested-by: Jenkins
Reviewed-by: 's avatarLuboš Luňák <l.lunak@collabora.com>
üst d5c6efa2
......@@ -287,6 +287,36 @@ void VclQt5Clipboard::setContents(
}
}
// Add image data if present
if (bHasImage)
{
css::datatransfer::DataFlavor aFlavor;
//FIXME: other image formats?
aFlavor.MimeType = "image/png";
aFlavor.DataType = cppu::UnoType<Sequence<sal_Int8>>::get();
Any aValue;
try
{
aValue = xTrans->getTransferData(aFlavor);
}
catch (...)
{
}
if (aValue.getValueType() == cppu::UnoType<Sequence<sal_Int8>>::get())
{
Sequence<sal_Int8> aData;
aValue >>= aData;
QImage image;
image.loadFromData(reinterpret_cast<const uchar*>(aData.getConstArray()),
aData.getLength());
pMimeData->setImageData(image);
}
}
// Add text data
// TODO: consider checking if text of suitable type is present
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment