X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6aa89a22b8e47000c98bff05c6f545f331f1c353..1978421a6d8b81c1f8a961da4b8ddf544fec7b1b:/src/generic/dcpsg.cpp?ds=sidebyside diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index f53091ad05..01abae5421 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "dcpsg.h" #endif @@ -1564,7 +1564,7 @@ void wxPostScriptDC::DoDrawSpline( wxList *points ) double a, b, c, d, x1, y1, x2, y2, x3, y3; wxPoint *p, *q; - wxNode *node = points->GetFirst(); + wxList::compatibility_iterator node = points->GetFirst(); p = (wxPoint *)node->GetData(); x1 = p->x; y1 = p->y; @@ -1586,7 +1586,7 @@ void wxPostScriptDC::DoDrawSpline( wxList *points ) CalcBoundingBox( (wxCoord)x1, (wxCoord)y1 ); CalcBoundingBox( (wxCoord)x3, (wxCoord)y3 ); - while ((node = node->GetNext()) != NULL) + while ((node = node->GetNext())) { q = (wxPoint *)node->GetData(); @@ -1745,7 +1745,7 @@ bool wxPostScriptDC::StartDoc( const wxString& message ) // fprintf( m_pstream, "%%%%Pages: %d\n", (wxPageNumber - 1) ); - char *paper = "A4"; + const char *paper; switch (m_printData.GetPaperId()) { case wxPAPER_LETTER: paper = "Letter"; break; // Letter: paper ""; 8 1/2 by 11 inches @@ -1881,6 +1881,8 @@ void wxPostScriptDC::EndDoc () wxString command; command += m_printData.GetPrinterCommand(); command += wxT(" "); + command += m_printData.GetPrinterOptions(); + command += wxT(" "); command += m_printData.GetFilename(); wxExecute( command, TRUE ); @@ -1988,6 +1990,8 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string, { if (x) (*x) = 0; if (y) (*y) = 0; + if (descent) (*descent) = 0; + if (externalLeading) (*externalLeading) = 0; return; } @@ -2282,13 +2286,15 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string, / the correct way would be to map the character names / like 'adieresis' to corresp. positions of ISOEnc and read / these values from AFM files, too. Maybe later ... */ - lastWidths[196] = lastWidths['A']; // Ä - lastWidths[228] = lastWidths['a']; // ä - lastWidths[214] = lastWidths['O']; // Ö - lastWidths[246] = lastWidths['o']; // ö - lastWidths[220] = lastWidths['U']; // Ü - lastWidths[252] = lastWidths['u']; // ü - lastWidths[223] = lastWidths[251]; // ß + + // NB: casts to int are needed to suppress gcc 3.3 warnings + lastWidths[196] = lastWidths[(int)'A']; // Ä + lastWidths[228] = lastWidths[(int)'a']; // ä + lastWidths[214] = lastWidths[(int)'O']; // Ö + lastWidths[246] = lastWidths[(int)'o']; // ö + lastWidths[220] = lastWidths[(int)'U']; // Ü + lastWidths[252] = lastWidths[(int)'u']; // ü + lastWidths[223] = lastWidths[(int)251]; // ß /* JC: calculate UnderlineThickness/UnderlinePosition */ @@ -2314,7 +2320,7 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string, if(lastWidths[*p]== INT_MIN) { wxLogDebug(wxT("GetTextExtent: undefined width for character '%c' (%d)"), *p,*p); - sum += lastWidths[' ']; /* assume space */ + sum += lastWidths[(unsigned char)' ']; /* assume space */ } else {