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 | |
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')
39 files changed, 151 insertions, 151 deletions
diff --git a/vcl/inc/vcl/salbtype.hxx b/vcl/inc/vcl/salbtype.hxx index 31f9f02a6be4..85a00a197f96 100644 --- a/vcl/inc/vcl/salbtype.hxx +++ b/vcl/inc/vcl/salbtype.hxx @@ -641,7 +641,7 @@ inline void BitmapPalette::SetEntryCount( sal_uInt16 nCount ) else if( nCount != mnCount ) { const sal_uLong nNewSize = nCount * sizeof( BitmapColor ); - const sal_uLong nMinSize = Min( mnCount, nCount ) * sizeof( BitmapColor ); + const sal_uLong nMinSize = std::min( mnCount, nCount ) * sizeof( BitmapColor ); sal_uInt8* pNewColor = new sal_uInt8[ nNewSize ]; if ( nMinSize && mpBitmapColor ) diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index ce26c501ad61..db4406019e3c 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1348,10 +1348,10 @@ xub_StrLen Edit::ImplGetCharPos( const Point& rWindowPos ) const if( nIndex == STRING_LEN ) { nIndex = 0; - long nDiff = Abs( pDX[0]-nX ); + long nDiff = std::abs( pDX[0]-nX ); for( int i = 1; i < aText.getLength(); i++ ) { - long nNewDiff = Abs( pDX[2*i]-nX ); + long nNewDiff = std::abs( pDX[2*i]-nX ); if( nNewDiff < nDiff ) { @@ -1359,7 +1359,7 @@ xub_StrLen Edit::ImplGetCharPos( const Point& rWindowPos ) const nDiff = nNewDiff; } } - if( nIndex == aText.getLength()-1 && Abs( pDX[2*nIndex+1] - nX ) < nDiff ) + if( nIndex == aText.getLength()-1 && std::abs( pDX[2*nIndex+1] - nX ) < nDiff ) nIndex = STRING_LEN; } diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index aeeef95c77f9..d09d97c9feb8 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -408,7 +408,7 @@ static void ImplPatternProcessStrictModify( Edit* pEdit, { // adjust selection such that it remains at the end if it was there before Selection aSel = pEdit->GetSelection(); - sal_Int64 nMaxSel = Max( aSel.Min(), aSel.Max() ); + sal_Int64 nMaxSel = std::max( aSel.Min(), aSel.Max() ); if ( nMaxSel >= aText.getLength() ) { sal_Int32 nMaxPos = aNewText.getLength(); diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index 7abe06b06ec9..4be1c118131e 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -723,16 +723,16 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry ) if( aMetrics.nImgHeight > mnMaxImgHeight ) mnMaxImgHeight = aMetrics.nImgHeight; - mnMaxImgTxtWidth = Max( mnMaxImgTxtWidth, aMetrics.nTextWidth ); - aMetrics.nEntryHeight = Max( aMetrics.nImgHeight, aMetrics.nEntryHeight ); + mnMaxImgTxtWidth = std::max( mnMaxImgTxtWidth, aMetrics.nTextWidth ); + aMetrics.nEntryHeight = std::max( aMetrics.nImgHeight, aMetrics.nEntryHeight ); } if ( IsUserDrawEnabled() || aMetrics.bImage ) { - aMetrics.nEntryWidth = Max( aMetrics.nImgWidth, maUserItemSize.Width() ); + aMetrics.nEntryWidth = std::max( aMetrics.nImgWidth, maUserItemSize.Width() ); if ( aMetrics.bText ) aMetrics.nEntryWidth += aMetrics.nTextWidth + IMG_TXT_DISTANCE; - aMetrics.nEntryHeight = Max( Max( mnMaxImgHeight, maUserItemSize.Height() ) + 2, + aMetrics.nEntryHeight = std::max( std::max( mnMaxImgHeight, maUserItemSize.Height() ) + 2, aMetrics.nEntryHeight ); } @@ -983,8 +983,8 @@ void ImplListBoxWindow::MouseMove( const MouseEvent& rMEvt ) sal_uInt16 nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() ); if( nSelect == LISTBOX_ENTRY_NOTFOUND ) nSelect = mpEntryList->GetEntryCount() - 1; - nSelect = Min( nSelect, GetLastVisibleEntry() ); - nSelect = Min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) ); + nSelect = std::min( nSelect, GetLastVisibleEntry() ); + nSelect = std::min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) ); // Select only visible Entries with MouseMove, otherwise Tracking... if ( IsVisible( nSelect ) && mpEntryList->IsEntrySelectable( nSelect ) && @@ -1167,8 +1167,8 @@ sal_Bool ImplListBoxWindow::SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLE if( nAnchor != LISTBOX_ENTRY_NOTFOUND ) { // All entries from achor to nSelect have to be selected - sal_uInt16 nStart = Min( nSelect, nAnchor ); - sal_uInt16 nEnd = Max( nSelect, nAnchor ); + sal_uInt16 nStart = std::min( nSelect, nAnchor ); + sal_uInt16 nEnd = std::max( nSelect, nAnchor ); for ( sal_uInt16 n = nStart; n <= nEnd; n++ ) { if ( !mpEntryList->IsEntryPosSelected( n ) ) @@ -1314,7 +1314,7 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt ) { if ( mnCurrentPos != LISTBOX_ENTRY_NOTFOUND ) { - nSelect = Min( (sal_uInt16)(mnCurrentPos+1), (sal_uInt16)(mpEntryList->GetEntryCount()-1) ); + nSelect = std::min( (sal_uInt16)(mnCurrentPos+1), (sal_uInt16)(mpEntryList->GetEntryCount()-1) ); if( nSelect >= GetLastVisibleEntry() ) SetTopEntry( mnTop+1 ); } @@ -1322,8 +1322,8 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt ) else { nSelect = (sal_uInt16) ( ( aPt.Y() + mnBorder ) / mnMaxHeight ) + (sal_uInt16) mnTop; - nSelect = Min( nSelect, GetLastVisibleEntry() ); - nSelect = Min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) ); + nSelect = std::min( nSelect, GetLastVisibleEntry() ); + nSelect = std::min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) ); } if ( bInside ) @@ -1534,12 +1534,12 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt ) { sal_uInt16 nCount = mpEntryList->GetEntryCount(); sal_uInt16 nCurVis = GetLastVisibleEntry() - mnTop; - sal_uInt16 nTmp = Min( nCurVis, nCount ); + sal_uInt16 nTmp = std::min( nCurVis, nCount ); nTmp += mnTop - 1; if( mnCurrentPos == nTmp && mnCurrentPos != nCount - 1 ) { - long nTmp2 = Min( (long)(nCount-nCurVis), (long)((long)mnTop+(long)nCurVis-1) ); - nTmp2 = Max( (long)0 , nTmp2 ); + long nTmp2 = std::min( (long)(nCount-nCurVis), (long)((long)mnTop+(long)nCurVis-1) ); + nTmp2 = std::max( (long)0 , nTmp2 ); nTmp = (sal_uInt16)(nTmp2+(nCurVis-1) ); SetTopEntry( (sal_uInt16)nTmp2 ); } @@ -1875,7 +1875,7 @@ void ImplListBoxWindow::DrawEntry( sal_uInt16 nPos, sal_Bool bDrawImage, sal_Boo XubString aStr( mpEntryList->GetEntryText( nPos ) ); if ( aStr.Len() ) { - long nMaxWidth = Max( static_cast< long >( mnMaxWidth ), + long nMaxWidth = std::max( static_cast< long >( mnMaxWidth ), GetOutputSizePixel().Width() - 2*mnBorder ); // a multiline entry should only be as wide a the window if( (pEntry->mnFlags & LISTBOX_ENTRY_FLAG_MULTILINE) ) @@ -1886,7 +1886,7 @@ void ImplListBoxWindow::DrawEntry( sal_uInt16 nPos, sal_Bool bDrawImage, sal_Boo if( !bDrawTextAtImagePos && ( mpEntryList->HasEntryImage(nPos) || IsUserDrawEnabled() ) ) { - long nImageWidth = Max( mnMaxImgWidth, maUserItemSize.Width() ); + long nImageWidth = std::max( mnMaxImgWidth, maUserItemSize.Width() ); aTextRect.Left() += nImageWidth + IMG_TXT_DISTANCE; } @@ -2942,7 +2942,7 @@ void ImplWin::DrawEntry( sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDraw if ( !bDrawTextAtImagePos && ( bImage || IsUserDrawEnabled() ) ) { - long nMaxWidth = Max( maImage.GetSizePixel().Width(), maUserItemSize.Width() ); + long nMaxWidth = std::max( maImage.GetSizePixel().Width(), maUserItemSize.Width() ); aTextRect.Left() += nMaxWidth + IMG_TXT_DISTANCE; } diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index 16dea7e8d30c..dd1f60951304 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -254,7 +254,7 @@ void ImplDrawSpinButton( OutputDevice* pOutDev, // calculate Symbol size long nTempSize1 = aUpRect.GetWidth(); long nTempSize2 = aLowRect.GetWidth(); - if ( Abs( nTempSize1-nTempSize2 ) == 1 ) + if ( std::abs( nTempSize1-nTempSize2 ) == 1 ) { if ( nTempSize1 > nTempSize2 ) aUpRect.Left()++; @@ -263,7 +263,7 @@ void ImplDrawSpinButton( OutputDevice* pOutDev, } nTempSize1 = aUpRect.GetHeight(); nTempSize2 = aLowRect.GetHeight(); - if ( Abs( nTempSize1-nTempSize2 ) == 1 ) + if ( std::abs( nTempSize1-nTempSize2 ) == 1 ) { if ( nTempSize1 > nTempSize2 ) aUpRect.Top()++; diff --git a/vcl/source/edit/textdata.cxx b/vcl/source/edit/textdata.cxx index bfc601f7c1cf..10353c721116 100644 --- a/vcl/source/edit/textdata.cxx +++ b/vcl/source/edit/textdata.cxx @@ -132,7 +132,7 @@ void TEParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff ) else { DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" ); - mnInvalidPosStart = Min( mnInvalidPosStart, (sal_uInt16) ( (nDiff < 0) ? nStart+nDiff : nDiff ) ); + mnInvalidPosStart = std::min( mnInvalidPosStart, (sal_uInt16) ( (nDiff < 0) ? nStart+nDiff : nDiff ) ); mnInvalidDiff = 0; mbSimple = sal_False; } @@ -152,7 +152,7 @@ void TEParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /*nEnd*/ } else { - mnInvalidPosStart = Min( mnInvalidPosStart, nStart ); + mnInvalidPosStart = std::min( mnInvalidPosStart, nStart ); // nInvalidPosEnd = pNode->Len(); } diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index db76523cb0df..ce41bfb753e2 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -228,7 +228,7 @@ void TextEngine::SetMaxTextWidth( sal_uLong nMaxWidth ) { if ( nMaxWidth != mnMaxTextWidth ) { - mnMaxTextWidth = Min( nMaxWidth, (sal_uLong)0x7FFFFFFF ); + mnMaxTextWidth = std::min( nMaxWidth, (sal_uLong)0x7FFFFFFF ); FormatFullDoc(); UpdateViews(); } @@ -1620,7 +1620,7 @@ void TextEngine::FormatDoc() long nDiff = nNewHeight - mnCurTextHeight; if ( nNewHeight < mnCurTextHeight ) { - maInvalidRect.Bottom() = (long)Max( nNewHeight, mnCurTextHeight ); + maInvalidRect.Bottom() = (long)std::max( nNewHeight, mnCurTextHeight ); if ( maInvalidRect.IsEmpty() ) { maInvalidRect.Top() = 0; @@ -2188,7 +2188,7 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) const short nInvalidDiff = pTEParaPortion->GetInvalidDiff(); const sal_uInt16 nInvalidStart = pTEParaPortion->GetInvalidPosStart(); - const sal_uInt16 nInvalidEnd = nInvalidStart + Abs( nInvalidDiff ); + const sal_uInt16 nInvalidEnd = nInvalidStart + std::abs( nInvalidDiff ); sal_Bool bQuickFormat = sal_False; if ( pTEParaPortion->GetWritingDirectionInfos().empty() ) @@ -2602,7 +2602,7 @@ sal_Bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, sal_Bo if ( pAttr ) { - nTmpEnd = Min( pAttr->GetEnd(), nEndPos ); + nTmpEnd = std::min( pAttr->GetEnd(), nEndPos ); // e.g. <A HREF="http://www.mopo.de/">Morgenpost</A> aText.AppendAscii( "<A HREF=\"" ); diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index c13fc5529e05..f4993d0ff1d3 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -579,7 +579,7 @@ void ImpVclMEdit::SetSelection( const Selection& rSelection ) else if ( aNewSelection.Max() > aText.Len() ) aNewSelection.Max() = aText.Len(); - long nEnd = Max( aNewSelection.Min(), aNewSelection.Max() ); + long nEnd = std::max( aNewSelection.Min(), aNewSelection.Max() ); TextSelection aTextSel; sal_uLong nPara = 0; sal_uInt16 nChar = 0; diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index fc875f7886e5..15d68f8b9b47 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -863,7 +863,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r MapMode aMap( MAP_100TH_INCH ); sal_Int32 nDPI = rConfigItem.ReadInt32( "Resolution", 75 ); - Fraction aFrac( 1, Min( Max( nDPI, sal_Int32( 75 ) ), sal_Int32( 600 ) ) ); + Fraction aFrac( 1, std::min( std::max( nDPI, sal_Int32( 75 ) ), sal_Int32( 600 ) ) ); aMap.SetScaleX( aFrac ); aMap.SetScaleY( aFrac ); diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index baba25d5facd..fa165d68c9df 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -437,8 +437,8 @@ void GIFReader::FillImages( HPBYTE pBytes, sal_uLong nCount ) // falls Interlaced, werden die Zeilen kopiert if( nLastInterCount ) { - long nMinY = Min( (long) nLastImageY + 1, (long) nImageHeight - 1 ); - long nMaxY = Min( (long) nLastImageY + nLastInterCount, (long) nImageHeight - 1 ); + long nMinY = std::min( (long) nLastImageY + 1, (long) nImageHeight - 1 ); + long nMaxY = std::min( (long) nLastImageY + nLastInterCount, (long) nImageHeight - 1 ); // letzte gelesene Zeile kopieren, wenn Zeilen // nicht zusanmmenfallen ( kommt vorm wenn wir am Ende des Bildes sind ) 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; } diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index 1f7de7a612f6..1c5c42dde8bd 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -38,7 +38,7 @@ long AdjustRectToSquare( Rectangle &rRect ) { const long nWidth = rRect.GetWidth(); const long nHeight = rRect.GetHeight(); - long nSide = Min( nWidth, nHeight ); + long nSide = std::min( nWidth, nHeight ); if ( nSide && !(nSide & 1) ) { diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index f0e7cf315031..d9d84384eacb 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2295,7 +2295,7 @@ Size Menu::ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lon } } } - return Size(Max(nCheckWidth, nRadioWidth), Max(rCheckHeight, rRadioHeight)); + return Size(std::max(nCheckWidth, nRadioWidth), std::max(rCheckHeight, rRadioHeight)); } sal_Bool Menu::ImplGetNativeSubmenuArrowSize( Window* pWin, Size& rArrowSize, long& rArrowSpacing ) const @@ -2464,7 +2464,7 @@ Size Menu::ImplCalcSize( Window* pWin ) aSz.Width() += pData->aSz.Width(); } else - pData->aSz.Height() = Max( Max( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight ); + pData->aSz.Height() = std::max( std::max( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight ); nWidth += nTextWidth; } @@ -2484,7 +2484,7 @@ Size Menu::ImplCalcSize( Window* pWin ) if ( nFontHeight > nWidth ) nWidth += nFontHeight; - pData->aSz.Height() = Max( Max( nFontHeight, pData->aSz.Height() ), nMinMenuItemHeight ); + pData->aSz.Height() = std::max( std::max( nFontHeight, pData->aSz.Height() ), nMinMenuItemHeight ); } pData->aSz.Height() += EXTRAITEMHEIGHT; // little bit more distance @@ -2510,14 +2510,14 @@ Size Menu::ImplCalcSize( Window* pWin ) if( nMaxWidth > nScreenWidth/2 ) nMaxWidth = nScreenWidth/2; - sal_uInt16 gfxExtra = (sal_uInt16) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text + sal_uInt16 gfxExtra = (sal_uInt16) std::max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text nImgOrChkPos = (sal_uInt16)nExtra; long nImgOrChkWidth = 0; if( aMaxSize.Height() > 0 ) // NWF case nImgOrChkWidth = aMaxSize.Height() + nExtra; else // non NWF case nImgOrChkWidth = nFontHeight/2 + gfxExtra; - nImgOrChkWidth = Max( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra ); + nImgOrChkWidth = std::max( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra ); nTextPos = (sal_uInt16)(nImgOrChkPos + nImgOrChkWidth); nTextPos = nTextPos + gfxExtra; diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx index 627f2041fbe6..61744e1fe8aa 100644 --- a/vcl/source/window/scrwnd.cxx +++ b/vcl/source/window/scrwnd.cxx @@ -356,7 +356,7 @@ IMPL_LINK_NOARG(ImplWheelWindow, ImplScrollHdl) pWindow->Command( aCEvt ); if( aDel.IsDead() ) return 0; - mnRepaintTime = Max( Time::GetSystemTicks() - nTime, (sal_uLong)1 ); + mnRepaintTime = std::max( Time::GetSystemTicks() - nTime, (sal_uLong)1 ); ImplRecalcScrollValues(); } } diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 9805e5ae12d0..a0967ce33378 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -555,7 +555,7 @@ static void ImplCalcSet( ImplSplitSet* pSet, } } // Rundungsfehler werden hier nicht ausgelichen - if ( (nAbsItems < (sal_uInt16)(Abs( nSizeDelta ))) && nSizeWinSize ) + if ( (nAbsItems < (sal_uInt16)(std::abs( nSizeDelta ))) && nSizeWinSize ) { for ( i = 0; i < nItems; i++ ) { diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 505177d9836b..cb82af669cde 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -372,7 +372,7 @@ void StatusBar::ImplDrawText( sal_Bool bOffScreen, long nOldTextWidth ) if ( bOffScreen ) { - long nMaxWidth = Max( nOldTextWidth, GetTextWidth( aStr ) ); + long nMaxWidth = std::max( nOldTextWidth, GetTextWidth( aStr ) ); Size aVirDevSize( nMaxWidth, aTextRect.GetHeight() ); mpImplData->mpVirDev->SetOutputSizePixel( aVirDevSize ); Rectangle aTempRect = aTextRect; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 53b349f48a1b..bc59719e026c 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -555,7 +555,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl // generate readable fonts enforce a minimum font size of 9 points bool bBrokenLangFontHeight = MsLangId::isCJK(Application::GetSettings().GetUILanguageTag().getLanguageType()); if (bBrokenLangFontHeight) - defFontheight = Max(9, defFontheight); + defFontheight = std::max(9, defFontheight); // i22098, toolfont will be scaled differently to avoid bloated rulers and status bars for big fonts int toolfontheight = defFontheight; diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 1cac7b351ea8..838809530cd6 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -886,7 +886,7 @@ void Window::SetZoomedPointFont( const Font& rFont ) // Use another font if the representation is to be scaled, // and the actual font is not scalable FontMetric aMetric = GetFontMetric(); - long nFontDiff = Abs( GetFont().GetSize().Height()-aMetric.GetSize().Height() ); + long nFontDiff = std::abs( GetFont().GetSize().Height()-aMetric.GetSize().Height() ); if ( (aMetric.GetType() == TYPE_RASTER) && (nFontDiff >= 2) ) { sal_uInt16 nType; diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 98c856b3701f..2a296ca8309d 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -1278,7 +1278,7 @@ static long ImplHandleExtTextInput( Window* pWindow, // Test for changes sal_Bool bOnlyCursor = sal_False; - xub_StrLen nMinLen = Min( pWinData->mpExtOldText->getLength(), sal_Int32(rText.Len()) ); + xub_StrLen nMinLen = std::min( pWinData->mpExtOldText->getLength(), sal_Int32(rText.Len()) ); xub_StrLen nDeltaStart = 0; while ( nDeltaStart < nMinLen ) { diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index 9c9bdd164fb2..9c7a798ed274 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -360,7 +360,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( else if( aSrcBuf.mnBitCount <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); - const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed() + const sal_uInt16 nCols = std::min( (sal_uLong)rColMap.GetUsed() , (sal_uLong)(1 << nDrawableDepth) ); @@ -520,7 +520,7 @@ XImage* X11SalBitmap::ImplCreateXImage( else if( pImage->depth <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); - const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed() + const sal_uInt16 nCols = std::min( (sal_uLong)rColMap.GetUsed() , (sal_uLong)(1 << pImage->depth) ); diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx index 1840aee0ad94..7b5f7bbf3790 100644 --- a/vcl/win/source/gdi/salbmp.cxx +++ b/vcl/win/source/gdi/salbmp.cxx @@ -355,7 +355,7 @@ HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBits, const if ( nColors ) { - const sal_uInt16 nMinCount = Min( nColors, rPal.GetEntryCount() ); + const sal_uInt16 nMinCount = std::min( nColors, rPal.GetEntryCount() ); if( nMinCount ) memcpy( pBI->bmiColors, rPal.ImplGetColorBuffer(), nMinCount * sizeof( RGBQUAD ) ); @@ -526,7 +526,7 @@ void WinSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ) PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( mhDIB ); const sal_uInt16 nCount = pBuffer->maPalette.GetEntryCount(); const sal_uInt16 nDIBColorCount = ImplGetDIBColorCount( mhDIB ); - memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), Min( nDIBColorCount, nCount ) * sizeof( RGBQUAD ) ); + memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), std::min( nDIBColorCount, nCount ) * sizeof( RGBQUAD ) ); GlobalUnlock( mhDIB ); } diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx index 51c8a5b8d831..7bba68e43354 100644 --- a/vcl/win/source/gdi/salgdi.cxx +++ b/vcl/win/source/gdi/salgdi.cxx @@ -225,7 +225,7 @@ void ImplInitSalGDI() pSalData->mpDitherLow[ n ] = (BYTE) ( n & 248 ); for( n = 0; n < 256L; n++ ) - pSalData->mpDitherHigh[ n ] = (BYTE) Min( pSalData->mpDitherLow[ n ] + 8L, 255L ); + pSalData->mpDitherHigh[ n ] = (BYTE) std::min( pSalData->mpDitherLow[ n ] + 8L, 255L ); } } else if ( (nRasterCaps & RC_PALETTE) && (nBitCount == 8) ) @@ -303,7 +303,7 @@ void ImplInitSalGDI() pSalData->mpDitherLow[ n ] = (BYTE) ( n / 51L ); for( n = 0; n < 256L; n++ ) - pSalData->mpDitherHigh[ n ] = (BYTE)Min( pSalData->mpDitherLow[ n ] + 1, 5 ); + pSalData->mpDitherHigh[ n ] = (BYTE)std::min( pSalData->mpDitherLow[ n ] + 1, 5 ); } // get system color entries diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index 1d08d50585bf..59fb0e641777 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -2037,7 +2037,7 @@ static bool ImplGetFontAttrFromFile( const String& rFontFileURL, char aResourceName[512]; int nMaxLen = sizeof(aResourceName)/sizeof(*aResourceName) - 16; int nLen = ::GetTempPathA( nMaxLen, aResourceName ); - ::strncpy( aResourceName + nLen, aFileName, Max( 0, nMaxLen - nLen )); + ::strncpy( aResourceName + nLen, aFileName, std::max( 0, nMaxLen - nLen )); ::DeleteFileA( aResourceName ); // Create font resource file (typically with a .fot file name extension). diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index e9a28031d54c..41271b02c954 100644 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -2534,7 +2534,7 @@ bool UniscribeLayout::KashidaWordFix ( int nMinGlyphPos, int nEndGlyphPos, int* { if( i == nKashPos ) continue; - nSteal = Min( mnMinKashidaWidth - nSpaceAdded, nSteal ); + nSteal = std::min( mnMinKashidaWidth - nSpaceAdded, nSteal ); if ( nSteal > 0 ) { mpJustifications [ i ] -= nSteal; diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index ce35e02f03d6..05ecefdb44d1 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -4650,7 +4650,7 @@ static int ImplMeasureItem( HWND hWnd, WPARAM wParam, LPARAM lParam ) Size checkSize( GetSystemMetrics( SM_CXMENUCHECK ), GetSystemMetrics( SM_CYMENUCHECK ) ); pMI->itemWidth = checkSize.Width() + 3 + bmpSize.Width() + 3 + strSize.cx; - pMI->itemHeight = Max( Max( checkSize.Height(), bmpSize.Height() ), strSize.cy ); + pMI->itemHeight = std::max( std::max( checkSize.Height(), bmpSize.Height() ), strSize.cy ); pMI->itemHeight += 4; DeleteObject( SelectObject(hdc, hfntOld) ); |