diff options
author | Tor Lillqvist <tml@collabora.com> | 2017-08-16 12:43:37 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2017-09-12 10:48:23 +0300 |
commit | 2652ce62f2ed4259e95578bc24af52fc48f197d5 (patch) | |
tree | 329ba2a1d7451f7c8d3647146e51b264bf78937e | |
parent | clang-tidy modernize-use-emplace in sc (diff) | |
download | core-2652ce62f2ed4259e95578bc24af52fc48f197d5.tar.gz core-2652ce62f2ed4259e95578bc24af52fc48f197d5.zip |
Make two slightly mysterious static local variables thread_local
IRC discussion about them:
tml_: erAck: any idea why in ScFormulaCell::GetMatrixEdge those nC and
nR are static?
tml_: seems to have been since initial import in 2000 (then in a
different file, and of type USHORT)
tml_: let's assume it is just random insanity
tml_: hmm, no, making them non-static actually breaks a unit test. wow
erAck: tml_: they are reused when the call is for the same matrix
origin as the last one to not have to recalculate the same thing
tml_: erAck: ah ok
Change-Id: Ib0fe322492917b5224937ec6ef527707ca2e07f7
Reviewed-on: https://gerrit.libreoffice.org/41658
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 82c5f970e911..22ef81ca2495 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -2658,8 +2658,8 @@ sc::MatrixEdge ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) const case ScMatrixMode::Formula : case ScMatrixMode::Reference : { - static SCCOL nC; - static SCROW nR; + static thread_local SCCOL nC; + static thread_local SCROW nR; ScAddress aOrg; if ( !GetMatrixOrigin( aOrg ) ) return sc::MatrixEdge::Nothing; |