diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/document.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/documen7.cxx | 37 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 5 |
3 files changed, 25 insertions, 19 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index c1355081aedb..52a252e75519 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1869,7 +1869,7 @@ public: */ void Broadcast( const ScHint& rHint ); - void BroadcastCells( const ScRange& rRange, sal_uLong nHint ); + void BroadcastCells( const ScRange& rRange, sal_uLong nHint, bool bBroadcastSingleBroadcasters = true ); void BroadcastRefMoved( const sc::RefMovedHint& rHint ); /// only area, no cell broadcast diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx index 5b6c3a430b3f..64fc158cb36f 100644 --- a/sc/source/core/data/documen7.cxx +++ b/sc/source/core/data/documen7.cxx @@ -96,7 +96,7 @@ void ScDocument::Broadcast( const ScHint& rHint ) } } -void ScDocument::BroadcastCells( const ScRange& rRange, sal_uLong nHint ) +void ScDocument::BroadcastCells( const ScRange& rRange, sal_uLong nHint, bool bBroadcastSingleBroadcasters ) { ClearFormulaContext(); @@ -118,26 +118,29 @@ void ScDocument::BroadcastCells( const ScRange& rRange, sal_uLong nHint ) ScBulkBroadcast aBulkBroadcast( pBASM); // scoped bulk broadcast bool bIsBroadcasted = false; - for (SCTAB nTab = nTab1; nTab <= nTab2; ++nTab) + if (bBroadcastSingleBroadcasters) { - ScTable* pTab = FetchTable(nTab); - if (!pTab) - continue; - - rPos.SetTab(nTab); - for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol) + for (SCTAB nTab = nTab1; nTab <= nTab2; ++nTab) { - rPos.SetCol(nCol); - /* TODO: to speed-up things a per column iterator to - * cell-broadcast in a range of rows would come handy. */ - for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow) + ScTable* pTab = FetchTable(nTab); + if (!pTab) + continue; + + rPos.SetTab(nTab); + for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol) { - SvtBroadcaster* pBC = pTab->GetBroadcaster( nCol, nRow); - if (pBC) + rPos.SetCol(nCol); + /* TODO: to speed-up things a per column iterator to + * cell-broadcast in a range of rows would come handy. */ + for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow) { - rPos.SetRow(nRow); - pBC->Broadcast(aHint); - bIsBroadcasted = true; + SvtBroadcaster* pBC = pTab->GetBroadcaster( nCol, nRow); + if (pBC) + { + rPos.SetRow(nRow); + pBC->Broadcast(aHint); + bIsBroadcasted = true; + } } } } diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index c48d5bcbd5e4..248cc9da9229 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3628,7 +3628,10 @@ void ScDocument::SetDirty( const ScRange& rRange, bool bIncludeEmptyCells ) SCTAB nTab2 = rRange.aEnd.Tab(); for (SCTAB i=rRange.aStart.Tab(); i<=nTab2 && i < static_cast<SCTAB>(maTabs.size()); i++) if (maTabs[i]) maTabs[i]->SetDirty( rRange, - (bIncludeEmptyCells ? ScColumn::BROADCAST_ALL_POSITIONS : ScColumn::BROADCAST_DATA_POSITIONS)); + (bIncludeEmptyCells ? ScColumn::BROADCAST_BROADCASTERS : ScColumn::BROADCAST_DATA_POSITIONS)); + + if (bIncludeEmptyCells) + BroadcastCells( rRange, SC_HINT_DATACHANGED, false); } SetAutoCalc( bOldAutoCalc ); } |