Kaydet (Commit) fdb67118 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

Fix detection of force intercept in XLS 97/2000/XP format.

NaN value indicates if the force intercept is enabled or not.

Change-Id: I51d33a6e04a4b5832f241e7ae7ee6d2fbb32ea9b
üst c86aed38
......@@ -195,13 +195,6 @@ void lclConvertTimeInterval( Any& rInterval, sal_uInt16 nValue, bool bAuto, sal_
rInterval <<= cssc::TimeInterval( nValue, lclGetApiTimeUnit( nTimeUnit ) );
}
bool lcl_IsForceIntercept(double intercept)
{
sal_math_Double* pIntercept = reinterpret_cast<sal_math_Double*>(&intercept);
return (pIntercept->w32_parts.msw != 0xFFFFFFFF ||
pIntercept->w32_parts.lsw != 0xFFFFFFFF);
}
} // namespace
// Common =====================================================================
......@@ -1657,7 +1650,7 @@ Reference< XRegressionCurve > XclImpChSerTrendLine::CreateRegressionCurve() cons
aPropSet.SetProperty(EXC_CHPROP_EXTRAPOLATE_FORWARD, maData.mfForecastFor);
aPropSet.SetProperty(EXC_CHPROP_EXTRAPOLATE_BACKWARD, maData.mfForecastBack);
sal_Bool bForceIntercept = lcl_IsForceIntercept(maData.mfIntercept);
sal_Bool bForceIntercept = !rtl::math::isNan(maData.mfIntercept);
aPropSet.SetProperty(EXC_CHPROP_FORCE_INTERCEPT, bForceIntercept);
if (bForceIntercept)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment