summaryrefslogtreecommitdiff
path: root/sc/source/core/data
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data')
-rw-r--r--sc/source/core/data/colorscale.cxx15
-rw-r--r--sc/source/core/data/column.cxx12
-rw-r--r--sc/source/core/data/documen2.cxx4
-rw-r--r--sc/source/core/data/document.cxx10
-rw-r--r--sc/source/core/data/refupdatecontext.cxx4
-rw-r--r--sc/source/core/data/table2.cxx2
6 files changed, 24 insertions, 23 deletions
diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx
index 6169e52c4c3a..a1f440c7b9c7 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -244,13 +244,14 @@ void ScColorScaleEntry::UpdateMoveTab( SCTAB nOldTab, SCTAB nNewTab, SCTAB nTabN
}
}
-void ScColorScaleEntry::UpdateReference( UpdateRefMode eUpdateRefMode,
- const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
+void ScColorScaleEntry::UpdateReference(
+ ScDocument* pDoc, UpdateRefMode eUpdateRefMode, const ScRange& rRange,
+ SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
{
if (!mpCell)
return;
- sc::RefUpdateContext aCxt;
+ sc::RefUpdateContext aCxt(*pDoc);
aCxt.meMode = eUpdateRefMode;
aCxt.maRange = rRange;
aCxt.mnColDelta = nDx;
@@ -586,7 +587,7 @@ void ScColorScaleFormat::UpdateReference( UpdateRefMode eUpdateRefMode,
{
for(iterator itr = begin(); itr != end(); ++itr)
{
- itr->UpdateReference(eUpdateRefMode, rRange, nDx, nDy, nDz);
+ itr->UpdateReference(mpDoc, eUpdateRefMode, rRange, nDx, nDy, nDz);
}
}
@@ -699,8 +700,8 @@ condformat::ScFormatEntryType ScDataBarFormat::GetType() const
void ScDataBarFormat::UpdateReference( UpdateRefMode eRefMode,
const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
{
- mpFormatData->mpUpperLimit->UpdateReference( eRefMode, rRange, nDx, nDy, nDz );
- mpFormatData->mpLowerLimit->UpdateReference( eRefMode, rRange, nDx, nDy, nDz );
+ mpFormatData->mpUpperLimit->UpdateReference( mpDoc, eRefMode, rRange, nDx, nDy, nDz );
+ mpFormatData->mpLowerLimit->UpdateReference( mpDoc, eRefMode, rRange, nDx, nDy, nDz );
}
bool ScDataBarFormat::NeedsRepaint() const
@@ -1012,7 +1013,7 @@ void ScIconSetFormat::UpdateReference( UpdateRefMode eUpdateRefMode,
{
for(iterator itr = begin(); itr != end(); ++itr)
{
- itr->UpdateReference( eUpdateRefMode, rRange, nDx, nDy, nDz );
+ itr->UpdateReference( mpDoc, eUpdateRefMode, rRange, nDx, nDy, nDz );
}
}
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index ac1ede1cf5eb..23a740f9ccc4 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1119,10 +1119,10 @@ namespace {
/**
* Adjust references in formula cell with respect to column-wise relocation.
*/
-void updateRefInFormulaCell( ScFormulaCell& rCell, SCCOL nCol, SCTAB nTab, SCCOL nColDiff )
+void updateRefInFormulaCell( ScDocument* pDoc, ScFormulaCell& rCell, SCCOL nCol, SCTAB nTab, SCCOL nColDiff )
{
rCell.aPos.SetCol(nCol);
- sc::RefUpdateContext aCxt;
+ sc::RefUpdateContext aCxt(*pDoc);
aCxt.meMode = URM_MOVE;
aCxt.maRange = ScRange(ScAddress(nCol, 0, nTab), ScAddress(nCol, MAXROW, nTab));
aCxt.mnColDelta = nColDiff;
@@ -1139,14 +1139,14 @@ void ScColumn::SwapCell( SCROW nRow, ScColumn& rCol)
if (aPos1.first->type == sc::element_type_formula)
{
ScFormulaCell& rCell = *sc::formula_block::at(*aPos1.first->data, aPos1.second);
- updateRefInFormulaCell(rCell, rCol.nCol, nTab, rCol.nCol - nCol);
+ updateRefInFormulaCell(pDocument, rCell, rCol.nCol, nTab, rCol.nCol - nCol);
sc::SharedFormulaUtil::unshareFormulaCell(aPos1, rCell);
}
if (aPos2.first->type == sc::element_type_formula)
{
ScFormulaCell& rCell = *sc::formula_block::at(*aPos2.first->data, aPos2.second);
- updateRefInFormulaCell(rCell, nCol, nTab, nCol - rCol.nCol);
+ updateRefInFormulaCell(pDocument, rCell, nCol, nTab, nCol - rCol.nCol);
sc::SharedFormulaUtil::unshareFormulaCell(aPos2, rCell);
}
@@ -2036,7 +2036,7 @@ void ScColumn::CopyScenarioFrom( const ScColumn& rSrcCol )
// UpdateUsed not needed, already done in TestCopyScenario (obsolete comment ?)
- sc::RefUpdateContext aRefCxt;
+ sc::RefUpdateContext aRefCxt(*pDocument);
aRefCxt.meMode = URM_COPY;
aRefCxt.maRange = ScRange(nCol, nStart, nTab, nCol, nEnd, nTab);
aRefCxt.mnTabDelta = nTab - rSrcCol.nTab;
@@ -2067,7 +2067,7 @@ void ScColumn::CopyScenarioTo( ScColumn& rDestCol ) const
// UpdateUsed not needed, is already done in TestCopyScenario (obsolete comment ?)
- sc::RefUpdateContext aRefCxt;
+ sc::RefUpdateContext aRefCxt(*pDocument);
aRefCxt.meMode = URM_COPY;
aRefCxt.maRange = ScRange(rDestCol.nCol, nStart, rDestCol.nTab, rDestCol.nCol, nEnd, rDestCol.nTab);
aRefCxt.mnTabDelta = rDestCol.nTab - nTab;
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index dade7bee21b6..d5ddbd40400f 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -849,7 +849,7 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM
maTabs[nNewPos]->SetTabBgColor(maTabs[nOldPos]->GetTabBgColor());
SCTAB nDz = nNewPos - nOldPos;
- sc::RefUpdateContext aRefCxt;
+ sc::RefUpdateContext aRefCxt(*this);
aRefCxt.meMode = URM_COPY;
aRefCxt.maRange = ScRange(0, 0, nNewPos, MAXCOL, MAXROW, nNewPos);
aRefCxt.mnTabDelta = nDz;
@@ -968,7 +968,7 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
if ( !bResultsOnly )
{
- sc::RefUpdateContext aRefCxt;
+ sc::RefUpdateContext aRefCxt(*this);
aRefCxt.meMode = URM_COPY;
aRefCxt.maRange = ScRange(0, 0, nDestPos, MAXCOL, MAXROW, nDestPos);
aRefCxt.mnTabDelta = nDestPos - nSrcPos;
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index aa2377579ce2..dfc17cf90766 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1164,7 +1164,7 @@ bool ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab,
lcl_GetFirstTabRange( nTabRangeStart, nTabRangeEnd, pTabMark, static_cast<SCTAB>(maTabs.size()) );
- sc::RefUpdateContext aCxt;
+ sc::RefUpdateContext aCxt(*this);
aCxt.meMode = URM_INSDEL;
aCxt.maRange = ScRange(nStartCol, nStartRow, nTabRangeStart, nEndCol, MAXROW, nTabRangeEnd);
aCxt.mnRowDelta = nSize;
@@ -1267,7 +1267,7 @@ void ScDocument::DeleteRow( SCCOL nStartCol, SCTAB nStartTab,
if ( ValidRow(nStartRow+nSize) )
{
lcl_GetFirstTabRange( nTabRangeStart, nTabRangeEnd, pTabMark, static_cast<SCTAB>(maTabs.size()) );
- sc::RefUpdateContext aCxt;
+ sc::RefUpdateContext aCxt(*this);
aCxt.meMode = URM_INSDEL;
aCxt.maRange = ScRange(nStartCol, nStartRow+nSize, nTabRangeStart, nEndCol, MAXROW, nTabRangeEnd);
aCxt.mnRowDelta = -(static_cast<SCROW>(nSize));
@@ -1373,7 +1373,7 @@ bool ScDocument::InsertCol( SCROW nStartRow, SCTAB nStartTab,
lcl_GetFirstTabRange( nTabRangeStart, nTabRangeEnd, pTabMark, static_cast<SCTAB>(maTabs.size()) );
- sc::RefUpdateContext aCxt;
+ sc::RefUpdateContext aCxt(*this);
aCxt.meMode = URM_INSDEL;
aCxt.maRange = ScRange(nStartCol, nStartRow, nTabRangeStart, MAXCOL, nEndRow, nTabRangeEnd);
aCxt.mnColDelta = nSize;
@@ -1466,7 +1466,7 @@ void ScDocument::DeleteCol(SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTA
if ( ValidCol(sal::static_int_cast<SCCOL>(nStartCol+nSize)) )
{
lcl_GetFirstTabRange( nTabRangeStart, nTabRangeEnd, pTabMark, static_cast<SCTAB>(maTabs.size()) );
- sc::RefUpdateContext aCxt;
+ sc::RefUpdateContext aCxt(*this);
aCxt.meMode = URM_INSDEL;
aCxt.maRange = ScRange(sal::static_int_cast<SCCOL>(nStartCol+nSize), nStartRow, nTabRangeStart, MAXCOL, nEndRow, nTabRangeEnd);
aCxt.mnColDelta = -(static_cast<SCCOL>(nSize));
@@ -2446,7 +2446,7 @@ void ScDocument::CopyBlockFromClip(
&& rClipTabs[(nClipTab + nFollow + 1) % static_cast<SCTAB>(rClipTabs.size())] )
++nFollow;
- sc::RefUpdateContext aRefCxt;
+ sc::RefUpdateContext aRefCxt(*this);
aRefCxt.maRange = ScRange(nCol1, nRow1, i, nCol2, nRow2, i+nFollow);
aRefCxt.mnColDelta = nDx;
aRefCxt.mnRowDelta = nDy;
diff --git a/sc/source/core/data/refupdatecontext.cxx b/sc/source/core/data/refupdatecontext.cxx
index 1ba6a6b92c5c..f1ad64c8c408 100644
--- a/sc/source/core/data/refupdatecontext.cxx
+++ b/sc/source/core/data/refupdatecontext.cxx
@@ -11,8 +11,8 @@
namespace sc {
-RefUpdateContext::RefUpdateContext() :
- meMode(URM_INSDEL), mnColDelta(0), mnRowDelta(0), mnTabDelta(0) {}
+RefUpdateContext::RefUpdateContext(ScDocument& rDoc) :
+ mrDoc(rDoc), meMode(URM_INSDEL), mnColDelta(0), mnRowDelta(0), mnTabDelta(0) {}
bool RefUpdateContext::isInserted() const
{
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index c8bb3ae35b48..f54912bce8d6 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -3512,7 +3512,7 @@ void ScTable::CopyData( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW n
if (aCell.meType == CELLTYPE_FORMULA)
{
- sc::RefUpdateContext aCxt;
+ sc::RefUpdateContext aCxt(*pDocument);
aCxt.meMode = URM_COPY;
aCxt.maRange = aRange;
aCxt.mnColDelta = nDestCol - nStartCol;