diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-12 15:01:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-12 17:49:02 +0100 |
commit | 40b0bd21e87480b659e7ed92854eee385a2a3c55 (patch) | |
tree | e71ba92b77eead12445c68c866d7ba71f74e19f5 /sc/source/core/data/column.cxx | |
parent | 4781ba436f72b5b763833c3c036e7f1c0e4d9e3b (diff) |
sc: rowcol: tdf#50916 pass ScDocument to the token classes
needed to create a fake ScDocument for the external ref manager, since
it has no ScDocument at all
Change-Id: Ia786ac291133e3c438694e81ecfb2590729a853d
Reviewed-on: https://gerrit.libreoffice.org/85050
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/core/data/column.cxx')
-rw-r--r-- | sc/source/core/data/column.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index d1b10c128344..63080b5dfb7f 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -113,7 +113,7 @@ sc::MatrixEdge ScColumn::GetBlockMatrixEdges( SCROW nRow1, SCROW nRow2, sc::Matr { using namespace sc; - if (!ValidRow(nRow1) || !ValidRow(nRow2) || nRow1 > nRow2) + if (!GetDoc()->ValidRow(nRow1) || !GetDoc()->ValidRow(nRow2) || nRow1 > nRow2) return MatrixEdge::Nothing; ScAddress aOrigin(ScAddress::INITIALIZE_INVALID); @@ -1280,7 +1280,7 @@ class CopyAsLinkHandler aRef.InitAddress(ScAddress(mrSrcCol.GetCol(), nRow, mrSrcCol.GetTab())); // Absolute reference. aRef.SetFlag3D(true); - ScTokenArray aArr; + ScTokenArray aArr(mrDestCol.GetDoc()); aArr.AddSingleReference(aRef); return new ScFormulaCell(mrDestCol.GetDoc(), ScAddress(mrDestCol.GetCol(), nRow, mrDestCol.GetTab()), aArr); } @@ -1986,7 +1986,7 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol) // Split the formula grouping at the top and bottom boundaries. sc::CellStoreType::position_type aPos = maCells.position(nStartRow); sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr); - if (ValidRow(nEndRow+1)) + if (GetDoc()->ValidRow(nEndRow+1)) { aPos = maCells.position(aPos.first, nEndRow+1); sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr); @@ -1995,7 +1995,7 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol) // Do the same with the destination column. aPos = rCol.maCells.position(nStartRow); sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr); - if (ValidRow(nEndRow+1)) + if (GetDoc()->ValidRow(nEndRow+1)) { aPos = rCol.maCells.position(aPos.first, nEndRow+1); sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr); @@ -2013,7 +2013,7 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol) // Re-group transferred formula cells. aPos = rCol.maCells.position(nStartRow); sc::SharedFormulaUtil::joinFormulaCellAbove(aPos); - if (ValidRow(nEndRow+1)) + if (GetDoc()->ValidRow(nEndRow+1)) { aPos = rCol.maCells.position(aPos.first, nEndRow+1); sc::SharedFormulaUtil::joinFormulaCellAbove(aPos); @@ -2474,15 +2474,15 @@ bool ScColumn::UpdateReference( sc::RefUpdateContext& rCxt, ScDocument* pUndoDoc if (rCxt.mnRowDelta < 0) { nSplitPos = rCxt.maRange.aStart.Row() + rCxt.mnRowDelta; - if (ValidRow(nSplitPos)) + if (GetDoc()->ValidRow(nSplitPos)) aBounds.push_back(nSplitPos); } nSplitPos = rCxt.maRange.aStart.Row(); - if (ValidRow(nSplitPos)) + if (GetDoc()->ValidRow(nSplitPos)) { aBounds.push_back(nSplitPos); nSplitPos = rCxt.maRange.aEnd.Row() + 1; - if (ValidRow(nSplitPos)) + if (GetDoc()->ValidRow(nSplitPos)) aBounds.push_back(nSplitPos); } } @@ -3190,7 +3190,7 @@ void ScColumn::SetDirtyVar() bool ScColumn::IsFormulaDirty( SCROW nRow ) const { - if (!ValidRow(nRow)) + if (!GetDoc()->ValidRow(nRow)) return false; std::pair<sc::CellStoreType::const_iterator,size_t> aPos = maCells.position(nRow); |