diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-13 20:21:55 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-14 10:01:38 +0200 |
commit | 3b76f996997b91a19885a443d94a2a0d56dce557 (patch) | |
tree | 0726d02cbfe87efbd10ea4c879ad54404cdadbd4 | |
parent | 7223a0c1b87e865c75961fd837abce9b6ed15592 (diff) |
lcl_ScDetectiveRefIter_SkipRef always dereferences its ScDocument* arg
Change-Id: I4c8ccf6c5c629bfe4b9ece9199f1aa38f4e7f97e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102616
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sc/source/core/data/formulaiter.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/core/data/formulaiter.cxx b/sc/source/core/data/formulaiter.cxx index 386803372756..f05eea9e2d99 100644 --- a/sc/source/core/data/formulaiter.cxx +++ b/sc/source/core/data/formulaiter.cxx @@ -33,17 +33,17 @@ ScDetectiveRefIter::ScDetectiveRefIter( const ScDocument* pDoc, ScFormulaCell* p { } -static bool lcl_ScDetectiveRefIter_SkipRef( const ScDocument* pDoc, formula::FormulaToken* p, const ScAddress& rPos ) +static bool lcl_ScDetectiveRefIter_SkipRef( const ScDocument& rDoc, formula::FormulaToken* p, const ScAddress& rPos ) { ScSingleRefData& rRef1 = *p->GetSingleRef(); - ScAddress aAbs1 = rRef1.toAbs(*pDoc, rPos); - if (!pDoc->ValidAddress(aAbs1)) + ScAddress aAbs1 = rRef1.toAbs(rDoc, rPos); + if (!rDoc.ValidAddress(aAbs1)) return true; if ( p->GetType() == svDoubleRef || p->GetType() == svExternalDoubleRef ) { ScSingleRefData& rRef2 = p->GetDoubleRef()->Ref2; - ScAddress aAbs2 = rRef2.toAbs(*pDoc, rPos); - if (!pDoc->ValidAddress(aAbs2)) + ScAddress aAbs2 = rRef2.toAbs(rDoc, rPos); + if (!rDoc.ValidAddress(aAbs2)) return true; } return false; @@ -67,7 +67,7 @@ bool ScDetectiveRefIter::GetNextRef( ScRange& rRange ) formula::FormulaToken* ScDetectiveRefIter::GetNextRefToken() { formula::FormulaToken* p = maIter.GetNextReferenceRPN(); - while (p && lcl_ScDetectiveRefIter_SkipRef(mpDoc, p, aPos)) + while (p && lcl_ScDetectiveRefIter_SkipRef(*mpDoc, p, aPos)) { p = maIter.GetNextReferenceRPN(); } |