sc/source/filter/oox/biffhelper.cxx | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-)
New commits: commit 97bc0eae8bf884105cfcd0e21473c92a89c62f67 Author: james <jamesnattala...@gmail.com> AuthorDate: Fri Mar 27 17:46:59 2020 +0530 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sun Mar 29 21:21:23 2020 +0200 tdf#130981:Simplify uses of sal_math_Double Change-Id: I2cac5d7c2efc9dbf4c4fc7ca5d88e9044d875edc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91203 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sc/source/filter/oox/biffhelper.cxx b/sc/source/filter/oox/biffhelper.cxx index ec9b3acbe2a8..11582c7e63ce 100644 --- a/sc/source/filter/oox/biffhelper.cxx +++ b/sc/source/filter/oox/biffhelper.cxx @@ -31,39 +31,28 @@ const sal_Int32 BIFF_RK_100FLAG = 0x00000001; const sal_Int32 BIFF_RK_INTFLAG = 0x00000002; const sal_Int32 BIFF_RK_VALUEMASK = 0xFFFFFFFC; -union DecodedDouble -{ - double mfValue; - sal_math_Double maStruct; - - explicit DecodedDouble() {} - explicit DecodedDouble( double fValue ) : mfValue( fValue ) {} -}; - } // namespace // conversion ----------------------------------------------------------------- /*static*/ double BiffHelper::calcDoubleFromRk( sal_Int32 nRkValue ) { - DecodedDouble aDecDbl( 0.0 ); + sal_math_Double aMathDouble{}; if( getFlag( nRkValue, BIFF_RK_INTFLAG ) ) { sal_Int32 nTemp = nRkValue >> 2; setFlag< sal_Int32 >( nTemp, 0xE0000000, nRkValue < 0 ); - aDecDbl.mfValue = nTemp; + aMathDouble.value = nTemp; } else { - aDecDbl.maStruct.w32_parts.msw = static_cast< sal_uInt32 >( nRkValue & BIFF_RK_VALUEMASK ); + aMathDouble.w32_parts.msw = static_cast< sal_uInt32 >( nRkValue & BIFF_RK_VALUEMASK ); } - if( getFlag( nRkValue, BIFF_RK_100FLAG ) ) - aDecDbl.mfValue /= 100.0; + aMathDouble.value /= 100.0; - return aDecDbl.mfValue; + return aMathDouble.value; } - /*static*/ double BiffHelper::calcDoubleFromError( sal_uInt8 nErrorCode ) { sal_uInt16 nApiError = 0x7FFF; @@ -78,10 +67,10 @@ union DecodedDouble case BIFF_ERR_NA: nApiError = 0x7FFF; break; default: OSL_FAIL( "BiffHelper::calcDoubleFromError - unknown error code" ); } - DecodedDouble aDecDbl; - ::rtl::math::setNan( &aDecDbl.mfValue ); - aDecDbl.maStruct.nan_parts.fraction_lo = nApiError; - return aDecDbl.mfValue; + sal_math_Double aMathDouble; + ::rtl::math::setNan( &aMathDouble.value ); + aMathDouble.nan_parts.fraction_lo = nApiError; + return aMathDouble.value; } // BIFF12 import -------------------------------------------------------------- _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits