Commit 870a47cc authored by Laurent Montel's avatar Laurent Montel 😁

Fix Bug 369387 - Paste HTML tables in composer as HTML tables (not as picture)

FIXED-IN: 5.3.3
BUG: 369387
parent 8a51c6a2
......@@ -1955,7 +1955,14 @@ void KMComposerWin::insertUrls(const QMimeData *source, const QList<QUrl> &urlLi
bool KMComposerWin::insertFromMimeData(const QMimeData *source, bool forceAttachment)
// If this is a PNG image, either add it as an attachment or as an inline image
if (source->hasImage() && source->hasFormat(QStringLiteral("image/png"))) {
if (source->hasHtml() && mComposerBase->editor()->textMode() == MessageComposer::RichTextComposerNg::Rich ) {
const QString html = QString::fromUtf8(source->data(QStringLiteral("text/html")));
return true;
} else if (source->hasHtml() && mComposerBase->editor()->textMode() == MessageComposer::RichTextComposerNg::Plain && source->hasText()) {
return true
} else if (source->hasImage() && source->hasFormat(QStringLiteral("image/png"))) {
// Get the image data before showing the dialog, since that processes events which can delete
// the QMimeData object behind our back
const QByteArray imageData = source->data(QStringLiteral("image/png"));
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