summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2022-09-11 00:46:58 +0200
committerEike Rathke <erack@redhat.com>2022-09-11 11:31:30 +0200
commit5f5f2f8107b6176654bfb9a30c21b7d5e0c62c6f (patch)
tree202bda589543b818348ae39cdbfdc385a406c2db
parent38db900c1f7b471dfdf575bbda522a792db51372 (diff)
ScValueIterator ScDocument& parameter is now superfluous
Since commit 3be1cdce9d92cbadca1b276b3193c727032ea717 ScInterpreterContext is passed that has it. Just a minor change for a const ScDocument&. Change-Id: I388ff55393056c52f85d7543fcfb6c549fc2a346 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139759 Tested-by: Eike Rathke <erack@redhat.com> Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/inc/dociter.hxx4
-rw-r--r--sc/qa/unit/ucalc.cxx2
-rw-r--r--sc/source/core/data/dociter.cxx18
-rw-r--r--sc/source/core/tool/interpr1.cxx14
-rw-r--r--sc/source/core/tool/interpr2.cxx4
-rw-r--r--sc/source/core/tool/interpr3.cxx16
-rw-r--r--sc/source/core/tool/interpr5.cxx4
-rw-r--r--sc/source/core/tool/interpr6.cxx2
8 files changed, 32 insertions, 32 deletions
diff --git a/sc/inc/dociter.hxx b/sc/inc/dociter.hxx
index c8b51b9e24ff..b73d175a000f 100644
--- a/sc/inc/dociter.hxx
+++ b/sc/inc/dociter.hxx
@@ -52,7 +52,7 @@ class ScValueIterator // walk through all values in an area
{
typedef sc::CellStoreType::const_position_type PositionType;
- ScDocument& mrDoc;
+ const ScDocument& mrDoc;
ScInterpreterContext& mrContext;
const ScAttrArray* pAttrArray;
sal_uInt32 nNumFormat; // for CalcAsShown
@@ -84,7 +84,7 @@ class ScValueIterator // walk through all values in an area
public:
ScValueIterator(ScInterpreterContext& rContext,
- ScDocument& rDocument, const ScRange& rRange, SubtotalFlags nSubTotalFlags = SubtotalFlags::NONE,
+ const ScRange& rRange, SubtotalFlags nSubTotalFlags = SubtotalFlags::NONE,
bool bTextAsZero = false );
void GetCurNumFmtInfo( SvNumFormatType& nType, sal_uInt32& nIndex );
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 0b21003a56c8..87ab1c55155e 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -1345,7 +1345,7 @@ void Test::testValueIterator()
{
const double aChecks[] = { 1.0, 2.0, 3.0 };
size_t const nCheckLen = SAL_N_ELEMENTS(aChecks);
- ScValueIterator aIter(aContext, *m_pDoc, ScRange(1,2,0,3,2,0));
+ ScValueIterator aIter(aContext, ScRange(1,2,0,3,2,0));
bool bHas = false;
size_t nCheckPos = 0;
double fVal;
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 0fb2fec32673..123d96d91b8c 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -82,9 +82,9 @@ static void ScAttrArray_IterGetNumberFormat( sal_uInt32& nFormat, const ScAttrAr
nAttrEndRow = nRowEnd;
}
-ScValueIterator::ScValueIterator(ScInterpreterContext& rContext, ScDocument& rDocument, const ScRange& rRange,
+ScValueIterator::ScValueIterator(ScInterpreterContext& rContext, const ScRange& rRange,
SubtotalFlags nSubTotalFlags, bool bTextZero )
- : mrDoc(rDocument)
+ : mrDoc(*rContext.mpDoc)
, mrContext(rContext)
, pAttrArray(nullptr)
, nNumFormat(0) // Initialized in GetNumberFormat
@@ -97,16 +97,16 @@ ScValueIterator::ScValueIterator(ScInterpreterContext& rContext, ScDocument& rDo
, mnSubTotalFlags(nSubTotalFlags)
, nNumFmtType(SvNumFormatType::UNDEFINED)
, bNumValid(false)
- , bCalcAsShown(rDocument.GetDocOptions().IsCalcAsShown())
+ , bCalcAsShown((*rContext.mpDoc).GetDocOptions().IsCalcAsShown())
, bTextAsZero(bTextZero)
, mpCells(nullptr)
{
- SCTAB nDocMaxTab = rDocument.GetTableCount() - 1;
+ SCTAB nDocMaxTab = mrDoc.GetTableCount() - 1;
- if (!rDocument.ValidCol(maStartPos.Col())) maStartPos.SetCol(mrDoc.MaxCol());
- if (!rDocument.ValidCol(maEndPos.Col())) maEndPos.SetCol(mrDoc.MaxCol());
- if (!rDocument.ValidRow(maStartPos.Row())) maStartPos.SetRow(mrDoc.MaxRow());
- if (!rDocument.ValidRow(maEndPos.Row())) maEndPos.SetRow(mrDoc.MaxRow());
+ if (!mrDoc.ValidCol(maStartPos.Col())) maStartPos.SetCol(mrDoc.MaxCol());
+ if (!mrDoc.ValidCol(maEndPos.Col())) maEndPos.SetCol(mrDoc.MaxCol());
+ if (!mrDoc.ValidRow(maStartPos.Row())) maStartPos.SetRow(mrDoc.MaxRow());
+ if (!mrDoc.ValidRow(maEndPos.Row())) maEndPos.SetRow(mrDoc.MaxRow());
if (!ValidTab(maStartPos.Tab()) || maStartPos.Tab() > nDocMaxTab) maStartPos.SetTab(nDocMaxTab);
if (!ValidTab(maEndPos.Tab()) || maEndPos.Tab() > nDocMaxTab) maEndPos.SetTab(nDocMaxTab);
}
@@ -272,7 +272,7 @@ bool ScValueIterator::GetFirst(double& rValue, FormulaError& rErr)
mnCol = maStartPos.Col();
mnTab = maStartPos.Tab();
- ScTable* pTab = mrDoc.FetchTable(mnTab);
+ const ScTable* pTab = mrDoc.FetchTable(mnTab);
if (!pTab)
return false;
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 279d33f29cae..a4f316c75a78 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -1314,7 +1314,7 @@ void ScInterpreter::ScAnd()
{
double fVal;
FormulaError nErr = FormulaError::NONE;
- ScValueIterator aValIter( mrContext, mrDoc, aRange );
+ ScValueIterator aValIter( mrContext, aRange );
if ( aValIter.GetFirst( fVal, nErr ) && nErr == FormulaError::NONE )
{
bHaveValue = true;
@@ -1412,7 +1412,7 @@ void ScInterpreter::ScOr()
{
double fVal;
FormulaError nErr = FormulaError::NONE;
- ScValueIterator aValIter( mrContext, mrDoc, aRange );
+ ScValueIterator aValIter( mrContext, aRange );
if ( aValIter.GetFirst( fVal, nErr ) )
{
bHaveValue = true;
@@ -1514,7 +1514,7 @@ void ScInterpreter::ScXor()
{
double fVal;
FormulaError nErr = FormulaError::NONE;
- ScValueIterator aValIter( mrContext, mrDoc, aRange );
+ ScValueIterator aValIter( mrContext, aRange );
if ( aValIter.GetFirst( fVal, nErr ) )
{
bHaveValue = true;
@@ -3692,7 +3692,7 @@ void ScInterpreter::ScMin( bool bTextAsZero )
{
FormulaError nErr = FormulaError::NONE;
PopDoubleRef( aRange, nParamCount, nRefInList);
- ScValueIterator aValIter( mrContext, mrDoc, aRange, mnSubTotalFlags, bTextAsZero );
+ ScValueIterator aValIter( mrContext, aRange, mnSubTotalFlags, bTextAsZero );
if (aValIter.GetFirst(nVal, nErr))
{
if (nMin > nVal)
@@ -3849,7 +3849,7 @@ void ScInterpreter::ScMax( bool bTextAsZero )
{
FormulaError nErr = FormulaError::NONE;
PopDoubleRef( aRange, nParamCount, nRefInList);
- ScValueIterator aValIter( mrContext, mrDoc, aRange, mnSubTotalFlags, bTextAsZero );
+ ScValueIterator aValIter( mrContext, aRange, mnSubTotalFlags, bTextAsZero );
if (aValIter.GetFirst(nVal, nErr))
{
if (nMax < nVal)
@@ -4025,7 +4025,7 @@ void ScInterpreter::GetStVarParams( bool bTextAsZero, double(*VarResult)( double
ArrayRefListValue& rArrayValue = vArrayValues[nRefArrayPos];
FormulaError nErr = FormulaError::NONE;
PopDoubleRef( aRange, nParamCount, nRefInList);
- ScValueIterator aValIter( mrContext, mrDoc, aRange, mnSubTotalFlags, bTextAsZero );
+ ScValueIterator aValIter( mrContext, aRange, mnSubTotalFlags, bTextAsZero );
if (aValIter.GetFirst(fVal, nErr))
{
do
@@ -4050,7 +4050,7 @@ void ScInterpreter::GetStVarParams( bool bTextAsZero, double(*VarResult)( double
{
FormulaError nErr = FormulaError::NONE;
PopDoubleRef( aRange, nParamCount, nRefInList);
- ScValueIterator aValIter( mrContext, mrDoc, aRange, mnSubTotalFlags, bTextAsZero );
+ ScValueIterator aValIter( mrContext, aRange, mnSubTotalFlags, bTextAsZero );
if (aValIter.GetFirst(fVal, nErr))
{
do
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 01d09237a349..707d9c66cb3d 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -1441,7 +1441,7 @@ void ScInterpreter::ScIRR()
}
else
{
- ScValueIterator aValIter(mrContext, mrDoc, aRange, mnSubTotalFlags);
+ ScValueIterator aValIter(mrContext, aRange, mnSubTotalFlags);
bool bLoop = aValIter.GetFirst(fValue, nIterError);
while (bLoop && nIterError == FormulaError::NONE)
{
@@ -1549,7 +1549,7 @@ void ScInterpreter::ScMIRR()
}
else
{
- ScValueIterator aValIter( mrContext, mrDoc, aRange, mnSubTotalFlags );
+ ScValueIterator aValIter( mrContext, aRange, mnSubTotalFlags );
double fCellValue;
FormulaError nIterError = FormulaError::NONE;
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 3268ee5ee68c..46de733e398f 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -2505,7 +2505,7 @@ void ScInterpreter::ScZTest()
ScRange aRange;
FormulaError nErr = FormulaError::NONE;
PopDoubleRef( aRange, nParam, nRefInList);
- ScValueIterator aValIter( mrContext, mrDoc, aRange, mnSubTotalFlags );
+ ScValueIterator aValIter( mrContext, aRange, mnSubTotalFlags );
if (aValIter.GetFirst(fVal, nErr))
{
fSum += fVal;
@@ -2947,7 +2947,7 @@ void ScInterpreter::ScHarMean()
FormulaError nErr = FormulaError::NONE;
PopDoubleRef( aRange, nParamCount, nRefInList);
double nCellVal;
- ScValueIterator aValIter( mrContext, mrDoc, aRange, mnSubTotalFlags );
+ ScValueIterator aValIter( mrContext, aRange, mnSubTotalFlags );
if (aValIter.GetFirst(nCellVal, nErr))
{
if (nCellVal > 0.0)
@@ -3085,7 +3085,7 @@ void ScInterpreter::ScGeoMean()
FormulaError nErr = FormulaError::NONE;
PopDoubleRef( aRange, nParamCount, nRefInList);
double nCellVal;
- ScValueIterator aValIter(mrContext, mrDoc, aRange, mnSubTotalFlags);
+ ScValueIterator aValIter(mrContext, aRange, mnSubTotalFlags);
if (aValIter.GetFirst(nCellVal, nErr))
{
if (nCellVal > 0.0)
@@ -3250,7 +3250,7 @@ bool ScInterpreter::CalculateSkew(KahanSum& fSum, double& fCount, std::vector<do
{
PopDoubleRef( aRange, nParamCount, nRefInList);
FormulaError nErr = FormulaError::NONE;
- ScValueIterator aValIter( mrContext, mrDoc, aRange, mnSubTotalFlags );
+ ScValueIterator aValIter( mrContext, aRange, mnSubTotalFlags );
if (aValIter.GetFirst(fVal, nErr))
{
fSum += fVal;
@@ -3885,7 +3885,7 @@ std::vector<double> ScInterpreter::GetTopNumberArray( SCSIZE& rCol, SCSIZE& rRow
FormulaError nErr = FormulaError::NONE;
double fCellVal;
- ScValueIterator aValIter(mrContext, mrDoc, aRange, mnSubTotalFlags);
+ ScValueIterator aValIter(mrContext, aRange, mnSubTotalFlags);
if (aValIter.GetFirst(fCellVal, nErr))
{
do
@@ -3966,7 +3966,7 @@ void ScInterpreter::GetNumberSequenceArray( sal_uInt8 nParamCount, vector<double
FormulaError nErr = FormulaError::NONE;
double fCellVal;
- ScValueIterator aValIter( mrContext, mrDoc, aRange, mnSubTotalFlags );
+ ScValueIterator aValIter( mrContext, aRange, mnSubTotalFlags );
if (aValIter.GetFirst( fCellVal, nErr))
{
if (bIgnoreErrVal)
@@ -4304,7 +4304,7 @@ void ScInterpreter::ScAveDev()
FormulaError nErr = FormulaError::NONE;
double nCellVal;
PopDoubleRef( aRange, nParam, nRefInList);
- ScValueIterator aValIter( mrContext, mrDoc, aRange, mnSubTotalFlags );
+ ScValueIterator aValIter( mrContext, aRange, mnSubTotalFlags );
if (aValIter.GetFirst(nCellVal, nErr))
{
rVal += nCellVal;
@@ -4383,7 +4383,7 @@ void ScInterpreter::ScAveDev()
FormulaError nErr = FormulaError::NONE;
double nCellVal;
PopDoubleRef( aRange, nParam, nRefInList);
- ScValueIterator aValIter( mrContext, mrDoc, aRange, mnSubTotalFlags );
+ ScValueIterator aValIter( mrContext, aRange, mnSubTotalFlags );
if (aValIter.GetFirst(nCellVal, nErr))
{
rVal += std::abs(nCellVal - nMiddle);
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index 6f3b29912f6c..cdb07fa9ca22 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -158,7 +158,7 @@ void ScInterpreter::ScGCD()
FormulaError nErr = FormulaError::NONE;
PopDoubleRef( aRange, nParamCount, nRefInList);
double nCellVal;
- ScValueIterator aValIter( mrContext, mrDoc, aRange, mnSubTotalFlags );
+ ScValueIterator aValIter( mrContext, aRange, mnSubTotalFlags );
if (aValIter.GetFirst(nCellVal, nErr))
{
do
@@ -235,7 +235,7 @@ void ScInterpreter:: ScLCM()
FormulaError nErr = FormulaError::NONE;
PopDoubleRef( aRange, nParamCount, nRefInList);
double nCellVal;
- ScValueIterator aValIter( mrContext, mrDoc, aRange, mnSubTotalFlags );
+ ScValueIterator aValIter( mrContext, aRange, mnSubTotalFlags );
if (aValIter.GetFirst(nCellVal, nErr))
{
do
diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx
index 13f19895e00a..8c6cfb449bd3 100644
--- a/sc/source/core/tool/interpr6.cxx
+++ b/sc/source/core/tool/interpr6.cxx
@@ -783,7 +783,7 @@ void ScInterpreter::IterateParameters( ScIterFunc eFunc, bool bTextAsZero )
}
else
{
- ScValueIterator aValIter( mrContext, mrDoc, aRange, mnSubTotalFlags, bTextAsZero );
+ ScValueIterator aValIter( mrContext, aRange, mnSubTotalFlags, bTextAsZero );
FormulaError nErr = FormulaError::NONE;
if (aValIter.GetFirst(fVal, nErr))
{