diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-12-12 16:42:42 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-12-12 18:17:26 +0100 |
commit | 3e59716375a240576fd6d8759b32b4319506ed70 (patch) | |
tree | 38e7b751a4dbbc662aa64b06f8caed13c5e3ec3a /sc/inc/scopetools.hxx | |
parent | 40b0bd21e87480b659e7ed92854eee385a2a3c55 (diff) |
Prevent BroadcastRecalcOnRefMoveHandler copies
...which would contain copies of AutoCalcSwitch and ScBulkBroadcast that both do
things in their dtors. std::sort (into which BroadcastRecalcOnRefMoveHandler is
passed as function object argument) returns its function object argument, which
caused the BroadcastRecalcOnRefMoveHandler copies.
Better split the RAII part that holds AutoCalcSwitch and ScBulkBroadcast and
does things in their dtors into a BroadcastRecalcOnRefMoveGuard class of its
own. (And while at it, explicitly delete the copy/move functions of
AutoCalcSwitch and ScBulkBroadcast to avoid such issues in the future.)
(The RAII part of BroadcastRecalcOnRefMoveHandler had been added with
60d0b992ea3a910be79ae4a8e8b0bb32a358b18a "sc-perf: tdf#87101 add bulk scope for
BroadcastRecalcOnRefMove() calls". The issue was found with Clang 10 trunk
-Wdeprecated-copy-dtor.)
Change-Id: I45d6b81e7c8b34aed57b6f66c5e1e966a43a565d
Reviewed-on: https://gerrit.libreoffice.org/85063
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc/inc/scopetools.hxx')
-rw-r--r-- | sc/inc/scopetools.hxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/inc/scopetools.hxx b/sc/inc/scopetools.hxx index 571b1fce52f5..b71154330e96 100644 --- a/sc/inc/scopetools.hxx +++ b/sc/inc/scopetools.hxx @@ -24,6 +24,12 @@ class SC_DLLPUBLIC AutoCalcSwitch { ScDocument& mrDoc; bool const mbOldValue; + + AutoCalcSwitch(AutoCalcSwitch const &) = delete; + AutoCalcSwitch(AutoCalcSwitch &&) = delete; + AutoCalcSwitch & operator =(AutoCalcSwitch const &) = delete; + AutoCalcSwitch & operator =(AutoCalcSwitch &&) = delete; + public: AutoCalcSwitch(ScDocument& rDoc, bool bAutoCalc); ~AutoCalcSwitch(); |