X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b5a1cc93f3dd16d5f7f9e9c205462b91cdc9594b..12bb29f5432174ecbd65549bda832d70d34a98ae:/src/richtext/richtextprint.cpp diff --git a/src/richtext/richtextprint.cpp b/src/richtext/richtextprint.cpp index a3c8d11522..59c331d02f 100644 --- a/src/richtext/richtextprint.cpp +++ b/src/richtext/richtextprint.cpp @@ -105,16 +105,16 @@ void wxRichTextPrintout::OnPreparePrinting() { // New page starting at this line int newY = rect.y; - + // We increase the offset by the difference between new and old positions - + int increaseOffsetBy = lineY - newY; yOffset += increaseOffsetBy; - + m_pageBreaksStart.Add(lastStartPos); m_pageBreaksEnd.Add(lastLine->GetAbsoluteRange().GetEnd()); m_pageYOffsets.Add(yOffset); - + lastStartPos = line->GetAbsoluteRange().GetStart(); m_numPages ++; } @@ -146,12 +146,9 @@ void wxRichTextPrintout::OnPreparePrinting() } // Closing page break - if (m_pageBreaksStart.GetCount() == 0 || (m_pageBreaksEnd[m_pageBreaksEnd.GetCount()-1] < (GetRichTextBuffer()->GetOwnRange().GetEnd()-1))) - { - m_pageBreaksStart.Add(lastStartPos); - m_pageBreaksEnd.Add(GetRichTextBuffer()->GetOwnRange().GetEnd()); - m_pageYOffsets.Add(yOffset); - } + m_pageBreaksStart.Add(lastStartPos); + m_pageBreaksEnd.Add(GetRichTextBuffer()->GetOwnRange().GetEnd()); + m_pageYOffsets.Add(yOffset); } }