From: Robin Dunn Date: Sat, 29 Jan 2005 01:06:10 +0000 (+0000) Subject: Call CalculatePaperSizeFromId when SetPrintData or the assignment X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/24c5243d0973b223e3813d299a5bde266c81b939 Call CalculatePaperSizeFromId when SetPrintData or the assignment operator is used. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31627 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/cmndata.h b/include/wx/cmndata.h index 95f2b7dc14..a33f276da2 100644 --- a/include/wx/cmndata.h +++ b/include/wx/cmndata.h @@ -431,7 +431,7 @@ public: wxPageSetupDialogData& operator=(const wxPrintData& data); wxPrintData& GetPrintData() { return m_printData; } - void SetPrintData(const wxPrintData& printData) { m_printData = printData; } + void SetPrintData(const wxPrintData& printData); private: wxSize m_paperSize; // The dimensions selected by the user (on return, same as in wxPrintData?) diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index bb44120bcf..d34be064ac 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -610,6 +610,7 @@ wxPageSetupDialogData& wxPageSetupDialogData::operator=(const wxPageSetupDialogD wxPageSetupDialogData& wxPageSetupDialogData::operator=(const wxPrintData& data) { m_printData = data; + CalculatePaperSizeFromId(); return *this; } @@ -661,6 +662,12 @@ void wxPageSetupDialogData::SetPaperSize(wxPaperSize id) CalculatePaperSizeFromId(); } +void wxPageSetupDialogData::SetPrintData(const wxPrintData& printData) +{ + m_printData = printData; + CalculatePaperSizeFromId(); +} + // Use paper size defined in this object to set the wxPrintData // paper id void wxPageSetupDialogData::CalculateIdFromPaperSize()