diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-05-03 16:39:10 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-05-09 13:34:32 -0400 |
commit | 24c5c1185d5908b47605782f44a9e3c5fe1814ac (patch) | |
tree | ae026d7f29de4d3025a82751b3dd23b85adb5a38 /sc | |
parent | 3c5cc7d56f6185ea0bf7593a0cd8e73232d97ddb (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')
-rw-r--r-- | sc/inc/brdcst.hxx | 1 | ||||
-rw-r--r-- | sc/source/core/data/column.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/column3.cxx | 13 | ||||
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/chartlis.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/lookupcache.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/servobj.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/chart2uno.cxx | 2 |
9 files changed, 13 insertions, 15 deletions
diff --git a/sc/inc/brdcst.hxx b/sc/inc/brdcst.hxx index 737e7e89544e..069f032d474a 100644 --- a/sc/inc/brdcst.hxx +++ b/sc/inc/brdcst.hxx @@ -27,7 +27,6 @@ class SvtBroadcaster; -#define SC_HINT_DYING SFX_HINT_DYING #define SC_HINT_DATACHANGED SFX_HINT_DATACHANGED #define SC_HINT_TABLEOPDIRTY SFX_HINT_USER00 #define SC_HINT_CALCALL SFX_HINT_USER01 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; diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx index e0eb9db0897b..c5fbfe8dcbb5 100644 --- a/sc/source/ui/docshell/servobj.cxx +++ b/sc/source/ui/docshell/servobj.cxx @@ -228,7 +228,7 @@ void ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) // must be from Area broadcasters const ScHint* pScHint = PTR_CAST( ScHint, &rHint ); - if( pScHint && (pScHint->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING)) ) + if (pScHint && (pScHint->GetId() & SC_HINT_DATACHANGED)) bDataChanged = sal_True; else if (rHint.ISA(ScAreaChangedHint)) // position of broadcaster changed { diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index d0155229f68b..40c602f77838 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -2830,7 +2830,7 @@ void SAL_CALL ScCellRangesBase::firePropertiesChangeEvent( const uno::Sequence< IMPL_LINK( ScCellRangesBase, ValueListenerHdl, SfxHint*, pHint ) { if ( pDocShell && pHint && pHint->ISA( SfxSimpleHint ) && - ((const SfxSimpleHint*)pHint)->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING) ) + (((const SfxSimpleHint*)pHint)->GetId() & SC_HINT_DATACHANGED)) { // This may be called several times for a single change, if several formulas // in the range are notified. So only a flag is set that is checked when diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 6ce49d24408a..69b95aa4ca5d 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -2937,7 +2937,7 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint IMPL_LINK( ScChart2DataSequence, ValueListenerHdl, SfxHint*, pHint ) { if ( m_pDocument && pHint && pHint->ISA( SfxSimpleHint ) && - ((const SfxSimpleHint*)pHint)->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING) ) + ((const SfxSimpleHint*)pHint)->GetId() & SC_HINT_DATACHANGED) { // This may be called several times for a single change, if several formulas // in the range are notified. So only a flag is set that is checked when |