[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - vcl/source

Aron Budea (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 16 11:31:45 UTC 2019


 vcl/source/control/field.cxx |   25 +------------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

New commits:
commit 121474509f920d404a8940f87660adcf2190da70
Author:     Aron Budea <aron.budea at collabora.com>
AuthorDate: Mon Sep 16 12:39:59 2019 +0200
Commit:     Aron Budea <aron.budea at collabora.com>
CommitDate: Mon Sep 16 13:31:09 2019 +0200

    Revert "vcl: better decimal handling in NumericFormatter"
    
    This reverts commit e9a48869fe1f1e90c03d299ae419ea5b1f43de50.
    
    Change-Id: I81269296ab3ca3f071707cf22c4b59964baed863
    Reviewed-on: https://gerrit.libreoffice.org/78980
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Aron Budea <aron.budea at collabora.com>

diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index bbbdbceb86e4..59220ac21258 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -131,29 +131,6 @@ bool ImplNumericGetValue( const OUString& rStr, sal_Int64& rValue,
         aStr1.appendCopy(aStr, 0, nDecPos);
         aStr2.appendCopy(aStr, nDecPos+1);
     }
-    else if (nDecDigits > 0 && aStr.getLength() > nDecDigits)
-    {
-        // We expect a decimal point and a certain number of decimal digits,
-        // but seems the user has deleted the decimal point, so we restore it.
-        // Otherwise, they end up with unexpectedly (to them) large numbers.
-
-        // Find the first digit from the right.
-        sal_Int32 nVirtualDecPos = aStr.getLength();
-        while (--nVirtualDecPos > 0)
-        {
-            if ((aStr[nVirtualDecPos] >= '0') && (aStr[nVirtualDecPos] <= '9'))
-                break;
-        }
-
-        if (nVirtualDecPos >= nDecDigits)
-        {
-            nVirtualDecPos -= nDecDigits - 1; // nVirtualDecPos is already on a digit (so discount it).
-            aStr1.append(aStr.getStr(), nVirtualDecPos);
-            aStr2.append(aStr.getStr() + nVirtualDecPos);
-        }
-        else
-            aStr1 = aStr;
-    }
     else
         aStr1 = aStr;
 
@@ -493,7 +470,7 @@ void NumericFormatter::ImplInit()
     mnFieldValue        = 0;
     mnLastValue         = 0;
     mnMin               = 0;
-    mnMax               = 100000000; // A user-friendly round number.
+    mnMax               = SAL_MAX_INT32;
         // a "large" value substantially smaller than SAL_MAX_INT64, to avoid
         // overflow in computations using this "dummy" value
     mnDecimalDigits     = 2;


More information about the Libreoffice-commits mailing list