Commit 9f98c010 authored by Stefan Brüns's avatar Stefan Brüns Committed by Albert Astals Cid

[EPubGenerator] Avoid crashes due to bogus wrapping of content in table

Summary:
QTextDocument chokes badly when a some documents are wrapped inside
a table, returning e.g. a pagecount of -41292 afterwards.

On the downside, this removes any padding from the page. On the upside,
it removes any padding from the page.

BUG: 406738
BUG: 407140
CCBUG: 406116

Reviewers: #okular

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D20949
parent d121461b
......@@ -296,13 +296,7 @@ QTextDocument* Converter::convert( const QString &fileName )
QTextBlock before;
if(firstPage) {
// preHtml & postHtml make it possible to have a margin around the content of the page
const QString preHtml = QString::fromLatin1("<html><head></head><body>"
"<table style=\"-qt-table-type: root; margin-top:%1px; margin-bottom:%1px; margin-left:%1px; margin-right:%1px;\">"
"<tr>"
"<td style=\"border: none;\">").arg(mTextDocument->padding);
const QString postHtml = QStringLiteral("</tr></table></body></html>");
mTextDocument->setHtml(preHtml + htmlContent + postHtml);
mTextDocument->setHtml(htmlContent);
firstPage = false;
before = mTextDocument->begin();
} else {
......
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