diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-02-27 11:02:22 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-27 12:58:46 +0000 |
commit | 602ca93561d9d6b12f110134a6341e24a560d7fe (patch) | |
tree | 59a432b0f665c372be0b298dfc040281daa19c52 /sc | |
parent | 3a22310bd220e29489ccea9cbec764170528d2d4 (diff) |
coverity#1187684 Dereference null return value
Change-Id: I3b8652b2a5f1a8cfcda46774890de4eac5c5583b
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/xmlcelli.cxx | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index ffb2c92c02c4..be0a75eaadca 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -1423,25 +1423,26 @@ void ScXMLTableRowCellContext::AddFormulaCell( const ScAddress& rCellPos ) // Set the value/text of the top-left matrix position in its // cached result. For import, we only need to set the correct // matrix geometry and the value type of the top-left element. - ScFormulaCell* pFCell = rXMLImport.GetDocument()->GetFormulaCell(rCellPos); - - ScMatrixRef pMat(new ScMatrix(nMatrixCols, nMatrixRows)); - if (bFormulaTextResult && maStringValue) + if (pFCell) { - if (!IsPossibleErrorString()) + ScMatrixRef pMat(new ScMatrix(nMatrixCols, nMatrixRows)); + if (bFormulaTextResult && maStringValue) + { + if (!IsPossibleErrorString()) + { + pFCell->SetResultMatrix( + nMatrixCols, nMatrixRows, pMat, new formula::FormulaStringToken(*maStringValue)); + pFCell->ResetDirty(); + } + } + else if (!rtl::math::isNan(fValue)) { pFCell->SetResultMatrix( - nMatrixCols, nMatrixRows, pMat, new formula::FormulaStringToken(*maStringValue)); + nMatrixCols, nMatrixRows, pMat, new formula::FormulaDoubleToken(fValue)); pFCell->ResetDirty(); } } - else if (!rtl::math::isNan(fValue)) - { - pFCell->SetResultMatrix( - nMatrixCols, nMatrixRows, pMat, new formula::FormulaDoubleToken(fValue)); - pFCell->ResetDirty(); - } } } else |