diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-26 09:36:59 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-26 12:14:35 +0000 |
commit | d57d8eb4c4fa7845bf67bd0c5b931c38b42841b2 (patch) | |
tree | 59ba04ef344c22ab23fbb049e66c68656541fa96 /sc | |
parent | 1b919a83e7d6723ee2c2b8c42d55059e3c3dda5f (diff) |
coverity#704680 Dereference after null check
Change-Id: I50a6067b828cb5277f91aba697b419b8d0167efe
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/xeformula.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx index 752c6a997f81..5fcfbe443e96 100644 --- a/sc/source/filter/excel/xeformula.cxx +++ b/sc/source/filter/excel/xeformula.cxx @@ -589,11 +589,14 @@ void XclExpFmlaCompImpl::Init( XclFormulaType eType, const ScTokenArray& rScTokA break; case EXC_FMLATYPE_SHARED: mxData->mbOk = pScBasePos != 0; - OSL_ENSURE( mxData->mbOk, "XclExpFmlaCompImpl::Init - missing cell address" ); - // clone the passed token array, convert references relative to current cell position - mxData->mxOwnScTokArr.reset( rScTokArr.Clone() ); - ScCompiler::MoveRelWrap( *mxData->mxOwnScTokArr, GetDocPtr(), *pScBasePos, MAXCOL, MAXROW ); - // don't remember pScBasePos in mxData->mpScBasePos, shared formulas use real relative refs + assert(mxData->mbOk && "XclExpFmlaCompImpl::Init - missing cell address"); + if (mxData->mbOk) + { + // clone the passed token array, convert references relative to current cell position + mxData->mxOwnScTokArr.reset( rScTokArr.Clone() ); + ScCompiler::MoveRelWrap( *mxData->mxOwnScTokArr, GetDocPtr(), *pScBasePos, MAXCOL, MAXROW ); + // don't remember pScBasePos in mxData->mpScBasePos, shared formulas use real relative refs + } break; default:; } |