Commit f310452d authored by Glen Ditchfield's avatar Glen Ditchfield 🐛
Browse files

Print a footer if a page break occurs inside a journal rntry

parent 2ac1a783
Pipeline #68235 passed with stage
in 6 minutes and 33 seconds
......@@ -2167,11 +2167,14 @@ void CalPrintPluginBase::drawTextLines(QPainter &p, const QString &entry, int x,
QStringList textLine = ww.wrappedString().split(QLatin1Char('\n'));
// print each individual line
for (int lineCount = 0; lineCount < textLine.count(); lineCount++) {
y += fm.height();
if (y >= pageHeight) {
y = 0;
if (mPrintFooter) {
drawFooter(p, {0, pageHeight, width, footerHeight()});
}
y = fm.height();
mPrinter->newPage();
}
y += fm.height();
p.drawText(x, y, textLine[lineCount]);
}
}
......@@ -2192,6 +2195,9 @@ void CalPrintPluginBase::drawJournal(const KCalendarCore::Journal::Ptr &journal,
QRect rect(p.boundingRect(x, y, width, -1, Qt::TextWordWrap, headerText));
if (rect.bottom() > pageHeight) {
if (mPrintFooter) {
drawFooter(p, {0, pageHeight, width, footerHeight()});
}
// Start new page...
y = 0;
mPrinter->newPage();
......
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