diff options
author | Eike Rathke <erack@redhat.com> | 2014-12-02 14:22:23 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-12-02 15:37:06 +0100 |
commit | 7e12f98fc05c6828ca0823cbaf45670073778c8a (patch) | |
tree | 677f87b7764b5f12fbb7932c8b0904ad25808b17 /sc/source/core/data | |
parent | 4c254a6d2532460351180c071fabf44129e8885d (diff) |
fdo#86762 broadcast also empty cells after sort
Change-Id: Ie275a754c530d6039ed14304900dd71416f36e46
(cherry picked from commit 08793e08c7e9cefe594c49130f782725e386c463)
Diffstat (limited to 'sc/source/core/data')
-rw-r--r-- | sc/source/core/data/column.cxx | 19 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/table2.cxx | 4 |
3 files changed, 21 insertions, 6 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index d9532307409e..5185c3aa450f 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -3055,7 +3055,7 @@ void ScColumn::SetDirtyFromClip( SCROW nRow1, SCROW nRow2, sc::ColumnSpanSet& rB aHdl.fillBroadcastSpans(rBroadcastSpans); } -void ScColumn::SetDirty( SCROW nRow1, SCROW nRow2, bool bBroadcast ) +void ScColumn::SetDirty( SCROW nRow1, SCROW nRow2, bool bBroadcast, bool bIncludeEmptyCells ) { // broadcasts everything within the range, with FormulaTracking sc::AutoCalcSwitch aSwitch(*pDocument, false); @@ -3063,7 +3063,22 @@ void ScColumn::SetDirty( SCROW nRow1, SCROW nRow2, bool bBroadcast ) SetDirtyOnRangeHandler aHdl(*this); sc::ProcessFormula(maCells.begin(), maCells, nRow1, nRow2, aHdl, aHdl); if (bBroadcast) - aHdl.broadcast(); + { + if (bIncludeEmptyCells) + { + // Broadcast the changes. + ScHint aHint( SC_HINT_DATACHANGED, ScAddress( nCol, 0, nTab)); + for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow) + { + aHint.GetAddress().SetRow(nRow); + pDocument->Broadcast(aHint); + } + } + else + { + aHdl.broadcast(); + } + } } void ScColumn::SetTableOpDirty( const ScRange& rRange ) diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 660b39469133..820870bf4242 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3618,7 +3618,7 @@ void ScDocument::SetAllFormulasDirty( const sc::SetFormulaDirtyContext& rCxt ) SetAutoCalc( bOldAutoCalc ); } -void ScDocument::SetDirty( const ScRange& rRange ) +void ScDocument::SetDirty( const ScRange& rRange, bool bIncludeEmptyCells ) { bool bOldAutoCalc = GetAutoCalc(); bAutoCalc = false; // keine Mehrfachberechnung @@ -3626,7 +3626,7 @@ void ScDocument::SetDirty( const ScRange& rRange ) ScBulkBroadcast aBulkBroadcast( GetBASM()); 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 ); + if (maTabs[i]) maTabs[i]->SetDirty( rRange, bIncludeEmptyCells ); } SetAutoCalc( bOldAutoCalc ); } diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 608ec13014a4..fad5443badce 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -1684,13 +1684,13 @@ void ScTable::SetAllFormulasDirty( const sc::SetFormulaDirtyContext& rCxt ) aCol[i].SetAllFormulasDirty(rCxt); } -void ScTable::SetDirty( const ScRange& rRange ) +void ScTable::SetDirty( const ScRange& rRange, bool bIncludeEmptyCells ) { bool bOldAutoCalc = pDocument->GetAutoCalc(); pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden SCCOL nCol2 = rRange.aEnd.Col(); for (SCCOL i=rRange.aStart.Col(); i<=nCol2; i++) - aCol[i].SetDirty(rRange.aStart.Row(), rRange.aEnd.Row()); + aCol[i].SetDirty(rRange.aStart.Row(), rRange.aEnd.Row(), true, bIncludeEmptyCells); pDocument->SetAutoCalc( bOldAutoCalc ); } |