]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextprint.cpp
fixed wx-config symlink creation with non-empty DESTDIR
[wxWidgets.git] / src / richtext / richtextprint.cpp
index 5319131f7452fa7252374e6e9b78e36c5bf36e85..8652db7c631609a86de6ccfee1503c76db10a8be 100644 (file)
@@ -80,18 +80,22 @@ void wxRichTextPrintout::OnPreparePrinting()
             // child is a paragraph
             wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph);
             wxASSERT (child != NULL);
-
+            
             wxRichTextLineList::compatibility_iterator node2 = child->GetLines().GetFirst();
             while (node2)
             {
                 wxRichTextLine* line = node2->GetData();
-                
+
                 // Set the line to the page-adjusted position
                 line->SetPosition(wxPoint(line->GetPosition().x, line->GetPosition().y - yOffset));
 
                 int lineY = child->GetPosition().y + line->GetPosition().y;
                 
-                if ((lineY + line->GetSize().y) > rect.GetBottom())
+                // Break the page if either we're going off the bottom, or this paragraph specifies
+                // an explicit page break
+                
+                if (((lineY + line->GetSize().y) > rect.GetBottom()) ||
+                    ((node2 == child->GetLines().GetFirst()) && child->GetAttributes().HasPageBreak()))
                 {
                     // New page starting at this line
                     int newY = rect.y;