diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-09-05 15:11:04 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-09-05 18:25:51 +0200 |
commit | 045765d8b3cd9b00a76e58dfaaffc83422f5fb28 (patch) | |
tree | 5fe3217a76a5cb251f01e6d75009d4396f9c557a /sc | |
parent | f37ef60c19d1608f0b597d37d025e401d6c99171 (diff) |
cid#1491055 Explicit null dereferenced
this always dereferenced pCode so it already assumes pCode cannot be null
Change-Id: I19b601d7f2e089eb2037532590f727c5cd276dd7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121695
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/sharedformula.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/core/tool/sharedformula.cxx b/sc/source/core/tool/sharedformula.cxx index 167bd951e226..fa617df53c7a 100644 --- a/sc/source/core/tool/sharedformula.cxx +++ b/sc/source/core/tool/sharedformula.cxx @@ -392,17 +392,17 @@ void SharedFormulaUtil::startListeningAsGroup( sc::StartListeningContext& rCxt, rDoc.SetDetectiveDirty(true); ScFormulaCellGroupRef xGroup = rTopCell.GetCellGroup(); - const ScTokenArray* pCode = xGroup->mpCode ? &*xGroup->mpCode : nullptr; - assert(pCode == rTopCell.GetCode()); - if (pCode->IsRecalcModeAlways()) + const ScTokenArray& rCode = *xGroup->mpCode; + assert(&rCode == rTopCell.GetCode()); + if (rCode.IsRecalcModeAlways()) { rDoc.StartListeningArea( BCA_LISTEN_ALWAYS, false, xGroup->getAreaListener(ppSharedTop, BCA_LISTEN_ALWAYS, true, true)); } - formula::FormulaToken** p = pCode->GetCode(); - formula::FormulaToken** pEnd = p + pCode->GetCodeLen(); + formula::FormulaToken** p = rCode.GetCode(); + formula::FormulaToken** pEnd = p + rCode.GetCodeLen(); for (; p != pEnd; ++p) { const formula::FormulaToken* t = *p; |