Commit 3cd2dac6 authored by Laurent Montel's avatar Laurent Montel 😁

Fix Bug 420740 - adding of inline images broken

BUG: 420740

Need to backport to 5.14 branch

(cherry picked from commit de50cca4)
parent 010bb5fb
......@@ -30,7 +30,7 @@ set(KLDAP_LIB_VERSION "5.14.0")
set(KMAILTRANSPORT_LIB_VERSION "5.14.0")
set(KMBOX_LIB_VERSION "5.14.0")
set(KMIME_LIB_VERSION "5.14.0")
set(KPIMTEXTEDIT_LIB_VERSION "5.14.0")
set(KPIMTEXTEDIT_LIB_VERSION "5.14.1")
set(LIBKDEPIM_LIB_VERSION "5.14.0")
set(LIBKLEO_LIB_VERSION "5.14.0")
set(PIMCOMMON_LIB_VERSION "5.14.0")
......
......@@ -27,6 +27,7 @@
#include <grantlee/markupdirector.h>
#include <grantlee/plaintextmarkupbuilder.h>
#include <KPIMTextEdit/TextHTMLBuilder>
#include <KPIMTextEdit/MarkupDirector>
using namespace MessageComposer;
......@@ -198,17 +199,19 @@ void RichTextComposerNg::fillComposerTextPart(MessageComposer::TextPart *textPar
#ifdef USE_TEXTHTML_BUILDER
KPIMTextEdit::TextHTMLBuilder *pb = new KPIMTextEdit::TextHTMLBuilder();
Grantlee::MarkupDirector *pmd = new Grantlee::MarkupDirector(pb);
KPIMTextEdit::MarkupDirector *pmd = new KPIMTextEdit::MarkupDirector(pb);
pmd->processDocument(document());
QString cleanHtml = QStringLiteral("<html>\n<head>\n<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n</head>\n<body>%1</body>\n</html>").arg(pb->getResult());
delete pmd;
delete pb;
d->fixHtmlFontSize(cleanHtml);
textPart->setCleanHtml(cleanHtml);
//qDebug() << " cleanHtml grantlee builder" << cleanHtml;
#else
QString cleanHtml = d->toCleanHtml();
d->fixHtmlFontSize(cleanHtml);
textPart->setCleanHtml(cleanHtml);
qDebug() << "cleanHtml " << cleanHtml;
#endif
textPart->setEmbeddedImages(composerControler()->composerImages()->embeddedImages());
}
......
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