diff --git a/libs/textlayout/KoTextLayoutNoteArea.cpp b/libs/textlayout/KoTextLayoutNoteArea.cpp --- a/libs/textlayout/KoTextLayoutNoteArea.cpp +++ b/libs/textlayout/KoTextLayoutNoteArea.cpp @@ -138,7 +138,11 @@ bool contNotNeeded = KoTextLayoutArea::layout(cursor); - d->labelYOffset += block.layout()->lineAt(0).ascent(); + QTextLine blockLayoutLine = block.layout()->lineAt(0); + + if (blockLayoutLine.isValid()) { + d->labelYOffset += blockLayoutLine.ascent(); + } if (!contNotNeeded) { QString contNote = notesConfig->footnoteContinuationForward(); diff --git a/libs/textlayout/KoTextLayoutTableArea.cpp b/libs/textlayout/KoTextLayoutTableArea.cpp --- a/libs/textlayout/KoTextLayoutTableArea.cpp +++ b/libs/textlayout/KoTextLayoutTableArea.cpp @@ -460,8 +460,9 @@ cursor->headerPositionX = d->columnPositions[0]; if (!virginPage() && d->totalMisFit) { - //if we couldn't fit the header rows plus some then don't even try - cursor->row = 0; + //if we couldn't fit the header rows + //try again don't reset cursor->row or we enter infinite loop + //cursor->row = 0; nukeRow(cursor); } }