Add PrivData() field to wxPrintData since MSW's printer

sometimes seem to save data in an extra field. The
    original author of the patch chose to save it in char*
    so I kept that, although void* would probably be correct.
    The patch is against 2.4.2 and the code has been reshuffled
    since then so that the patch had to be redone entirely.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32443 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2005-02-28 01:51:59 +00:00
parent 74124ea961
commit aa96f01c02
4 changed files with 53 additions and 1 deletions

View File

@@ -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)
{