diff options
-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 8823965bf75a..02131ed8e89f 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -1122,9 +1122,13 @@ bool Converter::convertDuration(util::Duration& rDuration, { if (-1 != nTemp) { - const sal_Int32 nDigits = std::min<sal_Int32>(nPos - nStart, 9); - OSL_ENSURE(nDigits > 0, "bad code monkey: negative digits"); - nNanoSeconds=static_cast<double>(nTemp)*(1000000000.0/pow(10.0,nDigits)); + nNanoSeconds = nTemp; + sal_Int32 nDigits = nPos - nStart; + assert(nDigits >= 0); + for (; nDigits < 9; ++nDigits) + { + nNanoSeconds *= 10; + } nTemp=-1; if ('S' == string[nPos]) { |