summaryrefslogtreecommitdiff
path: root/vcl/source/control
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-12-20 12:17:31 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-12-20 20:30:01 +0100
commit36df3f9ad2f71c122af3cf9fbc58c661f416658e (patch)
tree076d19ec3feb7bb82bb63e8435e1ea76e26e4a9c /vcl/source/control
parentc684aa9cf33fdbae5bf5f05d2c391f27a140b56d (diff)
Make BigInt::DivMod public, to allow optimized division
Change-Id: I4f79c30b9ab997d01e59a0dec76986e74abfc11f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161053 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/source/control')
-rw-r--r--vcl/source/control/longcurr.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx
index ee9451d79655..587c99cf1724 100644
--- a/vcl/source/control/longcurr.cxx
+++ b/vcl/source/control/longcurr.cxx
@@ -56,10 +56,9 @@ OUString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const BigInt
return rLocaleDataWrapper.getCurr( static_cast<tools::Long>(rNumber), nDigits, rCurrSymbol, bShowThousandSep );
BigInt aTmp( ImplPower10( nDigits ) );
- BigInt aInteger(rNumber.Abs());
- BigInt aFraction(aInteger);
- aInteger /= aTmp;
- aFraction %= aTmp;
+ BigInt aInteger;
+ BigInt aFraction;
+ rNumber.Abs().DivMod(aTmp, &aInteger, &aFraction);
if ( !aInteger.IsZero() )
{
aFraction += aTmp;
@@ -71,9 +70,7 @@ OUString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const BigInt
OUStringBuffer aTemplate(rLocaleDataWrapper.getCurr( static_cast<tools::Long>(aFraction), nDigits, rCurrSymbol, bShowThousandSep ));
while( !aInteger.IsZero() )
{
- aFraction = aInteger;
- aFraction %= aTmp;
- aInteger /= aTmp;
+ aInteger.DivMod(aTmp, &aInteger, &aFraction);
if( !aInteger.IsZero() )
aFraction += aTmp;