X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8850cbd3c3f4e714e6883d3ff8e4ac58144427bc..770ddb3ff7afe5711fdf58f6aa9215e6e4ad6fde:/src/msw/dcprint.cpp?ds=sidebyside diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index e817ba1989..5c90a1f9e5 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -45,12 +45,10 @@ #include "wx/dcprint.h" #include "wx/printdlg.h" -#include "math.h" - -#if wxUSE_COMMON_DIALOGS - #include -#endif +#include "wx/msw/printdlg.h" +#include "wx/math.h" +#include "wx/msw/wrapcdlg.h" #ifndef __WIN32__ #include #endif @@ -181,7 +179,7 @@ bool wxPrinterDC::StartDoc(const wxString& message) wxString filename(m_printData.GetFilename()); - if (filename.IsEmpty()) + if (filename.empty()) docinfo.lpszOutput = NULL; else docinfo.lpszOutput = (const wxChar *) filename; @@ -277,16 +275,28 @@ static bool wxGetDefaultDeviceName(wxString& deviceName, wxString& portName) GlobalFree(pd.hDevMode); pd.hDevMode=NULL; } - return ( deviceName != wxEmptyString ); + return ( !deviceName.empty() ); } // Gets an HDC for the specified printer configuration WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst) { +#if defined(__WXUNIVERSAL__) && (!defined(__WXMSW__) || wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW) + +#if 0 + wxPostScriptPrintNativeData *data = + (wxPostScriptPrintNativeData *) printDataConst.GetNativeData(); + // FIXME: how further ??? +#else + return 0; +#endif + +#else // Postscript vs. native Windows + wxWindowsPrintNativeData *data = (wxWindowsPrintNativeData *) printDataConst.GetNativeData(); - - data->ConvertFrom( printDataConst ); + + data->TransferFrom( printDataConst ); wxChar* driverName = (wxChar*) NULL; @@ -301,7 +311,7 @@ WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst) LPDEVMODE lpDevMode = (LPDEVMODE) NULL; - HGLOBAL hDevMode = (HGLOBAL)(DWORD) data->GetNativeData(); + HGLOBAL hDevMode = (HGLOBAL)(DWORD) data->GetDevMode(); if ( hDevMode ) lpDevMode = (DEVMODE*) GlobalLock(hDevMode); @@ -327,6 +337,7 @@ WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst) GlobalUnlock(hDevMode); return (WXHDC) hDC; +#endif } // ----------------------------------------------------------------------------