Fix printing of table headers in multi-frame QTextDocuments
The calculation of page position of table headers would only work correctly for tables in the root frame of a QTextDocument. Fix by including the relative positions of subframes. Fixes: QTBUG-59000 Change-Id: I2cc7e21bddf806f7f5f9b0675ac014c339ba2453 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
parent
3d4b62a753
commit
83dccf00cc
@ -970,8 +970,14 @@ void QTextDocumentLayoutPrivate::drawFrame(const QPointF &offset, QPainter *pain
|
||||
if (pageHeight <= 0)
|
||||
pageHeight = QFIXED_MAX;
|
||||
|
||||
const int tableStartPage = (td->position.y / pageHeight).truncate();
|
||||
const int tableEndPage = ((td->position.y + td->size.height) / pageHeight).truncate();
|
||||
QFixed absYPos = td->position.y;
|
||||
QTextFrame *parentFrame = table->parentFrame();
|
||||
while (parentFrame) {
|
||||
absYPos += data(parentFrame)->position.y;
|
||||
parentFrame = parentFrame->parentFrame();
|
||||
}
|
||||
const int tableStartPage = (absYPos / pageHeight).truncate();
|
||||
const int tableEndPage = ((absYPos + td->size.height) / pageHeight).truncate();
|
||||
|
||||
qreal border = td->border.toReal();
|
||||
drawFrameDecoration(painter, frame, fd, context.clip, frameRect);
|
||||
|
Loading…
x
Reference in New Issue
Block a user