diff options
author | Noel <noelgrandin@gmail.com> | 2020-11-11 18:08:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-12 07:37:38 +0100 |
commit | 1397a1c8e4995b0dd336478e564880fe8ad91d1d (patch) | |
tree | 41a4cf915bb52d453e6eb5a57c15b8718d847874 /vcl/source | |
parent | 48b667a7e7d25f835f95df89162a7849d6972531 (diff) |
remove BigInt::operator tools::Long()
which was introduced in
commit adf0738d2dbfa742d0e9ef130954fb4638a8e90d
Author: Noel Grandin <noel.grandin@collabora.co.uk>
Date: Wed Jan 3 14:25:15 2018 +0200
long->sal_Int32 in BigInt
presumably to make the conversion easier.
Instead just fix the call-sites to select a better
conversion, BigInt only returns 32-bits of precision
anyway.
Change-Id: I2e4354bcfded01763fe3312a715ef37800297876
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105602
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/control/longcurr.cxx | 8 | ||||
-rw-r--r-- | vcl/source/filter/wmf/wmfwr.cxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/map.cxx | 12 |
3 files changed, 12 insertions, 12 deletions
diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx index 5025c1d68ef0..192dc727dc48 100644 --- a/vcl/source/control/longcurr.cxx +++ b/vcl/source/control/longcurr.cxx @@ -52,8 +52,8 @@ OUString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const BigInt { SAL_WARN_IF( nDigits >= 10, "vcl", "LongCurrency may only have 9 decimal places" ); - if ( rNumber.IsZero() || static_cast<tools::Long>(rNumber) ) - return rLocaleDataWrapper.getCurr( static_cast<tools::Long>(rNumber), nDigits, rCurrSymbol, bShowThousandSep ); + if ( rNumber.IsZero() || static_cast<sal_Int32>(rNumber) ) + return rLocaleDataWrapper.getCurr( static_cast<sal_Int32>(rNumber), nDigits, rCurrSymbol, bShowThousandSep ); BigInt aTmp( ImplPower10( nDigits ) ); BigInt aInteger( rNumber ); @@ -70,7 +70,7 @@ OUString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const BigInt if ( rNumber.IsNeg() ) aFraction *= -1; - OUStringBuffer aTemplate = rLocaleDataWrapper.getCurr( static_cast<tools::Long>(aFraction), nDigits, rCurrSymbol, bShowThousandSep ); + OUStringBuffer aTemplate = rLocaleDataWrapper.getCurr( static_cast<sal_Int32>(aFraction), nDigits, rCurrSymbol, bShowThousandSep ); while( !aInteger.IsZero() ) { aFraction = aInteger; @@ -79,7 +79,7 @@ OUString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const BigInt if( !aInteger.IsZero() ) aFraction += aTmp; - OUString aFractionStr = rLocaleDataWrapper.getNum( static_cast<tools::Long>(aFraction), 0 ); + OUString aFractionStr = rLocaleDataWrapper.getNum( static_cast<sal_Int32>(aFraction), 0 ); sal_Int32 nSPos = aTemplate.indexOf( '1' ); if (nSPos == -1) diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index 515468386488..c7d7e3cc57da 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -1412,7 +1412,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) else aX += BigInt( aScaleX.GetNumerator()/2 ); aX /= BigInt( aScaleX.GetNumerator() ); - aOrigin.setX( static_cast<tools::Long>(aX) + aMM.GetOrigin().X() ); + aOrigin.setX( static_cast<sal_Int32>(aX) + aMM.GetOrigin().X() ); BigInt aY( aOrigin.Y() ); aY *= BigInt( aScaleY.GetDenominator() ); if( aOrigin.Y() >= 0 ) @@ -1426,7 +1426,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) else aY += BigInt( aScaleY.GetNumerator()/2 ); aY /= BigInt( aScaleY.GetNumerator() ); - aOrigin.setY( static_cast<tools::Long>(aY) + aMM.GetOrigin().Y() ); + aOrigin.setY( static_cast<sal_Int32>(aY) + aMM.GetOrigin().Y() ); aSrcMapMode.SetOrigin( aOrigin ); aScaleX *= aSrcMapMode.GetScaleX(); diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx index aba22cb4ef1f..7af0649e2ef5 100644 --- a/vcl/source/outdev/map.cxx +++ b/vcl/source/outdev/map.cxx @@ -279,7 +279,7 @@ static void ImplCalcMapResolution( const MapMode& rMapMode, aX += BigInt(nXNumerator / 2); } aX /= BigInt(nXNumerator); - rMapRes.mnMapOfsX = static_cast<tools::Long>(aX) + aOrigin.X(); + rMapRes.mnMapOfsX = static_cast<sal_Int32>(aX) + aOrigin.X(); BigInt aY( rMapRes.mnMapOfsY ); aY *= BigInt( aScaleY.GetDenominator() ); if( rMapRes.mnMapOfsY >= 0 ) @@ -297,7 +297,7 @@ static void ImplCalcMapResolution( const MapMode& rMapMode, aY += BigInt(nYNumerator / 2); } aY /= BigInt(nYNumerator); - rMapRes.mnMapOfsY = static_cast<tools::Long>(aY) + aOrigin.Y(); + rMapRes.mnMapOfsY = static_cast<sal_Int32>(aY) + aOrigin.Y(); } // calculate scaling factor according to MapMode @@ -1560,7 +1560,7 @@ static tools::Long fn5( const tools::Long n1, a7 /= n8; } // of else - return static_cast<tools::Long>(a7); + return static_cast<sal_Int32>(a7); } // of if else { @@ -1596,7 +1596,7 @@ static tools::Long fn5( const tools::Long n1, a7 /= n8; } // of else - return static_cast<tools::Long>(a7); + return static_cast<sal_Int32>(a7); } // of if else { @@ -1616,7 +1616,7 @@ static tools::Long fn5( const tools::Long n1, a7 += a9; a7 /= a8; - return static_cast<tools::Long>(a7); + return static_cast<sal_Int32>(a7); } // of if else { @@ -1653,7 +1653,7 @@ static tools::Long fn3( const tools::Long n1, const tools::Long n2, const tools: a4 += n3 / 2; a4 /= n3; - return static_cast<tools::Long>(a4); + return static_cast<sal_Int32>(a4); } // of if else { |