summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-21 11:47:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-22 07:33:56 +0100
commit2e6a38b7f007b36719f5fc002cb4363dec45e0d4 (patch)
tree7b9c691228821149d96d3859be07f50bc1e93515 /editeng
parentca037ca06e5b261a243af15aa57d2b8ee047806e (diff)
improve function-local statics in dbaccess..filter
Change-Id: I64939ad4b6c53696e33300114db384abfe73f13f Reviewed-on: https://gerrit.libreoffice.org/63702 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/misc/svxacorr.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index e05f20b21992..520003d139f4 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -239,13 +239,12 @@ static TransliterationWrapper& GetIgnoreTranslWrapper()
}
static CollatorWrapper& GetCollatorWrapper()
{
- static int bIsInit = 0;
- static CollatorWrapper aCollWrp( ::comphelper::getProcessComponentContext() );
- if( !bIsInit )
+ static CollatorWrapper aCollWrp = [&]()
{
- aCollWrp.loadDefaultCollator( GetAppLang().getLocale(), 0 );
- bIsInit = 1;
- }
+ CollatorWrapper tmp( ::comphelper::getProcessComponentContext() );
+ tmp.loadDefaultCollator( GetAppLang().getLocale(), 0 );
+ return tmp;
+ }();
return aCollWrp;
}