X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f4b6ffa972c0bbbe21a2fde76075f915cff04541..5c737c4c37eb7d0687e06e005678299fe8557bc4:/src/common/cmndata.cpp?ds=sidebyside diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index c863c5ba73..de57dda478 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -181,7 +181,7 @@ wxPrintData::wxPrintData() m_macPrintSettings = kPMNoPrintSettings; #else m_macPrintInfo = (THPrint) NewHandleClear( sizeof( TPrint ) ) ; - (**m_macPrintInfo).iPrVersion = 0; // something invalid + (**m_macPrintInfo).iPrVersion = 0; // something invalid (**m_macPrintInfo).prInfo.iHRes = 72; (**m_macPrintInfo).prInfo.iVRes = 72; @@ -190,8 +190,8 @@ wxPrintData::wxPrintData() Rect r2 = { -18, -36, 8*72 - 18, 11*72 - 36 } ; (**m_macPrintInfo).rPaper = r2; - (**m_macPrintInfo).prStl.iPageV = 11 * 120 ; // 11 inches in 120th of an inch - (**m_macPrintInfo).prStl.iPageH = 8 * 120 ; // 8 inches in 120th of an inch + (**m_macPrintInfo).prStl.iPageV = 11 * 120 ; // 11 inches in 120th of an inch + (**m_macPrintInfo).prStl.iPageH = 8 * 120 ; // 8 inches in 120th of an inch #endif #endif m_printOrientation = wxPORTRAIT; @@ -259,7 +259,7 @@ wxPrintData::~wxPrintData() } #else wxASSERT( m_macPrintInfo ) ; - // we should perhaps delete + // we should perhaps delete #endif #endif } @@ -589,7 +589,11 @@ void wxPrintData::ConvertFromNative() #ifndef __WXWINE__ //// Paper size - if (devMode->dmFields & DM_PAPERSIZE) + // We don't know size of user defined paper and some buggy drivers + // set both DM_PAPERSIZE and DM_PAPERWIDTH & DM_PAPERLENGTH. Since + // dmPaperSize >= DMPAPER_USER wouldn't be in wxWin's database, this + // code wouldn't set m_paperSize correctly. + if ((devMode->dmFields & DM_PAPERSIZE) && (devMode->dmPaperSize < DMPAPER_USER)) { if (wxThePrintPaperDatabase) { @@ -915,11 +919,11 @@ void wxPrintDialogData::ConvertToNative() m_printData.SetNativeDataDevNames((void*) NULL); pd->hDC = (HDC) NULL; - pd->nFromPage = (UINT)m_printFromPage; - pd->nToPage = (UINT)m_printToPage; - pd->nMinPage = (UINT)m_printMinPage; - pd->nMaxPage = (UINT)m_printMaxPage; - pd->nCopies = (UINT)m_printNoCopies; + pd->nFromPage = (WORD)m_printFromPage; + pd->nToPage = (WORD)m_printToPage; + pd->nMinPage = (WORD)m_printMinPage; + pd->nMaxPage = (WORD)m_printMaxPage; + pd->nCopies = (WORD)m_printNoCopies; pd->Flags = PD_RETURNDC ; @@ -942,7 +946,7 @@ void wxPrintDialogData::ConvertToNative() if ( m_printAllPages ) pd->Flags |= PD_ALLPAGES; - if ( m_printAllPages ) + if ( m_printSelection ) pd->Flags |= PD_SELECTION; if ( m_printCollate ) pd->Flags |= PD_COLLATE;