X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae500232a4e961a567a5fb375fcf4f4a23216bd2..fb8a56b77ce195d0bd9ac6984e3e5cbb7136faca:/src/common/cmndata.cpp diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index 08e3e0cf09..9264f0e48f 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "cmndata.h" #endif @@ -48,13 +48,12 @@ #endif // wxUSE_PRINTING_ARCHITECTURE #ifdef __WXMSW__ - #include + #include #include "wx/msw/private.h" - #if !defined(__WIN32__) - #include + #ifndef __SMARTPHONE__ #include - #endif // Win16 + #endif #if defined(__WATCOMC__) || defined(__SYMANTEC__) || defined(__SALFORDC__) #include @@ -89,12 +88,9 @@ wxColourData::wxColourData() { - int i; - for (i = 0; i < 16; i++) - m_custColours[i].Set(255, 255, 255); - - m_chooseFull = FALSE; + m_chooseFull = false; m_dataColour.Set(0,0,0); + // m_custColours are wxNullColours initially } wxColourData::wxColourData(const wxColourData& data) @@ -109,16 +105,15 @@ wxColourData::~wxColourData() void wxColourData::SetCustomColour(int i, const wxColour& colour) { - if (i > 15 || i < 0) - return; + wxCHECK_RET( (i >= 0 && i < 16), _T("custom colour index out of range") ); m_custColours[i] = colour; } wxColour wxColourData::GetCustomColour(int i) { - if (i > 15 || i < 0) - return wxColour(0,0,0); + wxCHECK_MSG( (i >= 0 && i < 16), wxColour(0,0,0), + _T("custom colour index out of range") ); return m_custColours[i]; } @@ -214,6 +209,10 @@ wxPrintData::wxPrintData() m_printerTranslateX = 0; m_printerTranslateY = 0; m_printMode = wxPRINT_MODE_FILE; + +#ifdef wxUSE_STREAMS + m_outputstream = NULL; +#endif } wxPrintData::wxPrintData(const wxPrintData& printData) @@ -327,7 +326,11 @@ void wxPrintData::ConvertToNative() pd.lStructSize = 66; #else memset(&pd, 0, sizeof(PRINTDLG)); +#ifdef __WXWINCE__ + pd.cbStruct = sizeof(PRINTDLG); +#else pd.lStructSize = sizeof(PRINTDLG); +#endif #endif pd.hwndOwner = (HWND)NULL; @@ -383,10 +386,8 @@ void wxPrintData::ConvertToNative() //// Collation -#ifndef __WIN16__ devMode->dmCollate = (m_printCollate ? DMCOLLATE_TRUE : DMCOLLATE_FALSE); devMode->dmFields |= DM_COLLATE; -#endif //// Number of copies @@ -509,7 +510,6 @@ void wxPrintData::ConvertFromNative() //// Collation -#ifndef __WIN16__ if (devMode->dmFields & DM_COLLATE) { if (devMode->dmCollate == DMCOLLATE_TRUE) @@ -517,7 +517,6 @@ void wxPrintData::ConvertFromNative() else m_printCollate = FALSE; } -#endif //// Number of copies @@ -709,6 +708,9 @@ void wxPrintData::operator=(const wxPrintData& data) m_printQuality = data.m_printQuality; m_paperId = data.m_paperId; m_paperSize = data.m_paperSize; +#ifdef wxUSE_STREAMS + m_outputstream = data.m_outputstream; +#endif // PostScript-specific data m_printerCommand = data.m_printerCommand; @@ -773,10 +775,10 @@ wxPrintDialogData::wxPrintDialogData(const wxPrintData& printData) #ifdef __WXMSW__ m_printDlgData = NULL; #endif - m_printFromPage = 0; + m_printFromPage = 1; m_printToPage = 0; - m_printMinPage = 0; - m_printMaxPage = 0; + m_printMinPage = 1; + m_printMaxPage = 9999; m_printNoCopies = 1; m_printAllPages = FALSE; m_printCollate = FALSE; @@ -894,7 +896,7 @@ void wxPrintDialogData::ConvertToNative() pd->Flags |= PD_NOSELECTION; if ( !m_printEnablePageNumbers ) pd->Flags |= PD_NOPAGENUMS; - else if ( (!m_printAllPages) && (!m_printSelection) ) + else if ( (!m_printAllPages) && (!m_printSelection) && (m_printFromPage != 0) && (m_printToPage != 0)) pd->Flags |= PD_PAGENUMS; if ( m_printEnableHelp ) pd->Flags |= PD_SHOWHELP; @@ -933,7 +935,7 @@ void wxPrintDialogData::ConvertFromNative() } // Now convert the DEVMODE object, passed down from the PRINTDLG object, - // into wxWindows form. + // into wxWidgets form. m_printData.ConvertFromNative(); m_printFromPage = pd->nFromPage;