summaryrefslogtreecommitdiff
path: root/sc/source/filter
diff options
context:
space:
mode:
authorjames <jamesnattala007@gmail.com>2020-03-27 17:46:59 +0530
committerMike Kaganski <mike.kaganski@collabora.com>2020-03-29 21:21:23 +0200
commit97bc0eae8bf884105cfcd0e21473c92a89c62f67 (patch)
tree8ded073b6cb7a8b074269691da3b515f8282ea04 /sc/source/filter
parent80948ae6a2100e6ea13306599dd41092fa870884 (diff)
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.kaganski@collabora.com>
Diffstat (limited to 'sc/source/filter')
-rw-r--r--sc/source/filter/oox/biffhelper.cxx29
1 files changed, 9 insertions, 20 deletions
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 --------------------------------------------------------------