summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-11-01 18:36:42 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-11-04 13:59:18 -0500
commit488b1ea1b9e780930802f5e4eead37552d1c3f6c (patch)
treeb8526458c3def6ea4b7af4d2f1f571741ff680a4
parenta364a87f73fc2730a987992a8d4242bc12f788d0 (diff)
Fix multiple operations with formula cell with indirect dependency.
Now the unit test passes. Good. Change-Id: I23fa8355805c192f43db0199f3628f2bf457a645
-rw-r--r--sc/inc/column.hxx2
-rw-r--r--sc/qa/unit/ucalc_formula.cxx3
-rw-r--r--sc/source/core/data/column.cxx14
-rw-r--r--sc/source/core/data/column3.cxx8
4 files changed, 13 insertions, 14 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 0a03ad997c3c..c08236b220d0 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -492,7 +492,7 @@ public:
bool HasBroadcaster() const;
void Broadcast( SCROW nRow );
- void BroadcastCells( const std::vector<SCROW>& rRows );
+ void BroadcastCells( const std::vector<SCROW>& rRows, sal_uLong nHint );
// cell notes
ScPostIt* GetCellNote( SCROW nRow );
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 3cb9ab90b7f2..9f824e5785dd 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -1387,11 +1387,10 @@ void Test::testMultipleOperations()
aParam.aRefFormulaCell.Set(2,0,0,false,false,false);
aParam.aRefFormulaEnd = aParam.aRefFormulaCell;
m_pDoc->InsertTableOp(aParam, 0, 2, 1, 4, aMark);
-#if 0 // TODO: Make this pass.
CPPUNIT_ASSERT_EQUAL(30.0, m_pDoc->GetValue(1,2,0));
CPPUNIT_ASSERT_EQUAL(40.0, m_pDoc->GetValue(1,3,0));
CPPUNIT_ASSERT_EQUAL(50.0, m_pDoc->GetValue(1,4,0));
-#endif
+
m_pDoc->DeleteTab(0);
}
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 018f9e11361e..512ccc54e175 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -890,7 +890,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2)
SwapCellTextAttrs(nRow1, nRow2);
SwapCellNotes(nRow1, nRow2);
CellStorageModified();
- BroadcastCells(aRows);
+ BroadcastCells(aRows, SC_HINT_DATACHANGED);
return;
}
@@ -938,7 +938,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2)
SwapCellTextAttrs(nRow1, nRow2);
SwapCellNotes(nRow1, nRow2);
CellStorageModified();
- BroadcastCells(aRows);
+ BroadcastCells(aRows, SC_HINT_DATACHANGED);
return;
}
@@ -983,7 +983,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2)
SwapCellTextAttrs(nRow1, nRow2);
SwapCellNotes(nRow1, nRow2);
CellStorageModified();
- BroadcastCells(aRows);
+ BroadcastCells(aRows, SC_HINT_DATACHANGED);
return;
}
@@ -1117,7 +1117,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2)
SwapCellTextAttrs(nRow1, nRow2);
SwapCellNotes(nRow1, nRow2);
CellStorageModified();
- BroadcastCells(aRows);
+ BroadcastCells(aRows, SC_HINT_DATACHANGED);
}
namespace {
@@ -2760,7 +2760,7 @@ public:
{
std::vector<SCROW> aRows;
maValueRanges.getRows(aRows);
- mrColumn.BroadcastCells(aRows);
+ mrColumn.BroadcastCells(aRows, SC_HINT_DATACHANGED);
}
};
@@ -2792,7 +2792,7 @@ public:
{
std::vector<SCROW> aRows;
maValueRanges.getRows(aRows);
- mrColumn.BroadcastCells(aRows);
+ mrColumn.BroadcastCells(aRows, SC_HINT_TABLEOPDIRTY);
}
};
@@ -3173,7 +3173,7 @@ void ScColumn::BroadcastRecalcOnRefMove()
sc::AutoCalcSwitch aSwitch(*pDocument, false);
RecalcOnRefMoveCollector aFunc;
sc::ProcessFormula(maCells, aFunc);
- BroadcastCells(aFunc.getDirtyRows());
+ BroadcastCells(aFunc.getDirtyRows(), SC_HINT_DATACHANGED);
}
void ScColumn::CalcAll()
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index ece9035d094e..61f5326e6d45 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -74,13 +74,13 @@ void ScColumn::Broadcast( SCROW nRow )
pDocument->Broadcast(aHint);
}
-void ScColumn::BroadcastCells( const std::vector<SCROW>& rRows )
+void ScColumn::BroadcastCells( const std::vector<SCROW>& rRows, sal_uLong nHint )
{
if (rRows.empty())
return;
// Broadcast the changes.
- ScHint aHint(SC_HINT_DATACHANGED, ScAddress(nCol, 0, nTab));
+ ScHint aHint(nHint, ScAddress(nCol, 0, nTab));
std::vector<SCROW>::const_iterator itRow = rRows.begin(), itRowEnd = rRows.end();
for (; itRow != itRowEnd; ++itRow)
{
@@ -285,7 +285,7 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize )
sc::SharedFormulaUtil::joinFormulaCellAbove(aPos);
// Single cell broadcasts on deleted cells.
- BroadcastCells(aDeleteRowsFunc.getNonEmptyRows());
+ BroadcastCells(aDeleteRowsFunc.getNonEmptyRows(), SC_HINT_DATACHANGED);
// Shift the text attribute array too (before the broadcast).
maCellTextAttrs.erase(nStartRow, nEndRow);
@@ -628,7 +628,7 @@ void ScColumn::DeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag)
// Broadcast on only cells that were deleted; no point broadcasting on
// cells that were already empty before the deletion.
- BroadcastCells(aDeletedRows);
+ BroadcastCells(aDeletedRows, SC_HINT_DATACHANGED);
}
bool ScColumn::InitBlockPosition( sc::ColumnBlockPosition& rBlockPos )