Kaydet (Commit) 8a21d424 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1187670 Dereference null return value

Change-Id: Ib1b2616e48d1fed7ae1557f60af04920025a9ae5
üst 467a4d5f
...@@ -420,7 +420,8 @@ std::vector<double>& ScColorFormat::getValues() const ...@@ -420,7 +420,8 @@ std::vector<double>& ScColorFormat::getValues() const
} }
else if(eType == CELLTYPE_FORMULA) else if(eType == CELLTYPE_FORMULA)
{ {
if (mpDoc->GetFormulaCell(aAddr)->IsValue()) ScFormulaCell *pCell = mpDoc->GetFormulaCell(aAddr);
if (pCell && pCell->IsValue())
{ {
double aVal = mpDoc->GetValue(nCol, nRow, nTab); double aVal = mpDoc->GetValue(nCol, nRow, nTab);
rValues.push_back(aVal); rValues.push_back(aVal);
...@@ -544,7 +545,8 @@ Color* ScColorScaleFormat::GetColor( const ScAddress& rAddr ) const ...@@ -544,7 +545,8 @@ Color* ScColorScaleFormat::GetColor( const ScAddress& rAddr ) const
if (eCellType == CELLTYPE_FORMULA) if (eCellType == CELLTYPE_FORMULA)
{ {
if (!mpDoc->GetFormulaCell(rAddr)->IsValue()) ScFormulaCell *pCell = mpDoc->GetFormulaCell(rAddr);
if (!pCell || !pCell->IsValue())
return NULL; return NULL;
} }
...@@ -834,7 +836,8 @@ ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const ...@@ -834,7 +836,8 @@ ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const
if (eCellType == CELLTYPE_FORMULA) if (eCellType == CELLTYPE_FORMULA)
{ {
if (!mpDoc->GetFormulaCell(rAddr)->IsValue()) ScFormulaCell *pCell = mpDoc->GetFormulaCell(rAddr);
if (!pCell || !pCell->IsValue())
return NULL; return NULL;
} }
...@@ -972,7 +975,8 @@ ScIconSetInfo* ScIconSetFormat::GetIconSetInfo(const ScAddress& rAddr) const ...@@ -972,7 +975,8 @@ ScIconSetInfo* ScIconSetFormat::GetIconSetInfo(const ScAddress& rAddr) const
if (eCellType == CELLTYPE_FORMULA) if (eCellType == CELLTYPE_FORMULA)
{ {
if (!mpDoc->GetFormulaCell(rAddr)->IsValue()) ScFormulaCell *pCell = mpDoc->GetFormulaCell(rAddr);
if (!pCell || !pCell->IsValue())
return NULL; return NULL;
} }
......
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