summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sax/source/tools/converter.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index 02131ed8e89f..4e61f27dd238 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;
}
}