]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/printdlg.cpp
Take src x, y into account when blitting with alpha
[wxWidgets.git] / src / msw / printdlg.cpp
index 3b01b5b5b14205d48b31250c083dc0e5379ca18b..02892c45100bbaeae8049e8391bbf4bacb1abdfd 100644 (file)
@@ -44,9 +44,7 @@
 
 #include <stdlib.h>
 
-#include "wx/msw/private.h"
-
-#include <commdlg.h>
+#include "wx/msw/wrapcdlg.h"
 
 #ifndef __WIN32__
     #include <print.h>
@@ -215,7 +213,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 +221,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 +235,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 +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())