sc/source/filter/excel/xelink.cxx | 3 ++- sc/source/filter/excel/xltools.cxx | 9 +-------- 2 files changed, 3 insertions(+), 9 deletions(-)
New commits: commit 2cfcf12836afe5437b0fd8720bde3a997aae58ac Author: Noel Grandin <n...@peralex.com> Date: Mon Sep 12 15:48:33 2016 +0200 remove open-coded versions of GetDoubleErrorValue and CreateDoubleError Change-Id: I07a1540a1b9ca60fa1e62e9cc0091866d9f2f64d Reviewed-on: https://gerrit.libreoffice.org/28838 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index 96b6394..c54c6fb 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -20,6 +20,7 @@ #include "xelink.hxx" #include <algorithm> +#include <formula/errorcodes.hxx> #include <unotools/collatorwrapper.hxx> #include <svl/zforlist.hxx> #include "document.hxx" @@ -1184,7 +1185,7 @@ void XclExpCrn::WriteDouble( XclExpStream& rStrm, double fValue ) { if( ::rtl::math::isNan( fValue ) ) { - sal_uInt16 nScError = static_cast< sal_uInt16 >( reinterpret_cast< const sal_math_Double* >( &fValue )->nan_parts.fraction_lo ); + sal_uInt16 nScError = formula::GetDoubleErrorValue(fValue); WriteError( rStrm, XclTools::GetXclErrorCode( nScError ) ); } else diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx index 3b3c1c8..a187eba 100644 --- a/sc/source/filter/excel/xltools.cxx +++ b/sc/source/filter/excel/xltools.cxx @@ -239,14 +239,7 @@ sal_uInt16 XclTools::GetScErrorCode( sal_uInt8 nXclError ) double XclTools::ErrorToDouble( sal_uInt8 nXclError ) { - union - { - double fVal; - sal_math_Double smD; - }; - ::rtl::math::setNan( &fVal ); - smD.nan_parts.fraction_lo = GetScErrorCode( nXclError ); - return fVal; + return formula::CreateDoubleError(GetScErrorCode( nXclError )); } XclBoolError XclTools::ErrorToEnum( double& rfDblValue, bool bErrOrBool, sal_uInt8 nValue ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits