diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2018-12-07 17:42:07 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-12-14 16:25:25 +0100 |
commit | 169a1b542165f3444791fd6e672d56d3fe48bd66 (patch) | |
tree | 1b1614e38aa962c9798d655769defea0832f5804 /sc/inc/scopetools.hxx | |
parent | a3fb726f4972c5a869e778353c8c1c19f149c5ea (diff) |
avoid possible expensive repetitive formula group changes (tdf#102364)
The testcase from tdf#102364 is actually a rather pathological case,
the document having a full 1M cells column with the same formula, and doing
undo in this case essentially pastes the column over itself (I think
a column is first deleted, which moves this column, and then ScUndoInsertCells
will trigger ScMoveUndo::UndoRef(), which will paste the column in that place
again. And since this is done cell by cell, removing old cell first splits
the large formula group and then adding a new cell with the same formula
rejoins the formula group, and setting these formula group changes for all
the cells over and over actually takes a long time.
Avoid that by delaying the formula grouping operation and do it just once
at the end. I'm not sure if this is that good way of handling this, given
the testcase is very specific, but I can imagine something similar happening
in other possible cases (manual copy&paste of a large column over itself
or moving it slightly up or down).
Change-Id: Ie4241197103a039c232150333250f78175b1c2c7
Reviewed-on: https://gerrit.libreoffice.org/64782
Tested-by: Jenkins
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/inc/scopetools.hxx')
-rw-r--r-- | sc/inc/scopetools.hxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sc/inc/scopetools.hxx b/sc/inc/scopetools.hxx index f49c077dd588..7789d9645b8a 100644 --- a/sc/inc/scopetools.hxx +++ b/sc/inc/scopetools.hxx @@ -65,6 +65,17 @@ public: ~WaitPointerSwitch(); }; +/// Wrapper for ScDocument::DelayFormulaGrouping() +class SC_DLLPUBLIC DelayFormulaGroupingSwitch +{ + ScDocument& mrDoc; + bool const mbOldValue; +public: + DelayFormulaGroupingSwitch(ScDocument& rDoc, bool delay); + ~DelayFormulaGroupingSwitch(); + void reset(); +}; + } #endif |