diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-04-11 00:21:40 -0300 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2013-04-20 11:09:54 +0000 |
commit | 0f200cc30ea75fdce59f7bb6ae87ebc85729e2a4 (patch) | |
tree | 2e2c28f9500f81825cdadcbabd131da767ddbb49 /vcl/source/gdi | |
parent | 5414a3eecdb09be928313477792acfe1d3534645 (diff) |
fdo#63154: Change Min/Max/Abs for std::min/max/abs
Now all these usages were removed from LO.
Change-Id: I8a7233db20abdcdbb18428ad4004c78cc516a0e6
Reviewed-on: https://gerrit.libreoffice.org/3326
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r-- | vcl/source/gdi/alpha.cxx | 12 | ||||
-rw-r--r-- | vcl/source/gdi/animate.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap.cxx | 24 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap3.cxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/bmpacc.cxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/cvtsvm.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 12 | ||||
-rw-r--r-- | vcl/source/gdi/impanmvw.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/impvect.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/outdev3.cxx | 16 | ||||
-rw-r--r-- | vcl/source/gdi/outdev4.cxx | 22 | ||||
-rw-r--r-- | vcl/source/gdi/outdev6.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/outmap.cxx | 24 | ||||
-rw-r--r-- | vcl/source/gdi/region.cxx | 44 |
15 files changed, 96 insertions, 96 deletions
diff --git a/vcl/source/gdi/alpha.cxx b/vcl/source/gdi/alpha.cxx index c4024137c6ff..8a58bb1a8e65 100644 --- a/vcl/source/gdi/alpha.cxx +++ b/vcl/source/gdi/alpha.cxx @@ -106,8 +106,8 @@ sal_Bool AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRect if( pWriteAcc ) { - const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); - const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); + const long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); + const long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); const long nSrcEndX = aRectSrc.Left() + nWidth; const long nSrcEndY = aRectSrc.Top() + nHeight; long nDstY = aRectDst.Top(); @@ -136,8 +136,8 @@ sal_Bool AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRect if( pWriteAcc ) { - const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); - const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); + const long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); + const long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); const long nSrcX = aRectSrc.Left(); const long nSrcY = aRectSrc.Top(); const long nSrcEndX1 = nSrcX + nWidth - 1L; @@ -197,8 +197,8 @@ sal_Bool AlphaMask::Replace( const Bitmap& rMask, sal_uInt8 cReplaceTransparency if( pMaskAcc && pAcc ) { const BitmapColor aReplace( cReplaceTransparency ); - const long nWidth = Min( pMaskAcc->Width(), pAcc->Width() ); - const long nHeight = Min( pMaskAcc->Height(), pAcc->Height() ); + const long nWidth = std::min( pMaskAcc->Width(), pAcc->Width() ); + const long nHeight = std::min( pMaskAcc->Height(), pAcc->Height() ); const BitmapColor aMaskWhite( pMaskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) ); for( long nY = 0L; nY < nHeight; nY++ ) diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index 22f82249ef43..ecac87e3d013 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -332,7 +332,7 @@ void Animation::Draw( OutputDevice* pOut, const Point& rDestPt, const Size& rDes if( nCount ) { - AnimationBitmap* pObj = maList[ Min( mnPos, nCount - 1 ) ]; + AnimationBitmap* pObj = maList[ std::min( mnPos, nCount - 1 ) ]; if( pOut->GetConnectMetaFile() || ( pOut->GetOutDevType() == OUTDEV_PRINTER ) @@ -352,7 +352,7 @@ void Animation::Draw( OutputDevice* pOut, const Point& rDestPt, const Size& rDes void Animation::ImplRestartTimer( sal_uLong nTimeout ) { - maTimer.SetTimeout( Max( nTimeout, (sal_uLong)(MIN_TIMEOUT + ( mnAnimCount - 1 ) * INC_TIMEOUT) ) * 10L ); + maTimer.SetTimeout( std::max( nTimeout, (sal_uLong)(MIN_TIMEOUT + ( mnAnimCount - 1 ) * INC_TIMEOUT) ) * 10L ); maTimer.Start(); } diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index 030bed8d75e1..c78131be8c3b 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -922,8 +922,8 @@ sal_Bool Bitmap::CopyPixel( const Rectangle& rRectDst, if( pWriteAcc ) { - const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); - const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); + const long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); + const long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); const long nSrcEndX = aRectSrc.Left() + nWidth; const long nSrcEndY = aRectSrc.Top() + nHeight; long nDstY = aRectDst.Top(); @@ -975,8 +975,8 @@ sal_Bool Bitmap::CopyPixel( const Rectangle& rRectDst, if( pWriteAcc ) { - const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); - const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); + const long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); + const long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); const long nSrcX = aRectSrc.Left(); const long nSrcY = aRectSrc.Top(); const long nSrcEndX1 = nSrcX + nWidth - 1L; @@ -1329,8 +1329,8 @@ sal_Bool Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor ) if( pMaskAcc && pAcc ) { - const long nWidth = Min( pMaskAcc->Width(), pAcc->Width() ); - const long nHeight = Min( pMaskAcc->Height(), pAcc->Height() ); + const long nWidth = std::min( pMaskAcc->Width(), pAcc->Width() ); + const long nHeight = std::min( pMaskAcc->Height(), pAcc->Height() ); const BitmapColor aMaskWhite( pMaskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) ); BitmapColor aReplace; @@ -1406,8 +1406,8 @@ sal_Bool Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor ) if( pAcc && pAlphaAcc && pNewAcc ) { BitmapColor aCol; - const long nWidth = Min( pAlphaAcc->Width(), pAcc->Width() ); - const long nHeight = Min( pAlphaAcc->Height(), pAcc->Height() ); + const long nWidth = std::min( pAlphaAcc->Width(), pAcc->Width() ); + const long nHeight = std::min( pAlphaAcc->Height(), pAcc->Height() ); for( long nY = 0L; nY < nHeight; nY++ ) { @@ -1632,8 +1632,8 @@ sal_Bool Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine ) if( pMaskAcc && pAcc ) { - const long nWidth = Min( pMaskAcc->Width(), pAcc->Width() ); - const long nHeight = Min( pMaskAcc->Height(), pAcc->Height() ); + const long nWidth = std::min( pMaskAcc->Width(), pAcc->Width() ); + const long nHeight = std::min( pMaskAcc->Height(), pAcc->Height() ); const Color aColBlack( COL_BLACK ); BitmapColor aPixel; BitmapColor aMaskPixel; @@ -1776,8 +1776,8 @@ sal_Bool Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor ) if( pAlphaAcc && pAcc ) { - const long nWidth = Min( pAlphaAcc->Width(), pAcc->Width() ); - const long nHeight = Min( pAlphaAcc->Height(), pAcc->Height() ); + const long nWidth = std::min( pAlphaAcc->Width(), pAcc->Width() ); + const long nHeight = std::min( pAlphaAcc->Height(), pAcc->Height() ); for( long nY = 0L; nY < nHeight; ++nY ) for( long nX = 0L; nX < nWidth; ++nX ) diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 99b7d7d7db01..b92d9fe7987b 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -224,7 +224,7 @@ void ImplCreateDitherMatrix( sal_uInt8 (*pDitherMatrix)[16][16] ) for ( j = 0; j < 4; j++ ) for ( k = 0; k < 4; k++ ) for ( l = 0; l < 4; l++ ) - nMax = Max ( pMtx[ (k<<2) + i][(l<<2 ) + j] = + nMax = std::max ( pMtx[ (k<<2) + i][(l<<2 ) + j] = (sal_uInt16) ( 0.5 + pMagic[i][j]*fVal + pMagic[k][l]*fVal16 ), nMax ); // Scale to interval [0;254] @@ -700,7 +700,7 @@ sal_Bool Bitmap::ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor ) pWriteAcc->SetPalette( aPal ); - for( nY = 0L; nY < Min( nHeight, 2L ); nY++, nYTmp++ ) + for( nY = 0L; nY < std::min( nHeight, 2L ); nY++, nYTmp++ ) { for( nX = 0L, pQLine2 = !nY ? pErrQuad1 : pErrQuad2; nX < nWidth; nX++ ) { @@ -1463,7 +1463,7 @@ sal_Bool Bitmap::ImplDitherFloyd16() long nYTmp = 0L; sal_Bool bQ1 = sal_True; - for( nY = 0L; nY < Min( nHeight, 2L ); nY++, nYTmp++ ) + for( nY = 0L; nY < std::min( nHeight, 2L ); nY++, nYTmp++ ) for( nX = 0L, pQLine2 = !nY ? pErrQuad1 : pErrQuad2; nX < nWidth; nX++ ) pQLine2[ nX ] = pReadAcc->GetPixel( nYTmp, nX ); @@ -1554,7 +1554,7 @@ sal_Bool Bitmap::ImplReduceSimple( sal_uInt16 nColorCount ) { Bitmap aNewBmp; BitmapReadAccess* pRAcc = AcquireReadAccess(); - const sal_uInt16 nColCount = Min( nColorCount, (sal_uInt16) 256 ); + const sal_uInt16 nColCount = std::min( nColorCount, (sal_uInt16) 256 ); sal_uInt16 nBitCount; sal_Bool bRet = sal_False; diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx index af2d0686defd..2851c4b32071 100644 --- a/vcl/source/gdi/bmpacc.cxx +++ b/vcl/source/gdi/bmpacc.cxx @@ -303,7 +303,7 @@ void BitmapWriteAccess::CopyScanline( long nY, const BitmapReadAccess& rReadAcc } else // TODO: use fastbmp infrastructure - for( long nX = 0L, nWidth = Min( mpBuffer->mnWidth, rReadAcc.Width() ); nX < nWidth; nX++ ) + for( long nX = 0L, nWidth = std::min( mpBuffer->mnWidth, rReadAcc.Width() ); nX < nWidth; nX++ ) SetPixel( nY, nX, rReadAcc.GetPixel( nY, nX ) ); } @@ -318,7 +318,7 @@ void BitmapWriteAccess::CopyScanline( long nY, ConstScanline aSrcScanline, ( !HasPalette() && nFormat > BMP_FORMAT_8BIT_PAL ), "No copying possible between palette and non palette scanlines!" ); - const sal_uLong nCount = Min( GetScanlineSize(), nSrcScanlineSize ); + const sal_uLong nCount = std::min( GetScanlineSize(), nSrcScanlineSize ); if( nCount ) { @@ -376,13 +376,13 @@ void BitmapWriteAccess::CopyBuffer( const BitmapReadAccess& rReadAcc ) if( ( GetScanlineFormat() == rReadAcc.GetScanlineFormat() ) && ( GetScanlineSize() == rReadAcc.GetScanlineSize() ) ) { - const long nHeight = Min( mpBuffer->mnHeight, rReadAcc.Height() ); + const long nHeight = std::min( mpBuffer->mnHeight, rReadAcc.Height() ); const sal_uLong nCount = nHeight * mpBuffer->mnScanlineSize; memcpy( mpBuffer->mpBits, rReadAcc.GetBuffer(), nCount ); } else - for( long nY = 0L, nHeight = Min( mpBuffer->mnHeight, rReadAcc.Height() ); nY < nHeight; nY++ ) + for( long nY = 0L, nHeight = std::min( mpBuffer->mnHeight, rReadAcc.Height() ); nY < nHeight; nY++ ) CopyScanline( nY, rReadAcc ); } diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index bdc23db0293a..63134b496917 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -860,7 +860,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) { sal_Int32 nStrLen( aStr.getLength() ); - pDXAry = new sal_Int32[ Max( nAryLen, nStrLen ) ]; + pDXAry = new sal_Int32[ std::max( nAryLen, nStrLen ) ]; for( long j = 0L; j < nAryLen; j++ ) rIStm >> nTmp, pDXAry[ j ] = nTmp; diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index da38c34e68fc..14051a604e48 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -2300,16 +2300,16 @@ void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pRepla long nVal; nVal = pSearchColors[ i ].GetRed(); - aColParam.pMinR[ i ] = (sal_uLong) Max( nVal - nTol, 0L ); - aColParam.pMaxR[ i ] = (sal_uLong) Min( nVal + nTol, 255L ); + aColParam.pMinR[ i ] = (sal_uLong) std::max( nVal - nTol, 0L ); + aColParam.pMaxR[ i ] = (sal_uLong) std::min( nVal + nTol, 255L ); nVal = pSearchColors[ i ].GetGreen(); - aColParam.pMinG[ i ] = (sal_uLong) Max( nVal - nTol, 0L ); - aColParam.pMaxG[ i ] = (sal_uLong) Min( nVal + nTol, 255L ); + aColParam.pMinG[ i ] = (sal_uLong) std::max( nVal - nTol, 0L ); + aColParam.pMaxG[ i ] = (sal_uLong) std::min( nVal + nTol, 255L ); nVal = pSearchColors[ i ].GetBlue(); - aColParam.pMinB[ i ] = (sal_uLong) Max( nVal - nTol, 0L ); - aColParam.pMaxB[ i ] = (sal_uLong) Min( nVal + nTol, 255L ); + aColParam.pMinB[ i ] = (sal_uLong) std::max( nVal - nTol, 0L ); + aColParam.pMaxB[ i ] = (sal_uLong) std::min( nVal + nTol, 255L ); } aColParam.pDstCols = pReplaceColors; diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx index 5ee810a969b3..40b86b4fb91f 100644 --- a/vcl/source/gdi/impanmvw.cxx +++ b/vcl/source/gdi/impanmvw.cxx @@ -158,7 +158,7 @@ void ImplAnimView::ImplDrawToPos( sal_uLong nPos ) Region* pOldClip = !maClip.IsNull() ? new Region( mpOut->GetClipRegion() ) : NULL; aVDev.SetOutputSizePixel( maSzPix, sal_False ); - nPos = Min( nPos, (sal_uLong) mpParent->Count() - 1UL ); + nPos = std::min( nPos, (sal_uLong) mpParent->Count() - 1UL ); for( sal_uLong i = 0UL; i <= nPos; i++ ) ImplDraw( i, &aVDev ); @@ -195,7 +195,7 @@ void ImplAnimView::ImplDraw( sal_uLong nPos, VirtualDevice* pVDev ) Size aSizePix; Size aBmpSizePix; const sal_uLong nLastPos = mpParent->Count() - 1; - const AnimationBitmap& rAnm = mpParent->Get( (sal_uInt16) ( mnActPos = Min( nPos, nLastPos ) ) ); + const AnimationBitmap& rAnm = mpParent->Get( (sal_uInt16) ( mnActPos = std::min( nPos, nLastPos ) ) ); ImplGetPosSize( rAnm, aPosPix, aSizePix ); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index be5663754b6a..2bef0db497fe 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -1091,7 +1091,7 @@ sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap ) if( pOStm ) { sal_uLong nFullLen = nHeaderLen + nLen; - sal_uLong nPartLen = Min( nFullLen, (sal_uLong) GRAPHIC_MAXPARTLEN ); + sal_uLong nPartLen = std::min( nFullLen, (sal_uLong) GRAPHIC_MAXPARTLEN ); sal_uInt8* pBuffer = (sal_uInt8*) rtl_allocateMemory( nPartLen ); pOStm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index 093d94fdbcf7..9e011a4a2b05 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -883,8 +883,8 @@ ImplVectMap* ImplVectorizer::ImplExpand( BitmapReadAccess* pRAcc, const Color& r const long nNewWidth = ( nOldWidth << 2L ) + 4L; const long nNewHeight = ( nOldHeight << 2L ) + 4L; const BitmapColor aTest( pRAcc->GetBestMatchingColor( rColor ) ); - long* pMapIn = new long[ Max( nOldWidth, nOldHeight ) ]; - long* pMapOut = new long[ Max( nOldWidth, nOldHeight ) ]; + long* pMapIn = new long[ std::max( nOldWidth, nOldHeight ) ]; + long* pMapOut = new long[ std::max( nOldWidth, nOldHeight ) ]; long nX, nY, nTmpX, nTmpY; pMap = new ImplVectMap( nNewWidth, nNewHeight ); diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 1c5f8199cd01..c1ee2f0421ec 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -6317,7 +6317,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r nMnemonicWidth = rTargetDevice.ImplLogicWidthToDevicePixel( ::abs((int)(lc_x1 - lc_x2)) ); Point aTempPos = rTargetDevice.LogicToPixel( aPos ); - nMnemonicX = rTargetDevice.GetOutOffXPixel() + aTempPos.X() + rTargetDevice.ImplLogicWidthToDevicePixel( Min( lc_x1, lc_x2 ) ); + nMnemonicX = rTargetDevice.GetOutOffXPixel() + aTempPos.X() + rTargetDevice.ImplLogicWidthToDevicePixel( std::min( lc_x1, lc_x2 ) ); nMnemonicY = rTargetDevice.GetOutOffYPixel() + aTempPos.Y() + rTargetDevice.ImplLogicWidthToDevicePixel( rTargetDevice.GetFontMetric().GetAscent() ); rTargetDevice.ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth ); } @@ -6386,7 +6386,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r nMnemonicWidth = rTargetDevice.ImplLogicWidthToDevicePixel( ::abs((int)(lc_x1 - lc_x2)) ); Point aTempPos = rTargetDevice.LogicToPixel( aPos ); - nMnemonicX = rTargetDevice.GetOutOffXPixel() + aTempPos.X() + rTargetDevice.ImplLogicWidthToDevicePixel( Min(lc_x1, lc_x2) ); + nMnemonicX = rTargetDevice.GetOutOffXPixel() + aTempPos.X() + rTargetDevice.ImplLogicWidthToDevicePixel( std::min(lc_x1, lc_x2) ); nMnemonicY = rTargetDevice.GetOutOffYPixel() + aTempPos.Y() + rTargetDevice.ImplLogicWidthToDevicePixel( rTargetDevice.GetFontMetric().GetAscent() ); } @@ -6843,9 +6843,9 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr, long lc_x2 = pCaretXArray[ 2*(nMnemonicPos - nIndex)+1 ]; nMnemonicWidth = ::abs((int)(lc_x1 - lc_x2)); - Point aTempPos( Min(lc_x1,lc_x2), GetFontMetric().GetAscent() ); + Point aTempPos( std::min(lc_x1,lc_x2), GetFontMetric().GetAscent() ); if( bInvalidPos ) // #106952#, place behind the (last) character - aTempPos = Point( Max(lc_x1,lc_x2), GetFontMetric().GetAscent() ); + aTempPos = Point( std::max(lc_x1,lc_x2), GetFontMetric().GetAscent() ); aTempPos += rPos; aTempPos = LogicToPixel( aTempPos ); @@ -7296,8 +7296,8 @@ sal_Bool OutputDevice::GetTextBoundRect( Rectangle& rRect, long nXOffset = 0; if( nBase != nIndex ) { - xub_StrLen nStart = Min( nBase, nIndex ); - xub_StrLen nOfsLen = Max( nBase, nIndex ) - nStart; + xub_StrLen nStart = std::min( nBase, nIndex ); + xub_StrLen nOfsLen = std::max( nBase, nIndex ) - nStart; pSalLayout = ImplLayout( rStr, nStart, nOfsLen, aPoint, nLayoutWidth, pDXAry ); if( pSalLayout ) { @@ -7489,8 +7489,8 @@ sal_Bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector long nXOffset = 0; if( nBase != nIndex ) { - xub_StrLen nStart = Min( nBase, nIndex ); - xub_StrLen nOfsLen = Max( nBase, nIndex ) - nStart; + xub_StrLen nStart = std::min( nBase, nIndex ); + xub_StrLen nOfsLen = std::max( nBase, nIndex ) - nStart; pSalLayout = ImplLayout( rStr, nStart, nOfsLen, Point(0,0), nTWidth, pDXArray ); if( pSalLayout ) { diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx index db6488c050ab..dba20d33f504 100644 --- a/vcl/source/gdi/outdev4.cxx +++ b/vcl/source/gdi/outdev4.cxx @@ -173,7 +173,7 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect, } // Top darf nicht groesser als Bottom sein - aRect.Top() = Min( aRect.Top(), (long)(aRect.Bottom() - 1) ); + aRect.Top() = std::min( aRect.Top(), (long)(aRect.Bottom() - 1) ); long nMinRect = aRect.GetHeight(); @@ -228,12 +228,12 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect, nStepCount = nMinRect / nInc; } // minimal drei Schritte und maximal die Anzahl der Farbunterschiede - long nSteps = Max( nStepCount, 2L ); - long nCalcSteps = Abs( nRedSteps ); - long nTempSteps = Abs( nGreenSteps ); + long nSteps = std::max( nStepCount, 2L ); + long nCalcSteps = std::abs( nRedSteps ); + long nTempSteps = std::abs( nGreenSteps ); if ( nTempSteps > nCalcSteps ) nCalcSteps = nTempSteps; - nTempSteps = Abs( nBlueSteps ); + nTempSteps = std::abs( nBlueSteps ); if ( nTempSteps > nCalcSteps ) nCalcSteps = nTempSteps; if ( nCalcSteps < nSteps ) @@ -415,7 +415,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect, else pPolyPoly = NULL; - long nMinRect = Min( aRect.GetWidth(), aRect.GetHeight() ); + long nMinRect = std::min( aRect.GetWidth(), aRect.GetHeight() ); // Anzahl der Schritte berechnen, falls nichts uebergeben wurde if( !nStepCount ) @@ -436,12 +436,12 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect, } // minimal drei Schritte und maximal die Anzahl der Farbunterschiede - long nSteps = Max( nStepCount, 2L ); - long nCalcSteps = Abs( nRedSteps ); - long nTempSteps = Abs( nGreenSteps ); + long nSteps = std::max( nStepCount, 2L ); + long nCalcSteps = std::abs( nRedSteps ); + long nTempSteps = std::abs( nGreenSteps ); if ( nTempSteps > nCalcSteps ) nCalcSteps = nTempSteps; - nTempSteps = Abs( nBlueSteps ); + nTempSteps = std::abs( nBlueSteps ); if ( nTempSteps > nCalcSteps ) nCalcSteps = nTempSteps; if ( nCalcSteps < nSteps ) @@ -1079,7 +1079,7 @@ void OutputDevice::ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHa { Rectangle aRect( rPolyPoly.GetBoundRect() ); const long nLogPixelWidth = ImplDevicePixelToLogicWidth( 1 ); - const long nWidth = ImplDevicePixelToLogicWidth( Max( ImplLogicWidthToDevicePixel( rHatch.GetDistance() ), 3L ) ); + const long nWidth = ImplDevicePixelToLogicWidth( std::max( ImplLogicWidthToDevicePixel( rHatch.GetDistance() ), 3L ) ); Point* pPtBuffer = new Point[ HATCH_MAXPOINTS ]; Point aPt1, aPt2, aEndPt1; Size aInc; diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx index 8e9535bece34..4297e483bce8 100644 --- a/vcl/source/gdi/outdev6.cxx +++ b/vcl/source/gdi/outdev6.cxx @@ -67,8 +67,8 @@ void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLon if( mbOutputClipped ) return; - const long nDistX = Max( rDist.Width(), 1L ); - const long nDistY = Max( rDist.Height(), 1L ); + const long nDistX = std::max( rDist.Width(), 1L ); + const long nDistY = std::max( rDist.Height(), 1L ); long nX = ( rRect.Left() >= aDstRect.Left() ) ? rRect.Left() : ( rRect.Left() + ( ( aDstRect.Left() - rRect.Left() ) / nDistX ) * nDistX ); long nY = ( rRect.Top() >= aDstRect.Top() ) ? rRect.Top() : ( rRect.Top() + ( ( aDstRect.Top() - rRect.Top() ) / nDistY ) * nDistY ); const long nRight = aDstRect.Right(); @@ -327,7 +327,7 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly, Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() ); const Size aDPISize( LogicToPixel( Size( 1, 1 ), MAP_INCH ) ); - const long nBaseExtent = Max( FRound( aDPISize.Width() / 300. ), 1L ); + const long nBaseExtent = std::max( FRound( aDPISize.Width() / 300. ), 1L ); long nMove; const sal_uInt16 nTrans = ( nTransparencePercent < 13 ) ? 0 : ( nTransparencePercent < 38 ) ? 25 : diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx index 6b28d77e542f..ed02ae063460 100644 --- a/vcl/source/gdi/outmap.cxx +++ b/vcl/source/gdi/outmap.cxx @@ -114,7 +114,7 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY, const ImplMapRes& rMapRes, ImplThresholdRes& rThresRes ) { - if ( nDPIX && (LONG_MAX / nDPIX < Abs( rMapRes.mnMapScNumX ) ) ) // #111139# avoid div by zero + if ( nDPIX && (LONG_MAX / nDPIX < std::abs( rMapRes.mnMapScNumX ) ) ) // #111139# avoid div by zero { rThresRes.mnThresLogToPixX = 0; rThresRes.mnThresPixToLogX = 0; @@ -129,7 +129,7 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY, if ( !nProductX ) rThresRes.mnThresLogToPixX = LONG_MAX; else - rThresRes.mnThresLogToPixX = Abs( (LONG_MAX - nDenomHalfX) / nProductX ); + rThresRes.mnThresLogToPixX = std::abs( (LONG_MAX - nDenomHalfX) / nProductX ); if ( !nDenomX ) rThresRes.mnThresPixToLogX = LONG_MAX; @@ -139,7 +139,7 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY, rThresRes.mnThresPixToLogX = (long)(((sal_uLong)LONG_MAX + (sal_uLong)(-nProductX/2)) / nDenomX); } - if ( nDPIY && (LONG_MAX / nDPIY < Abs( rMapRes.mnMapScNumY ) ) ) // #111139# avoid div by zero + if ( nDPIY && (LONG_MAX / nDPIY < std::abs( rMapRes.mnMapScNumY ) ) ) // #111139# avoid div by zero { rThresRes.mnThresLogToPixY = 0; rThresRes.mnThresPixToLogY = 0; @@ -154,7 +154,7 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY, if ( !nProductY ) rThresRes.mnThresLogToPixY = LONG_MAX; else - rThresRes.mnThresLogToPixY = Abs( (LONG_MAX - nDenomHalfY) / nProductY ); + rThresRes.mnThresLogToPixY = std::abs( (LONG_MAX - nDenomHalfY) / nProductY ); if ( !nDenomY ) rThresRes.mnThresPixToLogY = LONG_MAX; @@ -628,12 +628,12 @@ LineInfo OutputDevice::ImplLogicToDevicePixel( const LineInfo& rLineInfo ) const if( aInfo.GetStyle() == LINE_DASH ) { if( aInfo.GetDotCount() && aInfo.GetDotLen() ) - aInfo.SetDotLen( Max( ImplLogicWidthToDevicePixel( aInfo.GetDotLen() ), 1L ) ); + aInfo.SetDotLen( std::max( ImplLogicWidthToDevicePixel( aInfo.GetDotLen() ), 1L ) ); else aInfo.SetDotCount( 0 ); if( aInfo.GetDashCount() && aInfo.GetDashLen() ) - aInfo.SetDashLen( Max( ImplLogicWidthToDevicePixel( aInfo.GetDashLen() ), 1L ) ); + aInfo.SetDashLen( std::max( ImplLogicWidthToDevicePixel( aInfo.GetDashLen() ), 1L ) ); else aInfo.SetDashCount( 0 ); @@ -1701,14 +1701,14 @@ static long fn5( const long n1, { if ( n1 == 0 || n2 == 0 || n3 == 0 || n4 == 0 || n5 == 0 ) return 0; - if ( LONG_MAX / Abs(n2) < Abs(n3) ) + if ( LONG_MAX / std::abs(n2) < std::abs(n3) ) { // a6 wird "ubersprungen BigInt a7 = n2; a7 *= n3; a7 *= n1; - if ( LONG_MAX / Abs(n4) < Abs(n5) ) + if ( LONG_MAX / std::abs(n4) < std::abs(n5) ) { BigInt a8 = n4; a8 *= n5; @@ -1739,12 +1739,12 @@ static long fn5( const long n1, { long n6 = n2 * n3; - if ( LONG_MAX / Abs(n1) < Abs(n6) ) + if ( LONG_MAX / std::abs(n1) < std::abs(n6) ) { BigInt a7 = n1; a7 *= n6; - if ( LONG_MAX / Abs(n4) < Abs(n5) ) + if ( LONG_MAX / std::abs(n4) < std::abs(n5) ) { BigInt a8 = n4; a8 *= n5; @@ -1775,7 +1775,7 @@ static long fn5( const long n1, { long n7 = n1 * n6; - if ( LONG_MAX / Abs(n4) < Abs(n5) ) + if ( LONG_MAX / std::abs(n4) < std::abs(n5) ) { BigInt a7 = n7; BigInt a8 = n4; @@ -1817,7 +1817,7 @@ static long fn3( const long n1, const long n2, const long n3 ) { if ( n1 == 0 || n2 == 0 || n3 == 0 ) return 0; - if ( LONG_MAX / Abs(n1) < Abs(n2) ) + if ( LONG_MAX / std::abs(n1) < std::abs(n2) ) { BigInt a4 = n1; a4 *= n2; diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index e359f59a1678..5b149a061a47 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -1142,10 +1142,10 @@ void Region::ImplCreateRectRegion( const Rectangle& rRect ) else { // get justified rectangle - long nTop = Min( rRect.Top(), rRect.Bottom() ); - long nBottom = Max( rRect.Top(), rRect.Bottom() ); - long nLeft = Min( rRect.Left(), rRect.Right() ); - long nRight = Max( rRect.Left(), rRect.Right() ); + long nTop = std::min( rRect.Top(), rRect.Bottom() ); + long nBottom = std::max( rRect.Top(), rRect.Bottom() ); + long nLeft = std::min( rRect.Left(), rRect.Right() ); + long nRight = std::max( rRect.Left(), rRect.Right() ); // create instance of implementation class mpImplRegion = new ImplRegion(); @@ -1378,10 +1378,10 @@ void Region::Union( const Rectangle& rRect ) ImplCopyData(); // get justified rectangle - long nLeft = Min( rRect.Left(), rRect.Right() ); - long nTop = Min( rRect.Top(), rRect.Bottom() ); - long nRight = Max( rRect.Left(), rRect.Right() ); - long nBottom = Max( rRect.Top(), rRect.Bottom() ); + long nLeft = std::min( rRect.Left(), rRect.Right() ); + long nTop = std::min( rRect.Top(), rRect.Bottom() ); + long nRight = std::max( rRect.Left(), rRect.Right() ); + long nBottom = std::max( rRect.Top(), rRect.Bottom() ); // insert bands if the boundaries are not already in the list mpImplRegion->InsertBands( nTop, nBottom ); @@ -1480,10 +1480,10 @@ void Region::Intersect( const Rectangle& rRect ) return; // get justified rectangle - long nLeft = Min( rRect.Left(), rRect.Right() ); - long nTop = Min( rRect.Top(), rRect.Bottom() ); - long nRight = Max( rRect.Left(), rRect.Right() ); - long nBottom = Max( rRect.Top(), rRect.Bottom() ); + long nLeft = std::min( rRect.Left(), rRect.Right() ); + long nTop = std::min( rRect.Top(), rRect.Bottom() ); + long nRight = std::max( rRect.Left(), rRect.Right() ); + long nBottom = std::max( rRect.Top(), rRect.Bottom() ); // is own region NULL-region? -> copy data! if ( mpImplRegion == &aImplNullRegion ) @@ -1583,10 +1583,10 @@ void Region::Exclude( const Rectangle& rRect ) ImplCopyData(); // get justified rectangle - long nLeft = Min( rRect.Left(), rRect.Right() ); - long nTop = Min( rRect.Top(), rRect.Bottom() ); - long nRight = Max( rRect.Left(), rRect.Right() ); - long nBottom = Max( rRect.Top(), rRect.Bottom() ); + long nLeft = std::min( rRect.Left(), rRect.Right() ); + long nTop = std::min( rRect.Top(), rRect.Bottom() ); + long nRight = std::max( rRect.Left(), rRect.Right() ); + long nBottom = std::max( rRect.Top(), rRect.Bottom() ); // insert bands if the boundaries are not already in the list mpImplRegion->InsertBands( nTop, nBottom ); @@ -1645,10 +1645,10 @@ void Region::XOr( const Rectangle& rRect ) ImplCopyData(); // get justified rectangle - long nLeft = Min( rRect.Left(), rRect.Right() ); - long nTop = Min( rRect.Top(), rRect.Bottom() ); - long nRight = Max( rRect.Left(), rRect.Right() ); - long nBottom = Max( rRect.Top(), rRect.Bottom() ); + long nLeft = std::min( rRect.Left(), rRect.Right() ); + long nTop = std::min( rRect.Top(), rRect.Bottom() ); + long nRight = std::max( rRect.Left(), rRect.Right() ); + long nBottom = std::max( rRect.Top(), rRect.Bottom() ); // insert bands if the boundaries are not already in the list mpImplRegion->InsertBands( nTop, nBottom ); @@ -2091,8 +2091,8 @@ Rectangle Region::GetBoundRect() const while ( pBand ) { nYBottom = pBand->mnYBottom; - nXLeft = Min( nXLeft, pBand->GetXLeftBoundary() ); - nXRight = Max( nXRight, pBand->GetXRightBoundary() ); + nXLeft = std::min( nXLeft, pBand->GetXLeftBoundary() ); + nXRight = std::max( nXRight, pBand->GetXRightBoundary() ); pBand = pBand->mpNextBand; } |