summaryrefslogtreecommitdiff
path: root/sc/source/core/data/column.cxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-06-04 18:39:54 +0200
committerLuboš Luňák <l.lunak@collabora.com>2020-06-09 09:49:19 +0200
commita97539174fd7f76713291dd4e8138adb1f776c91 (patch)
tree77c60c0297f42b8ce25c8be50a7094eb5db56ca2 /sc/source/core/data/column.cxx
parent49df367a5da14b31729e2f4f5dd6bf4e249df8d3 (diff)
delay and batch calls to StartListeningFormulaCells() (tdf#133302)
In the testcase ScColumn::StartListeningUnshared() gets called repeatedly with almost the same cells range (just extending), so this gets quadratic. Delaying and doing it once on the whole range at the end avoids this. Change-Id: I3e92817d434cf7e4be0ea658f9adc0a24ceda260 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95531 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/source/core/data/column.cxx')
-rw-r--r--sc/source/core/data/column.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index a223352b8dd3..61011da9aeae 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1661,6 +1661,7 @@ public:
sc::formula_block::const_iterator itEnd = it;
std::advance(itEnd, nDataSize);
+ sc::DelayStartListeningFormulaCells startDelay(mrDestCol); // disabled
if(nDataSize > 1024 && (mnCopyFlags & InsertDeleteFlags::FORMULA) != InsertDeleteFlags::NONE)
{
// If the column to be replaced contains a long formula group (tdf#102364), there can
@@ -1668,6 +1669,9 @@ public:
// the first element becomes very high. Optimize this by removing them in one go.
sc::EndListeningContext context(*mrDestCol.GetDoc());
mrDestCol.EndListeningFormulaCells( context, nRow, nRow + nDataSize - 1, nullptr, nullptr );
+ // There can be a similar problem with starting to listen to cells repeatedly (tdf#133302).
+ // Delay it.
+ startDelay.set();
}
for (; it != itEnd; ++it, ++nRow)