diff options
-rw-r--r-- | xmloff/source/draw/propimp0.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/xmloff/source/draw/propimp0.cxx b/xmloff/source/draw/propimp0.cxx index 8b7453f2602a..0ac8bf33b074 100644 --- a/xmloff/source/draw/propimp0.cxx +++ b/xmloff/source/draw/propimp0.cxx @@ -48,15 +48,21 @@ bool XMLDurationPropertyHdl::importXML( const SvXMLUnitConverter& ) const { util::Duration aDuration; - ::sax::Converter::convertDuration(aDuration, rStrImpValue); - const double fSeconds = ((aDuration.Days * 24 + aDuration.Hours) * 60 - + aDuration.Minutes) * 60 - + aDuration.Seconds - + aDuration.NanoSeconds / static_cast<double>(::tools::Time::nanoSecPerSec); - rValue <<= fSeconds; + if (::sax::Converter::convertDuration(aDuration, rStrImpValue)) + { + const double fSeconds = ((aDuration.Days * 24 + aDuration.Hours) * 60 + + aDuration.Minutes) * 60 + + aDuration.Seconds + + aDuration.NanoSeconds / static_cast<double>(::tools::Time::nanoSecPerSec); + rValue <<= fSeconds; - return true; + return true; + } + + SAL_WARN_IF(!rStrImpValue.isEmpty(), "xmloff", "Invalid duration: " << rStrImpValue); + + return false; } bool XMLDurationPropertyHdl::exportXML( |