diff options
Diffstat (limited to 'sc/source/core/tool')
-rw-r--r-- | sc/source/core/tool/chartarr.cxx | 32 | ||||
-rw-r--r-- | sc/source/core/tool/chartpos.cxx | 26 | ||||
-rw-r--r-- | sc/source/core/tool/chgtrack.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/detfunc.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/tool/reftokenhelper.cxx | 8 |
5 files changed, 36 insertions, 36 deletions
diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx index 5a3d21c69c33..7b4637bc5b6e 100644 --- a/sc/source/core/tool/chartarr.cxx +++ b/sc/source/core/tool/chartarr.cxx @@ -55,9 +55,9 @@ ScMemChart::~ScMemChart() } ScChartArray::ScChartArray( - ScDocument* pDoc, const ScRangeListRef& rRangeList ) : - pDocument( pDoc ), - aPositioner(pDoc, rRangeList) {} + ScDocument& rDoc, const ScRangeListRef& rRangeList ) : + rDocument( rDoc ), + aPositioner(rDoc, rRangeList) {} std::unique_ptr<ScMemChart> ScChartArray::CreateMemChart() { @@ -135,12 +135,12 @@ std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartSingle() // Skip hidden columns. // TODO: make use of last column value once implemented. SCCOL nLastCol = -1; - while (pDocument->ColHidden(nCol1, nTab1, nullptr, &nLastCol)) + while (rDocument.ColHidden(nCol1, nTab1, nullptr, &nLastCol)) ++nCol1; // Skip hidden rows. SCROW nLastRow = -1; - if (pDocument->RowHidden(nRow1, nTab1, nullptr, &nLastRow)) + if (rDocument.RowHidden(nRow1, nTab1, nullptr, &nLastRow)) nRow1 = nLastRow + 1; // if everything is hidden then the label remains at the beginning @@ -161,7 +161,7 @@ std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartSingle() for (SCSIZE i=0; i<nTotalCols; i++) { SCCOL nThisCol = sal::static_int_cast<SCCOL>(nCol1+i); - if (!pDocument->ColHidden(nThisCol, nTab1, nullptr, &nLastCol)) + if (!rDocument.ColHidden(nThisCol, nTab1, nullptr, &nLastCol)) aCols.push_back(nThisCol); } SCSIZE nColCount = aCols.size(); @@ -175,7 +175,7 @@ std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartSingle() SCROW nThisRow = nRow1; while (nThisRow <= nRow2) { - if (pDocument->RowHidden(nThisRow, nTab1, nullptr, &nLastRow)) + if (rDocument.RowHidden(nThisRow, nTab1, nullptr, &nLastRow)) nThisRow = nLastRow; else aRows.push_back(nThisRow); @@ -210,14 +210,14 @@ std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartSingle() if ( bValidData ) { - bool bCalcAsShown = pDocument->GetDocOptions().IsCalcAsShown(); + bool bCalcAsShown = rDocument.GetDocOptions().IsCalcAsShown(); for (nCol=0; nCol<nColCount; nCol++) { for (nRow=0; nRow<nRowCount; nRow++) { // DBL_MIN is a Hack for Chart to recognize empty cells. ScAddress aPos(aCols[nCol], aRows[nRow], nTab1); - double nVal = getCellValue(*pDocument, aPos, DBL_MIN, bCalcAsShown); + double nVal = getCellValue(rDocument, aPos, DBL_MIN, bCalcAsShown); pMemChart->SetData(nCol, nRow, nVal); } } @@ -236,7 +236,7 @@ std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartSingle() { OUString aString; if (HasColHeaders()) - aString = pDocument->GetString(aCols[nCol], nStrRow, nTab1); + aString = rDocument.GetString(aCols[nCol], nStrRow, nTab1); if (aString.isEmpty()) { OUStringBuffer aBuf; @@ -258,7 +258,7 @@ std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartSingle() OUString aString; if (HasRowHeaders()) { - aString = pDocument->GetString(nStrCol, aRows[nRow], nTab1); + aString = rDocument.GetString(nStrCol, aRows[nRow], nTab1); } if (aString.isEmpty()) { @@ -303,7 +303,7 @@ std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartMulti() SCSIZE nCol = 0; SCSIZE nRow = 0; - bool bCalcAsShown = pDocument->GetDocOptions().IsCalcAsShown(); + bool bCalcAsShown = rDocument.GetDocOptions().IsCalcAsShown(); sal_uLong nIndex = 0; if (bValidData) { @@ -315,7 +315,7 @@ std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartMulti() const ScAddress* pPos = GetPositionMap()->GetPosition( nIndex ); if (pPos) // otherwise: Gap - nVal = getCellValue(*pDocument, *pPos, DBL_MIN, bCalcAsShown); + nVal = getCellValue(rDocument, *pPos, DBL_MIN, bCalcAsShown); pMemChart->SetData(nCol, nRow, nVal); } @@ -329,7 +329,7 @@ std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartMulti() const ScAddress* pPos = GetPositionMap()->GetPosition( nIndex ); if (pPos) // otherwise: Gap - nVal = getCellValue(*pDocument, *pPos, DBL_MIN, bCalcAsShown); + nVal = getCellValue(rDocument, *pPos, DBL_MIN, bCalcAsShown); pMemChart->SetData(nCol, nRow, nVal); } @@ -345,7 +345,7 @@ std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartMulti() OUString aString; const ScAddress* pPos = GetPositionMap()->GetColHeaderPosition( static_cast<SCCOL>(nCol) ); if ( HasColHeaders() && pPos ) - aString = pDocument->GetString(pPos->Col(), pPos->Row(), pPos->Tab()); + aString = rDocument.GetString(pPos->Col(), pPos->Row(), pPos->Tab()); if (aString.isEmpty()) { @@ -370,7 +370,7 @@ std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartMulti() OUString aString; const ScAddress* pPos = GetPositionMap()->GetRowHeaderPosition( nRow ); if ( HasRowHeaders() && pPos ) - aString = pDocument->GetString(pPos->Col(), pPos->Row(), pPos->Tab()); + aString = rDocument.GetString(pPos->Col(), pPos->Row(), pPos->Tab()); if (aString.isEmpty()) { diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx index 89326661f319..1d2cdc53f018 100644 --- a/sc/source/core/tool/chartpos.cxx +++ b/sc/source/core/tool/chartpos.cxx @@ -26,14 +26,14 @@ namespace { - bool lcl_hasValueDataButNoDates( const ScDocument* pDocument, SCCOL nCol, SCROW nRow, SCTAB nTab ) + bool lcl_hasValueDataButNoDates( const ScDocument& rDocument, SCCOL nCol, SCROW nRow, SCTAB nTab ) { bool bReturn = false; - if (pDocument->HasValueData( nCol, nRow, nTab )) + if (rDocument.HasValueData( nCol, nRow, nTab )) { //treat dates like text #i25706# - sal_uInt32 nNumberFormat = pDocument->GetNumberFormat( ScAddress( nCol, nRow, nTab ) ); - SvNumFormatType nType = pDocument->GetFormatTable()->GetType(nNumberFormat); + sal_uInt32 nNumberFormat = rDocument.GetNumberFormat( ScAddress( nCol, nRow, nTab ) ); + SvNumFormatType nType = rDocument.GetFormatTable()->GetType(nNumberFormat); bool bIsDate(nType & SvNumFormatType::DATE); bReturn = !bIsDate; } @@ -41,9 +41,9 @@ namespace } } -ScChartPositioner::ScChartPositioner( ScDocument* pDoc, SCTAB nTab, +ScChartPositioner::ScChartPositioner( ScDocument& rDoc, SCTAB nTab, SCCOL nStartColP, SCROW nStartRowP, SCCOL nEndColP, SCROW nEndRowP) : - pDocument( pDoc ), + rDocument( rDoc ), eGlue( ScChartGlue::NA ), nStartCol(0), nStartRow(0), @@ -55,9 +55,9 @@ ScChartPositioner::ScChartPositioner( ScDocument* pDoc, SCTAB nTab, CheckColRowHeaders(); } -ScChartPositioner::ScChartPositioner( ScDocument* pDoc, const ScRangeListRef& rRangeList ) : +ScChartPositioner::ScChartPositioner( ScDocument& rDoc, const ScRangeListRef& rRangeList ) : aRangeListRef( rRangeList ), - pDocument( pDoc ), + rDocument( rDoc ), eGlue( ScChartGlue::NA ), nStartCol(0), nStartRow(0), @@ -71,7 +71,7 @@ ScChartPositioner::ScChartPositioner( ScDocument* pDoc, const ScRangeListRef& rR ScChartPositioner::ScChartPositioner( const ScChartPositioner& rPositioner ) : aRangeListRef( rPositioner.aRangeListRef ), - pDocument(rPositioner.pDocument), + rDocument(rPositioner.rDocument), eGlue(rPositioner.eGlue), nStartCol(rPositioner.nStartCol), nStartRow(rPositioner.nStartRow), @@ -285,12 +285,12 @@ void ScChartPositioner::CheckColRowHeaders() { for (iCol=nCol1; iCol<=nCol2 && bColStrings; iCol++) { - if (lcl_hasValueDataButNoDates( pDocument, iCol, nRow1, nTab1 )) + if (lcl_hasValueDataButNoDates( rDocument, iCol, nRow1, nTab1 )) bColStrings = false; } for (iRow=nRow1; iRow<=nRow2 && bRowStrings; iRow++) { - if (lcl_hasValueDataButNoDates( pDocument, nCol1, iRow, nTab1 )) + if (lcl_hasValueDataButNoDates( rDocument, nCol1, iRow, nTab1 )) bRowStrings = false; } } @@ -312,7 +312,7 @@ void ScChartPositioner::CheckColRowHeaders() if ( nCol1 <= nCol2 ) for (iRow=nRow1; iRow<=nRow2 && bRowStrings; iRow++) { - if (lcl_hasValueDataButNoDates( pDocument, nCol1, iRow, nTab1 )) + if (lcl_hasValueDataButNoDates( rDocument, nCol1, iRow, nTab1 )) bRowStrings = false; } } @@ -321,7 +321,7 @@ void ScChartPositioner::CheckColRowHeaders() if ( nRow1 <= nRow2 ) for (iCol=nCol1; iCol<=nCol2 && bColStrings; iCol++) { - if (lcl_hasValueDataButNoDates( pDocument, iCol, nRow1, nTab1 )) + if (lcl_hasValueDataButNoDates( rDocument, iCol, nRow1, nTab1 )) bColStrings = false; } } diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index 06ad5357a0d9..bd40a24b3eb5 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -2917,7 +2917,7 @@ void ScChangeTrack::Dependencies( ScChangeAction* pAct ) if ( ScChangeActionContent::GetContentCellType(rCell) == SC_CACCT_MATREF ) { ScAddress aOrg; - bool bOrgFound = rCell.mpFormula->GetMatrixOrigin(&rDoc, aOrg); + bool bOrgFound = rCell.mpFormula->GetMatrixOrigin(rDoc, aOrg); ScChangeActionContent* pContent = (bOrgFound ? SearchContentAt( aOrg, pAct ) : nullptr); if ( pContent && pContent->IsMatrixOrigin() ) { diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx index 7393144f764c..d4c1ab66ec2e 100644 --- a/sc/source/core/tool/detfunc.cxx +++ b/sc/source/core/tool/detfunc.cxx @@ -1386,7 +1386,7 @@ void ScDetectiveFunc::GetAllSuccs(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n { vector<ScTokenRef> aSrcRange; aSrcRange.push_back( - ScRefTokenHelper::createRefToken(&rDoc, ScRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab))); + ScRefTokenHelper::createRefToken(rDoc, ScRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab))); ScCellIterator aIter(rDoc, ScRange(0, 0, nTab, rDoc.MaxCol(), rDoc.MaxRow(), nTab)); for (bool bHas = aIter.first(); bHas; bHas = aIter.next()) @@ -1403,7 +1403,7 @@ void ScDetectiveFunc::GetAllSuccs(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n if (ScRefTokenHelper::intersects(&rDoc, aSrcRange, pRef, aPos)) { // This address is absolute. - pRef = ScRefTokenHelper::createRefToken(&rDoc, aPos); + pRef = ScRefTokenHelper::createRefToken(rDoc, aPos); ScRefTokenHelper::join(&rDoc, rRefTokens, pRef, ScAddress()); } } diff --git a/sc/source/core/tool/reftokenhelper.cxx b/sc/source/core/tool/reftokenhelper.cxx index 74319f5a77d0..58d9353222dc 100644 --- a/sc/source/core/tool/reftokenhelper.cxx +++ b/sc/source/core/tool/reftokenhelper.cxx @@ -447,19 +447,19 @@ bool ScRefTokenHelper::getDoubleRefDataFromToken(ScComplexRefData& rData, const return true; } -ScTokenRef ScRefTokenHelper::createRefToken(const ScDocument* pDoc, const ScAddress& rAddr) +ScTokenRef ScRefTokenHelper::createRefToken(const ScDocument& rDoc, const ScAddress& rAddr) { ScSingleRefData aRefData; aRefData.InitAddress(rAddr); - ScTokenRef pRef(new ScSingleRefToken(pDoc->GetSheetLimits(), aRefData)); + ScTokenRef pRef(new ScSingleRefToken(rDoc.GetSheetLimits(), aRefData)); return pRef; } -ScTokenRef ScRefTokenHelper::createRefToken(const ScDocument* pDoc, const ScRange& rRange) +ScTokenRef ScRefTokenHelper::createRefToken(const ScDocument& rDoc, const ScRange& rRange) { ScComplexRefData aRefData; aRefData.InitRange(rRange); - ScTokenRef pRef(new ScDoubleRefToken(pDoc->GetSheetLimits(), aRefData)); + ScTokenRef pRef(new ScDoubleRefToken(rDoc.GetSheetLimits(), aRefData)); return pRef; } |