summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-10-12 20:41:42 +0200
committerEike Rathke <erack@redhat.com>2016-10-12 20:43:49 +0200
commitc31fe18cb50724557a9b8272329addf5f818ef47 (patch)
treeafd5b99c59e0f40fd88f74f48c3a2f49ed800629 /sc
parentd9280e97c6e7b27742f26930af56b39a7d4edd75 (diff)
use isFinite() instead of !isNan()
... to cover (theoretical?) +/-inf values as well. Change-Id: I23ab17f905bbd32345b88bea87ad6f010a5406ad
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/excform.cxx4
-rw-r--r--sc/source/filter/excel/impop.cxx2
-rw-r--r--sc/source/filter/excel/xelink.cxx2
-rw-r--r--sc/source/filter/excel/xichart.cxx2
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx6
5 files changed, 8 insertions, 8 deletions
diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx
index d911f185d2d4..67e7657f3428 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -131,7 +131,7 @@ void ImportExcel::Formula(
rDoc.getDoc().EnsureTable(aScPos.Tab());
rDoc.setFormulaCell(aScPos, pCell);
pCell->SetNeedNumberFormat(false);
- if (!rtl::math::isNan(fCurVal))
+ if (rtl::math::isFinite(fCurVal))
pCell->SetResultDouble(fCurVal);
GetXFRangeBuffer().SetXF(aScPos, nXF);
@@ -173,7 +173,7 @@ void ImportExcel::Formula(
if( eErr != ConvOK )
ExcelToSc::SetError( *pCell, eErr );
- if (!rtl::math::isNan(fCurVal))
+ if (rtl::math::isFinite(fCurVal))
pCell->SetResultDouble(fCurVal);
}
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index ad286548ed99..01b5b736951e 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -869,7 +869,7 @@ void ImportExcel::Shrfmla()
rDoc.getDoc().EnsureTable(aPos.Tab());
rDoc.setFormulaCell(aPos, pCell);
pCell->SetNeedNumberFormat(false);
- if (!rtl::math::isNan(mpLastFormula->mfValue))
+ if (rtl::math::isFinite(mpLastFormula->mfValue))
pCell->SetResultDouble(mpLastFormula->mfValue);
GetXFRangeBuffer().SetXF(aPos, mpLastFormula->mnXF);
diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx
index b85051023381..2bfe77975264 100644
--- a/sc/source/filter/excel/xelink.cxx
+++ b/sc/source/filter/excel/xelink.cxx
@@ -1182,7 +1182,7 @@ void XclExpCrn::WriteBool( XclExpStream& rStrm, bool bValue )
void XclExpCrn::WriteDouble( XclExpStream& rStrm, double fValue )
{
- if( ::rtl::math::isNan( fValue ) )
+ if( !::rtl::math::isFinite( fValue ) )
{
FormulaError nScError = GetDoubleErrorValue(fValue);
WriteError( rStrm, XclTools::GetXclErrorCode( nScError ) );
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 8739a44d73a1..ac1202102472 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -1639,7 +1639,7 @@ Reference< XRegressionCurve > XclImpChSerTrendLine::CreateRegressionCurve() cons
aPropSet.SetProperty(EXC_CHPROP_EXTRAPOLATE_FORWARD, maData.mfForecastFor);
aPropSet.SetProperty(EXC_CHPROP_EXTRAPOLATE_BACKWARD, maData.mfForecastBack);
- bool bForceIntercept = !rtl::math::isNan(maData.mfIntercept);
+ bool bForceIntercept = rtl::math::isFinite(maData.mfIntercept);
aPropSet.SetProperty(EXC_CHPROP_FORCE_INTERCEPT, bForceIntercept);
if (bForceIntercept)
{
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 1369dbccd002..4633eb71daa6 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -1034,7 +1034,7 @@ void ScXMLTableRowCellContext::SetFormulaCell(ScFormulaCell* pFCell) const
pFCell->ResetDirty();
}
}
- else if (!rtl::math::isNan(fValue))
+ else if (rtl::math::isFinite(fValue))
{
pFCell->SetHybridDouble(fValue);
pFCell->ResetDirty();
@@ -1165,7 +1165,7 @@ void ScXMLTableRowCellContext::PutValueCell( const ScAddress& rCurrentPos )
// fdo#62250 absent values are not NaN, set to 0.0
// PutValueCell() is called only for a known cell value type,
// bIsEmpty==false in all these cases, no sense to check it here.
- if (::rtl::math::isNan( fValue))
+ if (!::rtl::math::isFinite( fValue))
fValue = 0.0;
// #i62435# Initialize the value cell's script type if the default
@@ -1451,7 +1451,7 @@ void ScXMLTableRowCellContext::AddFormulaCell( const ScAddress& rCellPos )
pFCell->ResetDirty();
}
}
- else if (!rtl::math::isNan(fValue))
+ else if (rtl::math::isFinite(fValue))
{
pFCell->SetResultMatrix(
nMatrixCols, nMatrixRows, pMat, new formula::FormulaDoubleToken(fValue));