{
wxBusyCursor wait;
- m_numPages = 0;
+ m_numPages = 1;
m_pageBreaksStart.Clear();
m_pageBreaksEnd.Clear();
}
// Closing page break
- if (m_pageBreaksStart.GetCount() > 0 && (m_pageBreaksEnd[m_pageBreaksEnd.GetCount()-1] < (GetRichTextBuffer()->GetRange().GetEnd()-1)))
+ if (m_pageBreaksStart.GetCount() == 0 || (m_pageBreaksEnd[m_pageBreaksEnd.GetCount()-1] < (GetRichTextBuffer()->GetRange().GetEnd()-1)))
{
m_pageBreaksStart.Add(lastStartPos);
m_pageBreaksEnd.Add(GetRichTextBuffer()->GetRange().GetEnd());
- m_numPages ++;
}
}
}
return m_printData;
}
+/// Set print and page setup data
+void wxRichTextPrinting::SetPrintData(const wxPrintData& printData)
+{
+ (*GetPrintData()) = printData;
+}
+
+void wxRichTextPrinting::SetPageSetupData(const wxPageSetupData& pageSetupData)
+{
+ (*GetPageSetupData()) = pageSetupData;
+}
+
/// Set the rich text buffer pointer, deleting the existing object if present
void wxRichTextPrinting::SetRichTextBufferPrinting(wxRichTextBuffer* buf)
{