diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-11 15:32:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-11 17:33:48 +0100 |
commit | 01c74f4319085a455898f01ce939a2679fdc9460 (patch) | |
tree | 1623394c6dc8dbdc1113b72f72dd1407342987df /xmloff | |
parent | c10548eaa93bbac36e1b361475d8676ebc4042a3 (diff) |
coverity#735353 Unchecked return value
Change-Id: Iab54019d07ac27b4d8247d789c29165d24e2288f
Diffstat (limited to 'xmloff')
-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( |