diff options
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/data/documen4.cxx | 22 | ||||
-rw-r--r-- | sc/source/core/data/documentimport.cxx | 22 | ||||
-rw-r--r-- | sc/source/core/data/markdata.cxx | 13 | ||||
-rw-r--r-- | sc/source/core/data/table1.cxx | 18 | ||||
-rw-r--r-- | sc/source/core/data/tabprotection.cxx | 10 | ||||
-rw-r--r-- | sc/source/core/tool/address.cxx | 30 | ||||
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/tool/rangeutl.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/tool/refdata.cxx | 12 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 6 |
11 files changed, 71 insertions, 74 deletions
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index f9934976ce9a..cec8bc9081f1 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -394,12 +394,12 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // multiple (repeate if (rParam.meMode == ScTabOpParam::Column) // column only { aRef.Set( rParam.aRefFormulaCell.GetAddress(), true, false, false ); - aForString.append(aRef.GetRefString(this, nTab1)); + aForString.append(aRef.GetRefString(*this, nTab1)); aForString.append(sSep); - aForString.append(rParam.aRefColCell.GetRefString(this, nTab1)); + aForString.append(rParam.aRefColCell.GetRefString(*this, nTab1)); aForString.append(sSep); aRef.Set( nCol1, nRow1, nTab1, false, true, true ); - aForString.append(aRef.GetRefString(this, nTab1)); + aForString.append(aRef.GetRefString(*this, nTab1)); nCol1++; nCol2 = std::min( nCol2, static_cast<SCCOL>(rParam.aRefFormulaEnd.Col() - rParam.aRefFormulaCell.Col() + nCol1 + 1)); @@ -407,29 +407,29 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // multiple (repeate else if (rParam.meMode == ScTabOpParam::Row) // row only { aRef.Set( rParam.aRefFormulaCell.GetAddress(), false, true, false ); - aForString.append(aRef.GetRefString(this, nTab1)); + aForString.append(aRef.GetRefString(*this, nTab1)); aForString.append(sSep); - aForString.append(rParam.aRefRowCell.GetRefString(this, nTab1)); + aForString.append(rParam.aRefRowCell.GetRefString(*this, nTab1)); aForString.append(sSep); aRef.Set( nCol1, nRow1, nTab1, true, false, true ); - aForString.append(aRef.GetRefString(this, nTab1)); + aForString.append(aRef.GetRefString(*this, nTab1)); nRow1++; nRow2 = std::min( nRow2, static_cast<SCROW>(rParam.aRefFormulaEnd.Row() - rParam.aRefFormulaCell.Row() + nRow1 + 1)); } else // both { - aForString.append(rParam.aRefFormulaCell.GetRefString(this, nTab1)); + aForString.append(rParam.aRefFormulaCell.GetRefString(*this, nTab1)); aForString.append(sSep); - aForString.append(rParam.aRefColCell.GetRefString(this, nTab1)); + aForString.append(rParam.aRefColCell.GetRefString(*this, nTab1)); aForString.append(sSep); aRef.Set( nCol1, nRow1 + 1, nTab1, false, true, true ); - aForString.append(aRef.GetRefString(this, nTab1)); + aForString.append(aRef.GetRefString(*this, nTab1)); aForString.append(sSep); - aForString.append(rParam.aRefRowCell.GetRefString(this, nTab1)); + aForString.append(rParam.aRefRowCell.GetRefString(*this, nTab1)); aForString.append(sSep); aRef.Set( nCol1 + 1, nRow1, nTab1, true, false, true ); - aForString.append(aRef.GetRefString(this, nTab1)); + aForString.append(aRef.GetRefString(*this, nTab1)); nCol1++; nRow1++; } aForString.append(ScCompiler::GetNativeSymbol( ocClose )); diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx index ed018a124711..f4cb0e24c0c0 100644 --- a/sc/source/core/data/documentimport.cxx +++ b/sc/source/core/data/documentimport.cxx @@ -472,12 +472,12 @@ void ScDocumentImport::setTableOpCells(const ScRange& rRange, const ScTabOpParam if (rParam.meMode == ScTabOpParam::Column) // column only { aRef.Set(rParam.aRefFormulaCell.GetAddress(), true, false, false); - aFormulaBuf.append(aRef.GetRefString(&rDoc, nTab)); + aFormulaBuf.append(aRef.GetRefString(rDoc, nTab)); aFormulaBuf.append(aSep); - aFormulaBuf.append(rParam.aRefColCell.GetRefString(&rDoc, nTab)); + aFormulaBuf.append(rParam.aRefColCell.GetRefString(rDoc, nTab)); aFormulaBuf.append(aSep); aRef.Set(nCol1, nRow1, nTab, false, true, true); - aFormulaBuf.append(aRef.GetRefString(&rDoc, nTab)); + aFormulaBuf.append(aRef.GetRefString(rDoc, nTab)); nCol1++; nCol2 = std::min( nCol2, static_cast<SCCOL>(rParam.aRefFormulaEnd.Col() - rParam.aRefFormulaCell.Col() + nCol1 + 1)); @@ -485,29 +485,29 @@ void ScDocumentImport::setTableOpCells(const ScRange& rRange, const ScTabOpParam else if (rParam.meMode == ScTabOpParam::Row) // row only { aRef.Set(rParam.aRefFormulaCell.GetAddress(), false, true, false); - aFormulaBuf.append(aRef.GetRefString(&rDoc, nTab)); + aFormulaBuf.append(aRef.GetRefString(rDoc, nTab)); aFormulaBuf.append(aSep); - aFormulaBuf.append(rParam.aRefRowCell.GetRefString(&rDoc, nTab)); + aFormulaBuf.append(rParam.aRefRowCell.GetRefString(rDoc, nTab)); aFormulaBuf.append(aSep); aRef.Set(nCol1, nRow1, nTab, true, false, true); - aFormulaBuf.append(aRef.GetRefString(&rDoc, nTab)); + aFormulaBuf.append(aRef.GetRefString(rDoc, nTab)); ++nRow1; nRow2 = std::min( nRow2, rParam.aRefFormulaEnd.Row() - rParam.aRefFormulaCell.Row() + nRow1 + 1); } else // both { - aFormulaBuf.append(rParam.aRefFormulaCell.GetRefString(&rDoc, nTab)); + aFormulaBuf.append(rParam.aRefFormulaCell.GetRefString(rDoc, nTab)); aFormulaBuf.append(aSep); - aFormulaBuf.append(rParam.aRefColCell.GetRefString(&rDoc, nTab)); + aFormulaBuf.append(rParam.aRefColCell.GetRefString(rDoc, nTab)); aFormulaBuf.append(aSep); aRef.Set(nCol1, nRow1 + 1, nTab, false, true, true); - aFormulaBuf.append(aRef.GetRefString(&rDoc, nTab)); + aFormulaBuf.append(aRef.GetRefString(rDoc, nTab)); aFormulaBuf.append(aSep); - aFormulaBuf.append(rParam.aRefRowCell.GetRefString(&rDoc, nTab)); + aFormulaBuf.append(rParam.aRefRowCell.GetRefString(rDoc, nTab)); aFormulaBuf.append(aSep); aRef.Set(nCol1 + 1, nRow1, nTab, true, false, true); - aFormulaBuf.append(aRef.GetRefString(&rDoc, nTab)); + aFormulaBuf.append(aRef.GetRefString(rDoc, nTab)); ++nCol1; ++nRow1; } diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx index 0740246bc220..f44a33c7f8bd 100644 --- a/sc/source/core/data/markdata.cxx +++ b/sc/source/core/data/markdata.cxx @@ -648,31 +648,30 @@ void ScMarkData::DeleteTab( SCTAB nTab ) maTabMarked.swap(tabMarked); } -void ScMarkData::ShiftCols(const ScDocument* pDoc, SCCOL nStartCol, long nColOffset) +void ScMarkData::ShiftCols(const ScDocument& rDoc, SCCOL nStartCol, long nColOffset) { if (bMarked) { - aMarkRange.IncColIfNotLessThan(pDoc, nStartCol, nColOffset); + aMarkRange.IncColIfNotLessThan(rDoc, nStartCol, nColOffset); } else if (bMultiMarked) { aMultiSel.ShiftCols(nStartCol, nColOffset); - aMultiRange.IncColIfNotLessThan(pDoc, nStartCol, nColOffset); + aMultiRange.IncColIfNotLessThan(rDoc, nStartCol, nColOffset); } } -void ScMarkData::ShiftRows(const ScDocument* pDoc, SCROW nStartRow, long nRowOffset) +void ScMarkData::ShiftRows(const ScDocument& rDoc, SCROW nStartRow, long nRowOffset) { if (bMarked) { - aMarkRange.IncRowIfNotLessThan(pDoc, nStartRow, nRowOffset); + aMarkRange.IncRowIfNotLessThan(rDoc, nStartRow, nRowOffset); } else if (bMultiMarked) { aMultiSel.ShiftRows(nStartRow, nRowOffset); - aMultiRange.IncRowIfNotLessThan(pDoc, nStartRow, nRowOffset); + aMultiRange.IncRowIfNotLessThan(rDoc, nStartRow, nRowOffset); } - } static void lcl_AddRanges(ScRange& rRangeDest, const ScRange& rNewRange ) diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index c0c07ef172d0..898ca28a5081 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1827,7 +1827,7 @@ void ScTable::UpdateReference( mpCondFormatList->UpdateReference(rCxt); if (pTabProtection) - pTabProtection->updateReference( eUpdateRefMode, &rDocument, rCxt.maRange, nDx, nDy, nDz); + pTabProtection->updateReference( eUpdateRefMode, rDocument, rCxt.maRange, nDx, nDy, nDz); } void ScTable::UpdateTranspose( const ScRange& rSource, const ScAddress& rDest, @@ -1862,7 +1862,7 @@ void ScTable::UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt ) mpCondFormatList->UpdateInsertTab(rCxt); if (pTabProtection) - pTabProtection->updateReference( URM_INSDEL, &rDocument, + pTabProtection->updateReference( URM_INSDEL, rDocument, ScRange( 0, 0, rCxt.mnInsertPos, rDocument.MaxCol(), rDocument.MaxRow(), MAXTAB), 0, 0, rCxt.mnSheets); @@ -1891,7 +1891,7 @@ void ScTable::UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt ) mpCondFormatList->UpdateDeleteTab(rCxt); if (pTabProtection) - pTabProtection->updateReference( URM_INSDEL, &rDocument, + pTabProtection->updateReference( URM_INSDEL, rDocument, ScRange( 0, 0, rCxt.mnDeletePos, rDocument.MaxCol(), rDocument.MaxRow(), MAXTAB), 0, 0, -rCxt.mnSheets); @@ -1915,7 +1915,7 @@ void ScTable::UpdateMoveTab( mpCondFormatList->UpdateMoveTab(rCxt); if (pTabProtection) - pTabProtection->updateReference( URM_REORDER, &rDocument, + pTabProtection->updateReference( URM_REORDER, rDocument, ScRange( 0, 0, rCxt.mnOldPos, rDocument.MaxCol(), rDocument.MaxRow(), MAXTAB), 0, 0, rCxt.mnNewPos - rCxt.mnOldPos); @@ -2012,7 +2012,7 @@ void ScTable::ExtendPrintArea( OutputDevice* pDev, for (SCCOL nDataCol = nCol; 0 <= nDataCol && nDataCol >= aColData.mnCol1; --nDataCol) { SCCOL nPrintCol = nDataCol; - VisibleDataCellIterator aIter(&rDocument, *mpHiddenRows, aCol[nDataCol]); + VisibleDataCellIterator aIter(rDocument, *mpHiddenRows, aCol[nDataCol]); ScRefCellValue aCell = aIter.reset(nStartRow); if (aCell.isEmpty()) // No visible cells found in this column. Skip it. @@ -2239,8 +2239,8 @@ void ScTable::RestorePrintRanges( const ScPrintSaverTab& rSaveTab ) UpdatePageBreaks(nullptr); } -ScTable::VisibleDataCellIterator::VisibleDataCellIterator(const ScDocument* pDoc, ScFlatBoolRowSegments& rRowSegs, ScColumn& rColumn) : - mpDocument(pDoc), +ScTable::VisibleDataCellIterator::VisibleDataCellIterator(const ScDocument& rDoc, ScFlatBoolRowSegments& rRowSegs, ScColumn& rColumn) : + mrDocument(rDoc), mrRowSegs(rRowSegs), mrColumn(rColumn), mnCurRow(ROW_NOT_FOUND), @@ -2254,7 +2254,7 @@ ScTable::VisibleDataCellIterator::~VisibleDataCellIterator() ScRefCellValue ScTable::VisibleDataCellIterator::reset(SCROW nRow) { - if (nRow > mpDocument->MaxRow()) + if (nRow > mrDocument.MaxRow()) { mnCurRow = ROW_NOT_FOUND; return ScRefCellValue(); @@ -2279,7 +2279,7 @@ ScRefCellValue ScTable::VisibleDataCellIterator::reset(SCROW nRow) // the next segment. mnCurRow = aData.mnRow2 + 1; mnUBound = mnCurRow; // get range data on the next iteration. - if (mnCurRow > mpDocument->MaxRow()) + if (mnCurRow > mrDocument.MaxRow()) { // Make sure the row doesn't exceed our current limit. mnCurRow = ROW_NOT_FOUND; diff --git a/sc/source/core/data/tabprotection.cxx b/sc/source/core/data/tabprotection.cxx index 3f0d0dae595c..6c3de2bde15b 100644 --- a/sc/source/core/data/tabprotection.cxx +++ b/sc/source/core/data/tabprotection.cxx @@ -139,7 +139,7 @@ public: void setEnhancedProtection( const ::std::vector< ScEnhancedProtection > & rProt ); const ::std::vector< ScEnhancedProtection > & getEnhancedProtection() const { return maEnhancedProtection;} - bool updateReference( UpdateRefMode, const ScDocument*, const ScRange& rWhere, SCCOL nDx, SCROW nDy, SCTAB nDz ); + bool updateReference( UpdateRefMode, const ScDocument&, const ScRange& rWhere, SCCOL nDx, SCROW nDy, SCTAB nDz ); bool isBlockEditable( const ScRange& rRange ) const; bool isSelectionEditable( const ScRangeList& rRangeList ) const; @@ -428,14 +428,14 @@ void ScTableProtectionImpl::setEnhancedProtection( const ::std::vector< ScEnhanc maEnhancedProtection = rProt; } -bool ScTableProtectionImpl::updateReference( UpdateRefMode eMode, const ScDocument* pDoc, +bool ScTableProtectionImpl::updateReference( UpdateRefMode eMode, const ScDocument& rDoc, const ScRange& rWhere, SCCOL nDx, SCROW nDy, SCTAB nDz ) { bool bChanged = false; for (auto& rEnhancedProtection : maEnhancedProtection) { if (rEnhancedProtection.maRangeList.is()) - bChanged |= rEnhancedProtection.maRangeList->UpdateReference( eMode, pDoc, rWhere, nDx, nDy, nDz); + bChanged |= rEnhancedProtection.maRangeList->UpdateReference( eMode, &rDoc, rWhere, nDx, nDy, nDz); } return bChanged; } @@ -705,10 +705,10 @@ const ::std::vector< ScEnhancedProtection > & ScTableProtection::getEnhancedProt return mpImpl->getEnhancedProtection(); } -bool ScTableProtection::updateReference( UpdateRefMode eMode, const ScDocument* pDoc, const ScRange& rWhere, +bool ScTableProtection::updateReference( UpdateRefMode eMode, const ScDocument& rDoc, const ScRange& rWhere, SCCOL nDx, SCROW nDy, SCTAB nDz ) { - return mpImpl->updateReference( eMode, pDoc, rWhere, nDx, nDy, nDz); + return mpImpl->updateReference( eMode, rDoc, rWhere, nDx, nDy, nDz); } bool ScTableProtection::isBlockEditable( const ScRange& rRange ) const diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 1fb89ad7af15..0a75ff057703 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -2404,43 +2404,43 @@ bool ScRange::MoveSticky( const ScDocument& rDoc, SCCOL dx, SCROW dy, SCTAB dz, return b1 && b2; } -void ScRange::IncColIfNotLessThan(const ScDocument* pDoc, SCCOL nStartCol, SCCOL nOffset) +void ScRange::IncColIfNotLessThan(const ScDocument& rDoc, SCCOL nStartCol, SCCOL nOffset) { if (aStart.Col() >= nStartCol) { aStart.IncCol(nOffset); if (aStart.Col() < 0) aStart.SetCol(0); - else if(aStart.Col() > (pDoc ? pDoc->MaxCol() : MAXCOL)) - aStart.SetCol(pDoc ? pDoc->MaxCol() : MAXCOL); + else if(aStart.Col() > rDoc.MaxCol()) + aStart.SetCol(rDoc.MaxCol()); } if (aEnd.Col() >= nStartCol) { aEnd.IncCol(nOffset); if (aEnd.Col() < 0) aEnd.SetCol(0); - else if(aEnd.Col() > (pDoc ? pDoc->MaxCol() : MAXCOL)) - aEnd.SetCol(pDoc ? pDoc->MaxCol() : MAXCOL); + else if(aEnd.Col() > rDoc.MaxCol()) + aEnd.SetCol(rDoc.MaxCol()); } } -void ScRange::IncRowIfNotLessThan(const ScDocument* pDoc, SCROW nStartRow, SCROW nOffset) +void ScRange::IncRowIfNotLessThan(const ScDocument& rDoc, SCROW nStartRow, SCROW nOffset) { if (aStart.Row() >= nStartRow) { aStart.IncRow(nOffset); if (aStart.Row() < 0) aStart.SetRow(0); - else if(aStart.Row() > pDoc->MaxRow()) - aStart.SetRow(pDoc->MaxRow()); + else if(aStart.Row() > rDoc.MaxRow()) + aStart.SetRow(rDoc.MaxRow()); } if (aEnd.Row() >= nStartRow) { aEnd.IncRow(nOffset); if (aEnd.Row() < 0) aEnd.SetRow(0); - else if(aEnd.Row() > pDoc->MaxRow()) - aEnd.SetRow(pDoc->MaxRow()); + else if(aEnd.Row() > rDoc.MaxRow()) + aEnd.SetRow(rDoc.MaxRow()); } } @@ -2508,12 +2508,10 @@ OUString ScAddress::GetColRowString() const return aString.makeStringAndClear(); } -OUString ScRefAddress::GetRefString( const ScDocument* pDoc, SCTAB nActTab, - const ScAddress::Details& rDetails ) const +OUString ScRefAddress::GetRefString( const ScDocument& rDoc, SCTAB nActTab, + const ScAddress::Details& rDetails ) const { - if ( !pDoc ) - return EMPTY_OUSTRING; - if ( Tab()+1 > pDoc->GetTableCount() ) + if ( Tab()+1 > rDoc.GetTableCount() ) return ScCompiler::GetNativeSymbol(ocErrRef); ScRefFlags nFlags = ScRefFlags::VALID; @@ -2528,7 +2526,7 @@ OUString ScRefAddress::GetRefString( const ScDocument* pDoc, SCTAB nActTab, if ( !bRelRow ) nFlags |= ScRefFlags::ROW_ABS; - return aAdr.Format(nFlags, pDoc, rDetails); + return aAdr.Format(nFlags, &rDoc, rDetails); } bool AlphaToCol(const ScDocument& rDoc, SCCOL& rCol, const OUString& rStr) diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 423582cea2a0..9ab2b6107cf5 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -4371,7 +4371,7 @@ bool ScCompiler::NextNewToken( bool bInArray ) // If a syntactically correct reference was recognized but invalid // e.g. because of non-existing sheet name => entire reference // ocBad to preserve input instead of #REF!.A1 - if (!maRawToken.IsValidReference(&rDoc)) + if (!maRawToken.IsValidReference(rDoc)) { aUpper = aOrg; // ensure for ocBad break; // do; create ocBad token or set error. diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 95670a9df55c..8d08d1ba9516 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1860,7 +1860,7 @@ void ScInterpreter::PushSingleRef( const ScRefAddress& rRef ) if (!IfErrorPushError()) { ScSingleRefData aRef; - aRef.InitFromRefAddress( &mrDoc, rRef, aPos); + aRef.InitFromRefAddress( mrDoc, rRef, aPos); PushTempTokenWithoutError( new ScSingleRefToken( mrDoc.GetSheetLimits(), aRef ) ); } } @@ -1870,7 +1870,7 @@ void ScInterpreter::PushDoubleRef( const ScRefAddress& rRef1, const ScRefAddress if (!IfErrorPushError()) { ScComplexRefData aRef; - aRef.InitFromRefAddresses( &mrDoc, rRef1, rRef2, aPos); + aRef.InitFromRefAddresses( mrDoc, rRef1, rRef2, aPos); PushTempTokenWithoutError( new ScDoubleRefToken( mrDoc.GetSheetLimits(), aRef ) ); } } diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx index d069c63280a8..1530fddcea19 100644 --- a/sc/source/core/tool/rangeutl.cxx +++ b/sc/source/core/tool/rangeutl.cxx @@ -192,9 +192,9 @@ bool ScRangeUtil::IsAbsArea( const OUString& rAreaStr, if ( pCompleteStr ) { - *pCompleteStr = startPos.GetRefString( &rDoc, MAXTAB+1, rDetails ); + *pCompleteStr = startPos.GetRefString( rDoc, MAXTAB+1, rDetails ); *pCompleteStr += ":"; - *pCompleteStr += endPos.GetRefString( &rDoc, nTab, rDetails ); + *pCompleteStr += endPos.GetRefString( rDoc, nTab, rDetails ); } if ( pStartPos && pEndPos ) @@ -226,7 +226,7 @@ bool ScRangeUtil::IsAbsPos( const OUString& rPosStr, if ( pPosTripel ) *pPosTripel = thePos; if ( pCompleteStr ) - *pCompleteStr = thePos.GetRefString( &rDoc, MAXTAB+1, rDetails ); + *pCompleteStr = thePos.GetRefString( rDoc, MAXTAB+1, rDetails ); } return bIsAbsPos; diff --git a/sc/source/core/tool/refdata.cxx b/sc/source/core/tool/refdata.cxx index 8f49acb3160b..4d07d5ca2e3f 100644 --- a/sc/source/core/tool/refdata.cxx +++ b/sc/source/core/tool/refdata.cxx @@ -37,23 +37,23 @@ void ScSingleRefData::InitAddress( SCCOL nColP, SCROW nRowP, SCTAB nTabP ) mnTab = nTabP; } -void ScSingleRefData::InitAddressRel( const ScDocument* pDoc, const ScAddress& rAdr, const ScAddress& rPos ) +void ScSingleRefData::InitAddressRel( const ScDocument& rDoc, const ScAddress& rAdr, const ScAddress& rPos ) { InitFlags(); SetColRel(true); SetRowRel(true); SetTabRel(true); - SetAddress(pDoc->GetSheetLimits(), rAdr, rPos); + SetAddress(rDoc.GetSheetLimits(), rAdr, rPos); } -void ScSingleRefData::InitFromRefAddress( const ScDocument* pDoc, const ScRefAddress& rRef, const ScAddress& rPos ) +void ScSingleRefData::InitFromRefAddress( const ScDocument& rDoc, const ScRefAddress& rRef, const ScAddress& rPos ) { InitFlags(); SetColRel( rRef.IsRelCol()); SetRowRel( rRef.IsRelRow()); SetTabRel( rRef.IsRelTab()); SetFlag3D( rRef.Tab() != rPos.Tab()); - SetAddress( pDoc->GetSheetLimits(), rRef.GetAddress(), rPos); + SetAddress( rDoc.GetSheetLimits(), rRef.GetAddress(), rPos); } void ScSingleRefData::SetAbsCol( SCCOL nVal ) @@ -377,7 +377,7 @@ void ScSingleRefData::Dump( int nIndent ) const } #endif -void ScComplexRefData::InitFromRefAddresses( const ScDocument* pDoc, const ScRefAddress& rRef1, const ScRefAddress& rRef2, const ScAddress& rPos ) +void ScComplexRefData::InitFromRefAddresses( const ScDocument& rDoc, const ScRefAddress& rRef1, const ScRefAddress& rRef2, const ScAddress& rPos ) { InitFlags(); Ref1.SetColRel( rRef1.IsRelCol()); @@ -388,7 +388,7 @@ void ScComplexRefData::InitFromRefAddresses( const ScDocument* pDoc, const ScRef Ref2.SetRowRel( rRef2.IsRelRow()); Ref2.SetTabRel( rRef2.IsRelTab()); Ref2.SetFlag3D( rRef1.Tab() != rRef2.Tab()); - SetRange( pDoc->GetSheetLimits(), ScRange( rRef1.GetAddress(), rRef2.GetAddress()), rPos); + SetRange( rDoc.GetSheetLimits(), ScRange( rRef1.GetAddress(), rRef2.GetAddress()), rPos); } ScComplexRefData& ScComplexRefData::Extend( ScSheetLimits& rLimits, const ScSingleRefData & rRef, const ScAddress & rPos ) diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 3466c6ba94d0..ea41da8d9552 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -334,14 +334,14 @@ void ScRawToken::SetExternal( const OUString& rStr ) maExternalName = rStr; } -bool ScRawToken::IsValidReference(const ScDocument* pDoc) const +bool ScRawToken::IsValidReference(const ScDocument& rDoc) const { switch (eType) { case svSingleRef: - return aRef.Ref1.Valid(pDoc); + return aRef.Ref1.Valid(&rDoc); case svDoubleRef: - return aRef.Valid(pDoc); + return aRef.Valid(&rDoc); case svExternalSingleRef: case svExternalDoubleRef: return true; |