[Libreoffice-commits] core.git: sc/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Mon Sep 14 08:03:30 UTC 2020
sc/source/core/data/formulacell.cxx | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
New commits:
commit e2a9b2ec36496c58c070f31b2c582f6669885f6c
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Sep 13 20:34:44 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Sep 14 10:02:43 2020 +0200
lcl_checkRangeDimension always dereferences their ScDocument* arg
Change-Id: I7bc04faf4a95c0b77eb0ddbe69b26e5007127ca3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102619
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 675a349a11c3..16673eebf752 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -249,23 +249,23 @@ SCCOLROW lcl_GetTab(const ScDocument& rDoc, const ScAddress& rPos, const ScSingl
*/
bool
lcl_checkRangeDimension(
- const ScDocument* pDoc,
+ const ScDocument& rDoc,
const ScAddress& rPos, const SingleDoubleRefProvider& rRef1, const SingleDoubleRefProvider& rRef2,
const DimensionSelector aWhich)
{
- return aWhich(*pDoc, rPos, rRef1.Ref1) == aWhich(*pDoc, rPos, rRef2.Ref1) &&
- aWhich(*pDoc, rPos, rRef1.Ref2) == aWhich(*pDoc, rPos, rRef2.Ref2);
+ return aWhich(rDoc, rPos, rRef1.Ref1) == aWhich(rDoc, rPos, rRef2.Ref1) &&
+ aWhich(rDoc, rPos, rRef1.Ref2) == aWhich(rDoc, rPos, rRef2.Ref2);
}
bool
lcl_checkRangeDimensions(
- const ScDocument* pDoc,
+ const ScDocument& rDoc,
const ScAddress& rPos, const SingleDoubleRefProvider& rRef1, const SingleDoubleRefProvider& rRef2,
bool& bCol, bool& bRow, bool& bTab)
{
- const bool bSameCols(lcl_checkRangeDimension(pDoc, rPos, rRef1, rRef2, lcl_GetCol));
- const bool bSameRows(lcl_checkRangeDimension(pDoc, rPos, rRef1, rRef2, lcl_GetRow));
- const bool bSameTabs(lcl_checkRangeDimension(pDoc, rPos, rRef1, rRef2, lcl_GetTab));
+ const bool bSameCols(lcl_checkRangeDimension(rDoc, rPos, rRef1, rRef2, lcl_GetCol));
+ const bool bSameRows(lcl_checkRangeDimension(rDoc, rPos, rRef1, rRef2, lcl_GetRow));
+ const bool bSameTabs(lcl_checkRangeDimension(rDoc, rPos, rRef1, rRef2, lcl_GetTab));
// Test if exactly two dimensions are equal
if (int(bSameCols) + int(bSameRows) + int(bSameTabs) == 2)
@@ -283,7 +283,7 @@ lcl_checkRangeDimensions(
*/
bool
lcl_checkRangeDimensions(
- const ScDocument* pDoc, const ScAddress& rPos,
+ const ScDocument& rDoc, const ScAddress& rPos,
const std::vector<formula::FormulaToken*>::const_iterator& rBegin,
const std::vector<formula::FormulaToken*>::const_iterator& rEnd,
bool& bCol, bool& bRow, bool& bTab)
@@ -294,7 +294,7 @@ lcl_checkRangeDimensions(
bool bOk(false);
{
const SingleDoubleRefProvider aRefCur(**aCur);
- bOk = lcl_checkRangeDimensions(pDoc, rPos, aRef, aRefCur, bCol, bRow, bTab);
+ bOk = lcl_checkRangeDimensions(rDoc, rPos, aRef, aRefCur, bCol, bRow, bTab);
}
while (bOk && aCur != rEnd)
{
@@ -302,7 +302,7 @@ lcl_checkRangeDimensions(
bool bColTmp(false);
bool bRowTmp(false);
bool bTabTmp(false);
- bOk = lcl_checkRangeDimensions(pDoc, rPos, aRef, aRefCur, bColTmp, bRowTmp, bTabTmp);
+ bOk = lcl_checkRangeDimensions(rDoc, rPos, aRef, aRefCur, bColTmp, bRowTmp, bTabTmp);
bOk = bOk && (bCol == bColTmp && bRow == bRowTmp && bTab == bTabTmp);
++aCur;
}
@@ -390,7 +390,7 @@ lcl_refListFormsOneRange(
bool bCell(false);
bool bRow(false);
bool bTab(false);
- if (lcl_checkRangeDimensions(pDoc, rPos, rReferences.begin(), rReferences.end(), bCell, bRow, bTab))
+ if (lcl_checkRangeDimensions(*pDoc, rPos, rReferences.begin(), rReferences.end(), bCell, bRow, bTab))
{
DimensionSelector aWhich;
if (bCell)
More information about the Libreoffice-commits
mailing list