sc/source/core/data/column.cxx   |    2 ++
 sc/source/core/data/document.cxx |    7 ++++++-
 sc/source/core/data/table2.cxx   |    1 +
 3 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit e55723c0ba4172bf6ee80fda49b069fd441a0c90
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Sun Dec 5 19:31:43 2021 +0100
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Mon Dec 6 15:45:18 2021 +0100

    try to broadcast in bulk (tdf#119083)
    
    This somewhat improves the situation, but still a lot of time is spent
    repeatedly making the same cells dirty.
    
    Change-Id: I3444ca6dac4b3a40c6ac40a0b70cf5baeefa2f09
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126391
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 482ce0b2a1a8..f3f5688e85e8 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -43,6 +43,7 @@
 #include <formulagroup.hxx>
 #include <drwlayer.hxx>
 #include <mtvelements.hxx>
+#include <bcaslot.hxx>
 
 #include <svl/numformat.hxx>
 #include <svl/poolcach.hxx>
@@ -3372,6 +3373,7 @@ void ScColumn::SetDirtyIfPostponed()
 {
     sc::AutoCalcSwitch aSwitch(GetDoc(), false);
     SetDirtyIfPostponedHandler aFunc;
+    ScBulkBroadcast aBulkBroadcast( GetDoc().GetBASM(), 
SfxHintId::ScDataChanged);
     sc::ProcessFormula(maCells, aFunc);
 }
 
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 681d77e45c7c..9d2770522018 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1552,7 +1552,10 @@ bool ScDocument::InsertCol( SCROW nStartRow, SCTAB 
nStartTab,
             // At least all cells using range names pointing relative to the
             // moved range must be recalculated, and all cells marked postponed
             // dirty.
-            std::for_each(maTabs.begin(), maTabs.end(), 
SetDirtyIfPostponedHandler());
+            {
+                ScBulkBroadcast aBulkBroadcast(GetBASM(), 
SfxHintId::ScDataChanged);
+                std::for_each(maTabs.begin(), maTabs.end(), 
SetDirtyIfPostponedHandler());
+            }
             // Cells containing functions such as CELL, COLUMN or ROW may have
             // changed their values on relocation. Broadcast them.
             {
@@ -1590,6 +1593,7 @@ void ScDocument::DeleteCol(SCROW nStartRow, SCTAB 
nStartTab, SCROW nEndRow, SCTA
     }
 
     sc::AutoCalcSwitch aACSwitch(*this, false); // avoid multiple calculations
+    ScBulkBroadcast aBulkBroadcast(GetBASM(), SfxHintId::ScDataChanged);
 
     // handle chunks of consecutive selected sheets together
     SCTAB nTabRangeStart = nStartTab;
@@ -2098,6 +2102,7 @@ void ScDocument::CopyToDocument(const ScRange& rRange,
         rDestDoc.aDocName = aDocName;
 
     sc::AutoCalcSwitch aACSwitch(rDestDoc, false); // avoid multiple 
calculations
+    ScBulkBroadcast aBulkBroadcast(rDestDoc.GetBASM(), 
SfxHintId::ScDataChanged);
 
     sc::CopyToDocContext aCxt(rDestDoc);
     aCxt.setStartListening(false);
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index a72414c0e40b..fa322f333821 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -2057,6 +2057,7 @@ void ScTable::SetDirtyAfterLoad()
 void ScTable::SetDirtyIfPostponed()
 {
     sc::AutoCalcSwitch aSwitch(rDocument, false);
+    ScBulkBroadcast aBulkBroadcast( rDocument.GetBASM(), 
SfxHintId::ScDataChanged);
     for (SCCOL i=0; i < aCol.size(); i++)
         aCol[i].SetDirtyIfPostponed();
 }

Reply via email to