X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c1dc9f8394c1488ad8e7d945e6f943f7b34554ce..9d5507f7a2701395e1d5c121bd877bb9066ee6ea:/src/msw/printdlg.cpp diff --git a/src/msw/printdlg.cpp b/src/msw/printdlg.cpp index dc78524ee5..575fb82ffd 100644 --- a/src/msw/printdlg.cpp +++ b/src/msw/printdlg.cpp @@ -37,6 +37,7 @@ #include "wx/printdlg.h" #include "wx/msw/printdlg.h" +#include "wx/msw/dcprint.h" #include "wx/paper.h" #include @@ -638,7 +639,7 @@ int wxWindowsPrintDialog::ShowModal() if ( ret && (pd->hDC) ) { - wxPrinterDC *pdc = new wxPrinterDC( (WXHDC) pd->hDC ); + wxPrinterDC *pdc = new wxPrinterDCFromHDC( (WXHDC) pd->hDC ); m_printerDC = pdc; ConvertFromNative( m_printDialogData ); return wxID_OK; @@ -1026,7 +1027,10 @@ bool wxWindowsPageSetupDialog::ConvertFromNative( wxPageSetupDialogData &data ) data.EnableHelp( ((pd->Flags & PSD_SHOWHELP) == PSD_SHOWHELP) ); // PAGESETUPDLG is in hundreds of a mm - data.SetPaperSize( wxSize(pd->ptPaperSize.x / 100, pd->ptPaperSize.y / 100) ); + if (data.GetPrintData().GetOrientation() == wxLANDSCAPE) + data.SetPaperSize( wxSize(pd->ptPaperSize.y / 100, pd->ptPaperSize.x / 100) ); + else + data.SetPaperSize( wxSize(pd->ptPaperSize.x / 100, pd->ptPaperSize.y / 100) ); data.SetMinMarginTopLeft( wxPoint(pd->rtMinMargin.left / 100, pd->rtMinMargin.top / 100) ); data.SetMinMarginBottomRight( wxPoint(pd->rtMinMargin.right / 100, pd->rtMinMargin.bottom / 100) );