summaryrefslogtreecommitdiff
path: root/i18npool/inc
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-03-12 14:50:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-03-12 21:16:48 +0100
commit0a790ba991daa9c84f836fd18290f621ea372460 (patch)
tree91199daadf19c8ae3e3392a5bb2d3169abbb1255 /i18npool/inc
parent2291cbaeeb87fae2f2d6d75782e06f9296ba9c77 (diff)
tdf#147905 calc PROPER function doesn't like mulithreading
regression from commit dac29c278531d5474289eb54aa03987c4958ac83 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu Sep 16 11:03:04 2021 +0200 if you hit Transliteration_casemapping hard enough, like in this test case, the state changes become a problem, so remove that by having multiple copies. Change-Id: I1d795af4370d6f79468387997202ba11c6a9d7b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131441 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool/inc')
-rw-r--r--i18npool/inc/cclass_unicode.hxx6
-rw-r--r--i18npool/inc/transliteration_body.hxx11
2 files changed, 15 insertions, 2 deletions
diff --git a/i18npool/inc/cclass_unicode.hxx b/i18npool/inc/cclass_unicode.hxx
index 3cfa1475a063..a10fe84eb8d9 100644
--- a/i18npool/inc/cclass_unicode.hxx
+++ b/i18npool/inc/cclass_unicode.hxx
@@ -94,7 +94,11 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
private:
- rtl::Reference<Transliteration_casemapping> trans;
+ // These are performance sensitive, so we don't want to use locking and switch their state, so just
+ // have multiple copies.
+ rtl::Reference<Transliteration_casemapping> transToUpper;
+ rtl::Reference<Transliteration_casemapping> transToLower;
+ rtl::Reference<Transliteration_casemapping> transToTitle;
// --- parser specific (implemented in cclass_unicode_parser.cxx) ---
diff --git a/i18npool/inc/transliteration_body.hxx b/i18npool/inc/transliteration_body.hxx
index a53aa77d15d2..6c3418fd7994 100644
--- a/i18npool/inc/transliteration_body.hxx
+++ b/i18npool/inc/transliteration_body.hxx
@@ -70,7 +70,16 @@ class Transliteration_casemapping final : public Transliteration_body
{
public:
Transliteration_casemapping();
- void setMappingType(const MappingType rMappingType, const css::lang::Locale& rLocale );
+ void setMappingType( const MappingType rMappingType )
+ {
+ if (nMappingType != rMappingType)
+ nMappingType = rMappingType;
+ }
+ void setLocale( const css::lang::Locale& rLocale )
+ {
+ if (aLocale != rLocale)
+ aLocale = rLocale;
+ }
};
class Transliteration_togglecase final : public Transliteration_body