summaryrefslogtreecommitdiff
path: root/vcl/unx/source/gdi/xfont.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2001-10-12 15:22:10 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2001-10-12 15:22:10 +0000
commit03cac15ad7f78df6a0ae9ca887e385d49e16e010 (patch)
treeae32ac996ebfca062bac3d52e7c929e18c5b8306 /vcl/unx/source/gdi/xfont.cxx
parentd8275cd63bd0821842c5b27250cb32dbe90e9407 (diff)
#92830#: required change: std::min()/std::max()
Diffstat (limited to 'vcl/unx/source/gdi/xfont.cxx')
-rw-r--r--vcl/unx/source/gdi/xfont.cxx28
1 files changed, 15 insertions, 13 deletions
diff --git a/vcl/unx/source/gdi/xfont.cxx b/vcl/unx/source/gdi/xfont.cxx
index 9c9a5297a78e..93e3abacbe29 100644
--- a/vcl/unx/source/gdi/xfont.cxx
+++ b/vcl/unx/source/gdi/xfont.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xfont.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: hdu $ $Date: 2001-07-11 14:45:50 $
+ * last change: $Author: hr $ $Date: 2001-10-12 16:22:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -81,6 +81,8 @@
#include <stdio.h>
#endif
+#include <algorithm>
+
#define VCLASS_ROTATE 0
#define VCLASS_ROTATE_REVERSE 1
#define VCLASS_TRANSFORM1 2
@@ -173,20 +175,20 @@ ExtendedFontStruct::GetFontBoundingBox( XCharStruct *pCharStruct,
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 +216,7 @@ ExtendedFontStruct::ToImplFontMetricData(ImplFontMetricData *pFontMetric)
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;
@@ -382,9 +384,9 @@ ExtendedFontStruct::GetCharWidth8( sal_Unicode nFrom, sal_Unicode nTo,
int nIdx = nFrom;
- for ( ; nIdx < min(nTo, nMinChar); nIdx++, pWidthArray++ )
+ for ( ; nIdx < std::min((int)nTo, nMinChar); nIdx++, pWidthArray++ )
*pWidthArray = mnDefaultWidth;
- for ( ; nIdx <= min(nTo, nMaxChar); nIdx++, pWidthArray++ )
+ for ( ; nIdx <= std::min((int)nTo, nMaxChar); nIdx++, pWidthArray++ )
{
XCharStruct* pChar = &(pXFontStruct->per_char[nIdx - nMinChar]);
*pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth;
@@ -554,7 +556,7 @@ ExtendedFontStruct::GetCharWidth( sal_Unicode nFrom, sal_Unicode nTo, long *pWid
{
// 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(nAsciiRange, (int)nTo);
nConverted = GetCharWidth8( nFrom, nMinTo, pWidthArray, nEncoding );
}