X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ea160b2e92c787857cfb32673c5ff028f64db2a3..a82e28dd0336e2829496fa1ea0f6a327cf0099c6:/src/richtext/richtextprint.cpp diff --git a/src/richtext/richtextprint.cpp b/src/richtext/richtextprint.cpp index 8652db7c63..1082eabbf1 100644 --- a/src/richtext/richtextprint.cpp +++ b/src/richtext/richtextprint.cpp @@ -50,7 +50,7 @@ void wxRichTextPrintout::OnPreparePrinting() { wxBusyCursor wait; - m_numPages = 0; + m_numPages = 1; m_pageBreaksStart.Clear(); m_pageBreaksEnd.Clear(); @@ -127,11 +127,10 @@ void wxRichTextPrintout::OnPreparePrinting() } // 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 ++; } } } @@ -190,7 +189,7 @@ void wxRichTextPrintout::RenderPage(wxDC *dc, int page) dc->SetTextForeground(m_headerFooterData.GetTextColour()); else dc->SetTextForeground(*wxBLACK); - dc->SetBackgroundMode(wxTRANSPARENT); + dc->SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT); // Draw header, if any wxRichTextOddEvenPage oddEven = ((page % 2) == 1) ? wxRICHTEXT_PAGE_ODD : wxRICHTEXT_PAGE_EVEN; @@ -439,6 +438,17 @@ wxPrintData *wxRichTextPrinting::GetPrintData() 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) {