diff --git a/src/apps/stylededit/StyledEditWindow.cpp b/src/apps/stylededit/StyledEditWindow.cpp index 8b0e020aed..6886638232 100644 --- a/src/apps/stylededit/StyledEditWindow.cpp +++ b/src/apps/stylededit/StyledEditWindow.cpp @@ -1098,15 +1098,14 @@ StyledEditWindow::Print(const char *documentname) currentLine++; } } - if (currentHeight >= printable_rect.Height()) { - pagesInDocument++; - } - if (pagesInDocument - 1 == lastPage) { + if (pagesInDocument == lastPage) { lastLine = currentLine; } - currentLine++; - if (pagesInDocument == firstPage) { - firstLine = currentLine; + if (currentHeight >= printable_rect.Height()) { + pagesInDocument++; + if (pagesInDocument == firstPage) { + firstLine = currentLine; + } } }