diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-12-17 17:29:49 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-12-17 18:32:43 +0100 |
commit | 64575a5b91b0fae6283b9ad8b1356e76caa34b45 (patch) | |
tree | d549f0c613c87669da202cdb22cb249fdb9b9f90 /sax | |
parent | SvxTextEditSourceImpl::Notify(): attempt to fix chart2_unoapi crash (diff) | |
download | core-64575a5b91b0fae6283b9ad8b1356e76caa34b45.tar.gz core-64575a5b91b0fae6283b9ad8b1356e76caa34b45.zip |
sax: avoid usage of double for parsing nanoseconds here too
Change-Id: Iddf93a116cb333db6465a915dae692c33a60241a
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/tools/converter.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index 8b0b616b36e1..62e5b4838971 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -1645,9 +1645,13 @@ static bool lcl_parseDateTime( } if (bSuccess) { - const sal_Int32 nDigits = std::min<sal_Int32>(nPos - nStart, 9); - OSL_ENSURE(nDigits > 0, "bad code monkey"); - nNanoSeconds=static_cast<double>(nTemp)*(1000000000.0/pow(10.0,nDigits)); + sal_Int32 nDigits = std::min<sal_Int32>(nPos - nStart, 9); + assert(nDigits > 0); + for (; nDigits < 9; ++nDigits) + { + nTemp *= 10; + } + nNanoSeconds = nTemp; } } |