X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8b5d5223d164a3b7fbacc5e69808cadd25163b1b..2a7367398e5f0378986522bc5686fb05a90dccda:/src/msw/printdlg.cpp diff --git a/src/msw/printdlg.cpp b/src/msw/printdlg.cpp index 3b01b5b5b1..abe7e64ad4 100644 --- a/src/msw/printdlg.cpp +++ b/src/msw/printdlg.cpp @@ -215,7 +215,7 @@ bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data ) // Shouldn't really get here wxFAIL_MSG(wxT("Couldn't find paper size in paper database.")); data.SetPaperId( wxPAPER_NONE ); - data.SetPaperSize( wxSize() ); + data.SetPaperSize( wxSize(0,0) ); } } else @@ -223,7 +223,7 @@ bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data ) // Shouldn't really get here wxFAIL_MSG(wxT("Paper database wasn't initialized in wxPrintData::ConvertFromNative.")); data.SetPaperId( wxPAPER_NONE ); - data.SetPaperSize( wxSize() ); + data.SetPaperSize( wxSize(0,0) ); } } else if ((devMode->dmFields & DM_PAPERWIDTH) && (devMode->dmFields & DM_PAPERLENGTH)) @@ -237,7 +237,7 @@ bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data ) // Shouldn't really get here wxFAIL_MSG(wxT("Couldn't find paper size from DEVMODE.")); data.SetPaperId( wxPAPER_NONE ); - data.SetPaperSize( wxSize() ); + data.SetPaperSize( wxSize(0,0) ); } //// Duplex @@ -279,6 +279,11 @@ bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data ) else data.SetQuality( wxPRINT_QUALITY_HIGH ); + if (devMode->dmDriverExtra > 0) + data.SetPrivData( (char *)devMode+devMode->dmSize, devMode->dmDriverExtra ); + else + data.SetPrivData( NULL, 0 ); + GlobalUnlock(hDevMode); } @@ -469,6 +474,12 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data ) } devMode->dmPrintQuality = quality; devMode->dmFields |= DM_PRINTQUALITY; + + if (data.GetPrivDataLen() > 0) + { + memcpy( (char *)devMode+devMode->dmSize, data.GetPrivData(), data.GetPrivDataLen() ); + devMode->dmDriverExtra = data.GetPrivDataLen(); + } if (data.GetBin() != wxPRINTBIN_DEFAULT) {