From 7ab34b51f2d45137191145d31b4b0c7d18f577bf Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 16 May 2018 10:16:01 +0200 Subject: loplugin:redundantcast improvements for floating-integer conversions Change-Id: I63dbf18f144a792ae775fe6706da81657f790016 Reviewed-on: https://gerrit.libreoffice.org/54416 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann --- xmloff/source/forms/propertyimport.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xmloff') diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx index 0851edf31519..679f1d5b3154 100644 --- a/xmloff/source/forms/propertyimport.cxx +++ b/xmloff/source/forms/propertyimport.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + +#include + #include "propertyimport.hxx" #include @@ -182,7 +186,8 @@ Any PropertyConversion::convertString( const css::uno::Type& _rExpectedType, { case TYPE_DATE: { - OSL_ENSURE((static_cast(nValue)) - nValue == 0, + double dummy; + OSL_ENSURE(std::modf(nValue, &dummy) == 0, "PropertyConversion::convertString: a Date value with a fractional part?"); aReturn <<= lcl_getDate(nValue); } -- cgit