- PRINTDLG *pd = (PRINTDLG*) printData;
- if ( pd == NULL )
- {
- pd = new PRINTDLG;
- printData = (void*) pd;
-
- // GNU-WIN32 has the wrong size PRINTDLG - can't work out why.
-// pd->lStructSize = sizeof(PRINTDLG);
- pd->lStructSize = 66 ;
- pd->hwndOwner = (HWND)NULL;
- pd->hDevMode = NULL; // Will be created by PrintDlg
- pd->hDevNames = NULL; // Ditto
-
- pd->Flags = PD_RETURNDEFAULT;
- pd->nCopies = 1;
-
- // Fill out the DEVMODE structure
- // so we can use it as input in the 'real' PrintDlg
- if (!PrintDlg(pd))
- {
- if ( pd->hDevMode )
- GlobalFree(pd->hDevMode);
- if ( pd->hDevNames )
- GlobalFree(pd->hDevNames);
- pd->hDevMode = NULL;
- pd->hDevNames = NULL;
- }
- else
- {
- if ( pd->hDevNames )
- GlobalFree(pd->hDevNames);
- pd->hDevNames = NULL;
- }
- }
-
- if ( pd->hDevMode )
- {
- DEVMODE *devMode = (DEVMODE*) GlobalLock(pd->hDevMode);
- devMode->dmOrientation = printOrientation;
- devMode->dmFields = DM_ORIENTATION;
- GlobalUnlock(pd->hDevMode);
- }
- pd->hDC = (HDC) NULL;
- pd->nFromPage = (UINT)printFromPage;
- pd->nToPage = (UINT)printToPage;
- pd->nMinPage = (UINT)printMinPage;
- pd->nMaxPage = (UINT)printMaxPage;
- pd->nCopies = (UINT)printNoCopies;
-
- pd->Flags = PD_RETURNDC ;
-// pd->lStructSize = sizeof( PRINTDLG );
- pd->lStructSize = 66 ;
- pd->hwndOwner=(HWND)NULL;
- pd->hDevNames=(HANDLE)NULL;
- pd->hInstance=(HINSTANCE)NULL;
- pd->lCustData = (LPARAM) NULL;
- pd->lpfnPrintHook = NULL;
- pd->lpfnSetupHook = NULL;
- pd->lpPrintTemplateName = NULL;
- pd->lpSetupTemplateName = NULL;
- pd->hPrintTemplate = (HGLOBAL) NULL;
- pd->hSetupTemplate = (HGLOBAL) NULL;
-
- if ( printAllPages )
- pd->Flags |= PD_ALLPAGES;
- if ( printCollate )
- pd->Flags |= PD_COLLATE;
- if ( printToFile )
- pd->Flags |= PD_PRINTTOFILE;
- if ( !printEnablePrintToFile )
- pd->Flags |= PD_DISABLEPRINTTOFILE;
- if ( !printEnableSelection )
- pd->Flags |= PD_NOSELECTION;
- if ( !printEnablePageNumbers )
- pd->Flags |= PD_NOPAGENUMS;
- if ( printEnableHelp )
- pd->Flags |= PD_SHOWHELP;
- if ( printSetupDialog )
- pd->Flags |= PD_PRINTSETUP;
+ m_printFromPage = data.m_printFromPage;
+ m_printToPage = data.m_printToPage;
+ m_printMinPage = data.m_printMinPage;
+ m_printMaxPage = data.m_printMaxPage;
+ m_printNoCopies = data.m_printNoCopies;
+ m_printAllPages = data.m_printAllPages;
+ m_printCollate = data.m_printCollate;
+ m_printToFile = data.m_printToFile;
+ m_printSelection = data.m_printSelection;
+ m_printEnableSelection = data.m_printEnableSelection;
+ m_printEnablePageNumbers = data.m_printEnablePageNumbers;
+ m_printEnableHelp = data.m_printEnableHelp;
+ m_printEnablePrintToFile = data.m_printEnablePrintToFile;
+ m_printData = data.m_printData;