Fix for page break problem: fixes #14429

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71857 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2012-06-25 08:02:32 +00:00
parent 8f71e657f3
commit e58471c77f

View File

@@ -105,16 +105,16 @@ void wxRichTextPrintout::OnPreparePrinting()
{ {
// New page starting at this line // New page starting at this line
int newY = rect.y; int newY = rect.y;
// We increase the offset by the difference between new and old positions // We increase the offset by the difference between new and old positions
int increaseOffsetBy = lineY - newY; int increaseOffsetBy = lineY - newY;
yOffset += increaseOffsetBy; yOffset += increaseOffsetBy;
m_pageBreaksStart.Add(lastStartPos); m_pageBreaksStart.Add(lastStartPos);
m_pageBreaksEnd.Add(lastLine->GetAbsoluteRange().GetEnd()); m_pageBreaksEnd.Add(lastLine->GetAbsoluteRange().GetEnd());
m_pageYOffsets.Add(yOffset); m_pageYOffsets.Add(yOffset);
lastStartPos = line->GetAbsoluteRange().GetStart(); lastStartPos = line->GetAbsoluteRange().GetStart();
m_numPages ++; m_numPages ++;
} }
@@ -146,12 +146,9 @@ void wxRichTextPrintout::OnPreparePrinting()
} }
// Closing page break // 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_pageBreaksStart.Add(lastStartPos); m_pageYOffsets.Add(yOffset);
m_pageBreaksEnd.Add(GetRichTextBuffer()->GetOwnRange().GetEnd());
m_pageYOffsets.Add(yOffset);
}
} }
} }