summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-05-03 16:39:10 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-05-09 13:34:32 -0400
commit24c5c1185d5908b47605782f44a9e3c5fe1814ac (patch)
treeae026d7f29de4d3025a82751b3dd23b85adb5a38 /sc/source/core
parent3c5cc7d56f6185ea0bf7593a0cd8e73232d97ddb (diff)
Remove SC_HINT_DYING. We don't do anything specific for this hint.
Use SC_HINT_DATACHANGED instead, and do broadcast *after* the cell is removed from the cell array, to avoid the dying cell from being used during recalculation after the broadcast. Change-Id: I8eb31eafa50c737ab683ca697657e64e52ae52e7
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/data/column.cxx2
-rw-r--r--sc/source/core/data/column3.cxx13
-rw-r--r--sc/source/core/data/formulacell.cxx2
-rw-r--r--sc/source/core/tool/chartlis.cxx2
-rw-r--r--sc/source/core/tool/lookupcache.cxx2
5 files changed, 10 insertions, 11 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 4e061abc8a2f..e20521a29edc 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1731,7 +1731,7 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol)
}
// Broadcast changes
ScAddress aAdr( nCol, 0, nTab );
- ScHint aHint( SC_HINT_DYING, aAdr, NULL ); // areas only
+ ScHint aHint(SC_HINT_DATACHANGED, aAdr, NULL); // areas only
ScAddress& rAddress = aHint.GetAddress();
// must iterate backwards, because indexes of following cells become invalid
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index dd2205135936..8983fa130f91 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -105,9 +105,6 @@ void ScColumn::Delete( SCROW nRow )
return;
ScBaseCell* pCell = maItems[nIndex].pCell;
- pDocument->Broadcast(
- ScHint(SC_HINT_DYING, ScAddress(nCol, nRow, nTab), GetBroadcaster(nRow)));
-
maItems.erase(maItems.begin() + nIndex);
maTextWidths.set_empty(nRow, nRow);
maScriptTypes.set_empty(nRow, nRow);
@@ -116,6 +113,9 @@ void ScColumn::Delete( SCROW nRow )
static_cast<ScFormulaCell*>(pCell)->EndListeningTo(pDocument);
pCell->Delete();
+ pDocument->Broadcast(
+ ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab), GetBroadcaster(nRow)));
+
CellStorageModified();
}
@@ -124,13 +124,14 @@ void ScColumn::DeleteAtIndex( SCSIZE nIndex )
{
ScBaseCell* pCell = maItems[nIndex].pCell;
SCROW nRow = maItems[nIndex].nRow;
- pDocument->Broadcast(
- ScHint(SC_HINT_DYING, ScAddress(nCol, nRow, nTab), GetBroadcaster(nRow)));
maItems.erase(maItems.begin() + nIndex);
if (pCell->GetCellType() == CELLTYPE_FORMULA)
static_cast<ScFormulaCell*>(pCell)->EndListeningTo(pDocument);
pCell->Delete();
+ pDocument->Broadcast(
+ ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab), GetBroadcaster(nRow)));
+
maTextWidths.set_empty(nRow, nRow);
maScriptTypes.set_empty(nRow, nRow);
CellStorageModified();
@@ -304,8 +305,6 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDe
"paste cells" operation, which removes the caption objects later in
drawing undo. */
- ScHint aHint( SC_HINT_DYING, ScAddress( nCol, 0, nTab ), 0 );
-
// cache all formula cells, they will be deleted at end of this function
typedef ::std::vector< ScFormulaCell* > FormulaCellVector;
FormulaCellVector aDelCells;
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index aa3659868006..cb13563ebf03 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1512,7 +1512,7 @@ void ScFormulaCell::Notify( SvtBroadcaster&, const SfxHint& rHint)
{
const ScHint* p = PTR_CAST( ScHint, &rHint );
sal_uLong nHint = (p ? p->GetId() : 0);
- if (nHint & (SC_HINT_DATACHANGED | SC_HINT_DYING | SC_HINT_TABLEOPDIRTY))
+ if (nHint & (SC_HINT_DATACHANGED | SC_HINT_TABLEOPDIRTY))
{
bool bForceTrack = false;
if ( nHint & SC_HINT_TABLEOPDIRTY )
diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx
index 0b0f7a1197ee..ed0796073726 100644
--- a/sc/source/core/tool/chartlis.cxx
+++ b/sc/source/core/tool/chartlis.cxx
@@ -213,7 +213,7 @@ uno::Reference< chart::XChartData > ScChartListener::GetUnoSource() const
void ScChartListener::Notify( SvtBroadcaster&, const SfxHint& rHint )
{
const ScHint* p = dynamic_cast<const ScHint*>(&rHint);
- if (p && (p->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING)))
+ if (p && (p->GetId() & SC_HINT_DATACHANGED))
SetUpdateQueue();
}
diff --git a/sc/source/core/tool/lookupcache.cxx b/sc/source/core/tool/lookupcache.cxx
index 8e93647b3620..235bb04ed4c5 100644
--- a/sc/source/core/tool/lookupcache.cxx
+++ b/sc/source/core/tool/lookupcache.cxx
@@ -115,7 +115,7 @@ void ScLookupCache::Notify( SvtBroadcaster & /* rBC */ , const SfxHint & rHint
if (!mpDoc->IsInDtorClear())
{
const ScHint* p = PTR_CAST( ScHint, &rHint );
- if (p && (p->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING)))
+ if (p && (p->GetId() & SC_HINT_DATACHANGED))
{
mpDoc->RemoveLookupCache( *this);
delete this;