summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-13 20:23:20 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-14 10:02:00 +0200
commitc8630211eb9fda51d353c100c4f081e76617212e (patch)
tree3a2bd0e8e1ec9be2a8de4db618b5a02f06f5ae0c
parent3b76f996997b91a19885a443d94a2a0d56dce557 (diff)
lcl_fillRangeFromRefList always dereferences its ScDocument* arg
Change-Id: I73b985ba49ac2f43b4760fa8426232d4eb088345 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102617 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/core/data/formulacell.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 010b4b4a8de2..320c53a223a6 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -364,15 +364,15 @@ lcl_checkIfAdjacent(
void
lcl_fillRangeFromRefList(
- const ScDocument* pDoc,
+ const ScDocument& rDoc,
const ScAddress& aPos, const std::vector<formula::FormulaToken*>& rReferences, ScRange& rRange)
{
const ScSingleRefData aStart(
SingleDoubleRefProvider(*rReferences.front()).Ref1);
- rRange.aStart = aStart.toAbs(*pDoc, aPos);
+ rRange.aStart = aStart.toAbs(rDoc, aPos);
const ScSingleRefData aEnd(
SingleDoubleRefProvider(*rReferences.back()).Ref2);
- rRange.aEnd = aEnd.toAbs(*pDoc, aPos);
+ rRange.aEnd = aEnd.toAbs(rDoc, aPos);
}
bool
@@ -383,7 +383,7 @@ lcl_refListFormsOneRange(
{
if (rReferences.size() == 1)
{
- lcl_fillRangeFromRefList(pDoc, rPos, rReferences, rRange);
+ lcl_fillRangeFromRefList(*pDoc, rPos, rReferences, rRange);
return true;
}
@@ -415,7 +415,7 @@ lcl_refListFormsOneRange(
std::sort(rReferences.begin(), rReferences.end(), LessByReference(pDoc, rPos, aWhich));
if (lcl_checkIfAdjacent(pDoc, rPos, rReferences, aWhich))
{
- lcl_fillRangeFromRefList(pDoc, rPos, rReferences, rRange);
+ lcl_fillRangeFromRefList(*pDoc, rPos, rReferences, rRange);
return true;
}
}