summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-13 20:37:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-14 10:03:17 +0200
commit93e29317709400e27e1d865f6ab456e92e534736 (patch)
tree7d31d75b7b1196a2988e1a0120d05f3357e617f8
parente2a9b2ec36496c58c070f31b2c582f6669885f6c (diff)
lcl_refListFormsOneRange always dereferences their ScDocument* arg
Change-Id: Iaf9557cdca09efa3b5a14238b79309b76f3c5cc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102620 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/core/data/formulacell.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 16673eebf752..c9cdd3316376 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -377,20 +377,20 @@ lcl_fillRangeFromRefList(
bool
lcl_refListFormsOneRange(
- const ScDocument* pDoc,
+ const ScDocument& rDoc,
const ScAddress& rPos, std::vector<formula::FormulaToken*>& rReferences,
ScRange& rRange)
{
if (rReferences.size() == 1)
{
- lcl_fillRangeFromRefList(*pDoc, rPos, rReferences, rRange);
+ lcl_fillRangeFromRefList(rDoc, rPos, rReferences, rRange);
return true;
}
bool bCell(false);
bool bRow(false);
bool bTab(false);
- if (lcl_checkRangeDimensions(*pDoc, rPos, rReferences.begin(), rReferences.end(), bCell, bRow, bTab))
+ if (lcl_checkRangeDimensions(rDoc, rPos, rReferences.begin(), rReferences.end(), bCell, bRow, bTab))
{
DimensionSelector aWhich;
if (bCell)
@@ -412,10 +412,10 @@ lcl_refListFormsOneRange(
}
// Sort the references by start of range
- std::sort(rReferences.begin(), rReferences.end(), LessByReference(*pDoc, rPos, aWhich));
- if (lcl_checkIfAdjacent(*pDoc, rPos, rReferences, aWhich))
+ std::sort(rReferences.begin(), rReferences.end(), LessByReference(rDoc, rPos, aWhich));
+ if (lcl_checkIfAdjacent(rDoc, rPos, rReferences, aWhich))
{
- lcl_fillRangeFromRefList(*pDoc, rPos, rReferences, rRange);
+ lcl_fillRangeFromRefList(rDoc, rPos, rReferences, rRange);
return true;
}
}
@@ -3086,7 +3086,7 @@ ScFormulaCell::HasRefListExpressibleAsOneReference(ScRange& rRange) const
if (pFunction && !aIter.GetNextReferenceRPN()
&& (pFunction->GetParamCount() == aReferences.size()))
{
- return lcl_refListFormsOneRange(pDocument, aPos, aReferences, rRange);
+ return lcl_refListFormsOneRange(*pDocument, aPos, aReferences, rRange);
}
}
return false;