X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f31a409829d5d410f38e64896470afcaff12635b..172541f64be8fcddb08f1c121da256d08c24a70b:/src/msw/printdlg.cpp diff --git a/src/msw/printdlg.cpp b/src/msw/printdlg.cpp index 56e9af2adb..02892c4510 100644 --- a/src/msw/printdlg.cpp +++ b/src/msw/printdlg.cpp @@ -44,9 +44,7 @@ #include -#include "wx/msw/private.h" - -#include +#include "wx/msw/wrapcdlg.h" #ifndef __WIN32__ #include @@ -279,6 +277,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); } @@ -297,7 +300,7 @@ bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data ) wxString printerName = (LPTSTR)lpDevNames + lpDevNames->wDeviceOffset; // Not sure if we should check for this mismatch -// wxASSERT_MSG( (m_printerName == "" || (devName == m_printerName)), "Printer name obtained from DEVMODE and DEVNAMES were different!"); +// wxASSERT_MSG( (m_printerName.empty() || (devName == m_printerName)), "Printer name obtained from DEVMODE and DEVNAMES were different!"); if (!printerName.empty()) data.SetPrinterName( printerName ); @@ -470,6 +473,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 = (WXWORD)data.GetPrivDataLen(); + } + if (data.GetBin() != wxPRINTBIN_DEFAULT) { switch (data.GetBin())