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 /tools/source | |
parent | fdo#60949: Move more libs to OOOLIBS (diff) | |
download | core-0f200cc30ea75fdce59f7bb6ae87ebc85729e2a4.tar.gz core-0f200cc30ea75fdce59f7bb6ae87ebc85729e2a4.zip |
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 'tools/source')
-rw-r--r-- | tools/source/datetime/ttime.cxx | 4 | ||||
-rw-r--r-- | tools/source/generic/fract.cxx | 12 | ||||
-rw-r--r-- | tools/source/generic/gen.cxx | 16 | ||||
-rw-r--r-- | tools/source/generic/poly.cxx | 10 |
4 files changed, 21 insertions, 21 deletions
diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx index 9f1241cfd76b..8b27d1ffa72d 100644 --- a/tools/source/datetime/ttime.cxx +++ b/tools/source/datetime/ttime.cxx @@ -343,7 +343,7 @@ Time Time::GetUTCOffset() nTempTime += aTimeZone.StandardBias; else if ( nTimeZoneRet == TIME_ZONE_ID_DAYLIGHT ) nTempTime += aTimeZone.DaylightBias; - Time aTime( 0, (sal_uInt16)Abs( nTempTime ) ); + Time aTime( 0, (sal_uInt16)abs( nTempTime ) ); if ( nTempTime > 0 ) aTime = -aTime; return aTime; @@ -381,7 +381,7 @@ Time Time::GetUTCOffset() nCacheSecOffset = (nLocalTime-nUTC) / 60; } - nTempTime = (short)Abs( nCacheSecOffset ); + nTempTime = abs( nCacheSecOffset ); Time aTime( 0, (sal_uInt16)nTempTime ); if ( nCacheSecOffset < 0 ) aTime = -aTime; diff --git a/tools/source/generic/fract.cxx b/tools/source/generic/fract.cxx index 5c805dc7dcd1..4f5ee96a4cd3 100644 --- a/tools/source/generic/fract.cxx +++ b/tools/source/generic/fract.cxx @@ -35,8 +35,8 @@ */ static long GetGGT( long nVal1, long nVal2 ) { - nVal1 = Abs( nVal1 ); - nVal2 = Abs( nVal2 ); + nVal1 = std::abs( nVal1 ); + nVal2 = std::abs( nVal2 ); if ( nVal1 <= 1 || nVal2 <= 1 ) return 1; @@ -132,7 +132,7 @@ Fraction::Fraction( double dVal ) return; } - while ( Abs( (long)dVal ) < nMAX && nDen < nMAX ) + while ( abs( (long)dVal ) < nMAX && nDen < nMAX ) { dVal *= 10; nDen *= 10; @@ -411,10 +411,10 @@ void Fraction::ReduceInaccurate( unsigned nSignificantBits ) DBG_ASSERT(nSignificantBits<65, "More than 64 bit of significance is overkill!"); // How much bits can we lose? - const int nMulBitsToLose = Max( ( impl_NumberOfBits( nMul ) - int( nSignificantBits ) ), 0 ); - const int nDivBitsToLose = Max( ( impl_NumberOfBits( nDiv ) - int( nSignificantBits ) ), 0 ); + const int nMulBitsToLose = std::max( ( impl_NumberOfBits( nMul ) - int( nSignificantBits ) ), 0 ); + const int nDivBitsToLose = std::max( ( impl_NumberOfBits( nDiv ) - int( nSignificantBits ) ), 0 ); - const int nToLose = Min( nMulBitsToLose, nDivBitsToLose ); + const int nToLose = std::min( nMulBitsToLose, nDivBitsToLose ); // Remove the bits nMul >>= nToLose; diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index e4a03a318f1f..d7d7ff0403e8 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -70,10 +70,10 @@ Rectangle& Rectangle::Union( const Rectangle& rRect ) *this = rRect; else { - nLeft = Min( Min( nLeft, rRect.nLeft ), Min( nRight, rRect.nRight ) ); - nRight = Max( Max( nLeft, rRect.nLeft ), Max( nRight, rRect.nRight ) ); - nTop = Min( Min( nTop, rRect.nTop ), Min( nBottom, rRect.nBottom ) ); - nBottom = Max( Max( nTop, rRect.nTop ), Max( nBottom, rRect.nBottom ) ); + nLeft = std::min( std::min( nLeft, rRect.nLeft ), std::min( nRight, rRect.nRight ) ); + nRight = std::max( std::max( nLeft, rRect.nLeft ), std::max( nRight, rRect.nRight ) ); + nTop = std::min( std::min( nTop, rRect.nTop ), std::min( nBottom, rRect.nBottom ) ); + nBottom = std::max( std::max( nTop, rRect.nTop ), std::max( nBottom, rRect.nBottom ) ); } return *this; @@ -95,10 +95,10 @@ Rectangle& Rectangle::Intersection( const Rectangle& rRect ) aTmpRect.Justify(); // Perform intersection - nLeft = Max( nLeft, aTmpRect.nLeft ); - nRight = Min( nRight, aTmpRect.nRight ); - nTop = Max( nTop, aTmpRect.nTop ); - nBottom= Min( nBottom, aTmpRect.nBottom ); + nLeft = std::max( nLeft, aTmpRect.nLeft ); + nRight = std::min( nRight, aTmpRect.nRight ); + nTop = std::max( nTop, aTmpRect.nTop ); + nBottom= std::min( nBottom, aTmpRect.nBottom ); // Determine if intersection is empty if ( nRight < nLeft || nBottom < nTop ) diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index dfa931a2433d..661854cd2e76 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -363,8 +363,8 @@ Polygon::Polygon( const Rectangle& rRect, sal_uIntPtr nHorzRound, sal_uIntPtr nV Rectangle aRect( rRect ); aRect.Justify(); // SJ: i9140 - nHorzRound = Min( nHorzRound, (sal_uIntPtr) labs( aRect.GetWidth() >> 1 ) ); - nVertRound = Min( nVertRound, (sal_uIntPtr) labs( aRect.GetHeight() >> 1 ) ); + nHorzRound = std::min( nHorzRound, (sal_uIntPtr) labs( aRect.GetWidth() >> 1 ) ); + nVertRound = std::min( nVertRound, (sal_uIntPtr) labs( aRect.GetHeight() >> 1 ) ); if( !nHorzRound && !nVertRound ) { @@ -500,7 +500,7 @@ Polygon::Polygon( const Rectangle& rBound, const Point& rStart, const Point& rEn fDiff = F_2PI; // Proportionally shrink number of points( fDiff / (2PI) ); - nPoints = Max( (sal_uInt16) ( ( fDiff * 0.1591549 ) * nPoints ), (sal_uInt16) 16 ); + nPoints = std::max( (sal_uInt16) ( ( fDiff * 0.1591549 ) * nPoints ), (sal_uInt16) 16 ); fStep = fDiff / ( nPoints - 1 ); if( POLY_PIE == eStyle ) @@ -1200,7 +1200,7 @@ Point ImplEdgePointFilter::EdgeSection( const Point& rPoint, int nEdge ) const long dy = nNewY - ly; if ( !md ) nNewX = lx; - else if ( (LONG_MAX / Abs(md)) >= Abs(dy) ) + else if ( (LONG_MAX / std::abs(md)) >= std::abs(dy) ) nNewX = (dy * md) / mn + lx; else { @@ -1226,7 +1226,7 @@ Point ImplEdgePointFilter::EdgeSection( const Point& rPoint, int nEdge ) const long dx = nNewX - lx; if ( !mn ) nNewY = ly; - else if ( (LONG_MAX / Abs(mn)) >= Abs(dx) ) + else if ( (LONG_MAX / std::abs(mn)) >= std::abs(dx) ) nNewY = (dx * mn) / md + ly; else { |