diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-05-16 10:16:01 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-05-17 08:22:14 +0200 |
commit | 7ab34b51f2d45137191145d31b4b0c7d18f577bf (patch) | |
tree | abb760e86740a0e073008047d966af250e8c8c5d /reportdesign | |
parent | f8e3ad02737854686a590f7f8f02eb72e03a0f8e (diff) |
loplugin:redundantcast improvements for floating-integer conversions
Change-Id: I63dbf18f144a792ae775fe6706da81657f790016
Reviewed-on: https://gerrit.libreoffice.org/54416
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/filter/xml/xmlControlProperty.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/reportdesign/source/filter/xml/xmlControlProperty.cxx b/reportdesign/source/filter/xml/xmlControlProperty.cxx index 7eae2645c985..c232a44d6019 100644 --- a/reportdesign/source/filter/xml/xmlControlProperty.cxx +++ b/reportdesign/source/filter/xml/xmlControlProperty.cxx @@ -19,6 +19,7 @@ #include <sal/config.h> +#include <cmath> #include <map> #include "xmlControlProperty.hxx" @@ -271,7 +272,8 @@ Any OXMLControlProperty::convertString(const css::uno::Type& _rExpectedType, con { case TYPE_DATE: { - OSL_ENSURE((static_cast<sal_uInt32>(nValue)) - nValue == 0, + double dummy; + OSL_ENSURE(std::modf(nValue, &dummy) == 0, "OPropertyImport::convertString: a Date value with a fractional part?"); aReturn <<= implGetDate(nValue); } |