Commit de50cca4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix Bug 420740 - adding of inline images broken

BUG: 420740

Need to backport to 5.14 branch
parent abf1ebd2
......@@ -29,7 +29,7 @@ set(KLDAP_LIB_VERSION "5.14.40")
set(KMAILTRANSPORT_LIB_VERSION "5.14.40")
set(KMBOX_LIB_VERSION "5.14.40")
set(KMIME_LIB_VERSION "5.14.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.14.41")
set(KPIMTEXTEDIT_LIB_VERSION "5.14.42")
set(LIBKDEPIM_LIB_VERSION "5.14.41")
set(LIBKLEO_LIB_VERSION "5.14.40")
set(PIMCOMMON_LIB_VERSION "5.14.40")
......
......@@ -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