[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - svl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Mar 4 15:48:20 UTC 2019


 svl/source/numbers/zformat.cxx |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

New commits:
commit ac44b07f7ad305fe73c070ce38913b1578cc211a
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Thu Feb 28 14:44:02 2019 +0100
Commit:     Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
CommitDate: Mon Mar 4 16:47:57 2019 +0100

    Resolves: tdf#123748 do not strip date part before calling Time::GetClock()
    
    GetClock() needs it to properly scale and round the floating point
    value. It also handles negative values, fiddling with that is only
    needed for the [] formats.
    
    Regression from
    
        commit e2e47898180e547cad7ccde1e5890385d573e551
        CommitDate: Fri Aug 31 12:50:52 2018 +0200
    
            Use tools::Time::GetClock() in number formatter for wall clock time
    
    Change-Id: I05fe9e22886d4e59f110c0a826dadb43234d348a
    Reviewed-on: https://gerrit.libreoffice.org/68508
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 609ea85b530185910bf326201f785fd32bcbad2b)
    Reviewed-on: https://gerrit.libreoffice.org/68513
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index cce16ce94e97..bad3b224089c 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2978,7 +2978,7 @@ bool SvNumberformat::ImpGetTimeOutput(double fNumber,
 {
     using namespace ::com::sun::star::i18n;
     bool bCalendarSet = false;
-    double fNumberOrig = fNumber;
+    const double fNumberOrig = fNumber;
     bool bRes = false;
     bool bSign = false;
     if (fNumber < 0.0)
@@ -2998,10 +2998,6 @@ bool SvNumberformat::ImpGetTimeOutput(double fNumber,
             return false;
         }
     }
-    else
-    {
-        fNumber -= floor(fNumber); // Else truncate date
-    }
     bool bInputLine;
     sal_Int32 nCntPost;
     if ( rScan.GetStandardPrec() == SvNumberFormatter::INPUTSTRING_PRECISION &&
@@ -3015,10 +3011,6 @@ bool SvNumberformat::ImpGetTimeOutput(double fNumber,
         bInputLine = false;
         nCntPost = rInfo.nCntPost;
     }
-    if (bSign && !rInfo.bThousand) // No [] format
-    {
-        fNumber = 1.0 - fNumber; // "Inverse"
-    }
 
     OUStringBuffer sSecStr;
     sal_Int32 nSecPos = 0; // For figure by figure processing
@@ -3027,7 +3019,7 @@ bool SvNumberformat::ImpGetTimeOutput(double fNumber,
     {
         sal_uInt16 nCHour, nCMinute, nCSecond;
         double fFractionOfSecond;
-        tools::Time::GetClock( fNumber, nCHour, nCMinute, nCSecond, fFractionOfSecond, nCntPost);
+        tools::Time::GetClock( fNumberOrig, nCHour, nCMinute, nCSecond, fFractionOfSecond, nCntPost);
         nHour = nCHour;
         nMin = nCMinute;
         nSec = nCSecond;


More information about the Libreoffice-commits mailing list