Index: vcl/unx/source/gdi/xfont.cxx =================================================================== RCS file: /cvs/oo/gsl/vcl/unx/source/gdi/xfont.cxx,v retrieving revision 1.12 diff -u -r1.12 xfont.cxx --- vcl/unx/source/gdi/xfont.cxx 2001/04/09 10:55:07 1.12 +++ vcl/unx/source/gdi/xfont.cxx 2001/07/13 20:55:25 @@ -59,6 +59,7 @@ * ************************************************************************/ +#include #include #ifndef EXTENDED_FONTSTRUCT_HXX @@ -173,20 +174,20 @@ for ( nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ ) if ( mpXFontStruct[ nIdx ] != NULL ) { - *pAscent = max( mpXFontStruct[nIdx]->ascent, *pAscent ); - *pDescent = max( mpXFontStruct[nIdx]->descent, *pDescent ); + *pAscent = std::max( mpXFontStruct[nIdx]->ascent, *pAscent ); + *pDescent = std::max( mpXFontStruct[nIdx]->descent, *pDescent ); XCharStruct* pMaxBounds = &(mpXFontStruct[nIdx]->max_bounds); - pCharStruct->lbearing = max( pMaxBounds->lbearing, + pCharStruct->lbearing = std::max( pMaxBounds->lbearing, pCharStruct->lbearing ); - pCharStruct->rbearing = max( pMaxBounds->rbearing, + pCharStruct->rbearing = std::max( pMaxBounds->rbearing, pCharStruct->rbearing ); - pCharStruct->width = max( pMaxBounds->width, + pCharStruct->width = std::max( pMaxBounds->width, pCharStruct->width ); - pCharStruct->ascent = max( pMaxBounds->ascent, + pCharStruct->ascent = std::max( pMaxBounds->ascent, pCharStruct->ascent ); - pCharStruct->descent = max( pMaxBounds->descent, + pCharStruct->descent = std::max( pMaxBounds->descent, pCharStruct->descent ); } @@ -214,7 +215,7 @@ pFontMetric->mnWidth = aBoundingBox.width; pFontMetric->mnAscent = aBoundingBox.ascent; pFontMetric->mnDescent = aBoundingBox.descent; - pFontMetric->mnLeading = max(0, aBoundingBox.ascent - nAscent + pFontMetric->mnLeading = std::max(0, aBoundingBox.ascent - nAscent + aBoundingBox.descent - nDescent ); // XXX Fix me pFontMetric->mnFirstChar = 0; @@ -377,14 +378,14 @@ else { // variable width font - int nMinChar = pXFontStruct->min_char_or_byte2; - int nMaxChar = pXFontStruct->max_char_or_byte2; + sal_Unicode nMinChar = pXFontStruct->min_char_or_byte2; + sal_Unicode nMaxChar = pXFontStruct->max_char_or_byte2; int nIdx = nFrom; - for ( ; nIdx < min(nTo, nMinChar); nIdx++, pWidthArray++ ) + for ( ; nIdx < std::min(nTo, nMinChar); nIdx++, pWidthArray++ ) *pWidthArray = mnDefaultWidth; - for ( ; nIdx <= min(nTo, nMaxChar); nIdx++, pWidthArray++ ) + for ( ; nIdx <= std::min(nTo, nMaxChar); nIdx++, pWidthArray++ ) { XCharStruct* pChar = &(pXFontStruct->per_char[nIdx - nMinChar]); *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth; @@ -554,7 +555,7 @@ { // optimize the most frequent case, requesting only the latin1 // chars which are mappable to a single encoding - sal_Unicode nMinTo = min(nAsciiRange, nTo); + sal_Unicode nMinTo = std::min((sal_Unicode) nAsciiRange, nTo); nConverted = GetCharWidth8( nFrom, nMinTo, pWidthArray, nEncoding ); }