From 8b690f22c9deb6d1171328dfe5607d4c673dc993 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 22 Sep 2017 11:13:39 +0200 Subject: vcl: [loplugin:badstatics] xCharClass There's even 2 of these; move them to struct ImplSVData which is deleted on shutdown. Change-Id: I8040cd6f9f31c0a1ab48987a490395f316d52220 Reviewed-on: https://gerrit.libreoffice.org/42630 Tested-by: Jenkins Reviewed-by: Michael Stahl --- vcl/source/control/field2.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'vcl/source/control/field2.cxx') diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 3712fc004d24..87885679dead 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -58,11 +58,15 @@ using namespace ::comphelper; uno::Reference< i18n::XCharacterClassification > const & ImplGetCharClass() { - static uno::Reference< i18n::XCharacterClassification > xCharClass; - if ( !xCharClass.is() ) - xCharClass = vcl::unohelper::CreateCharacterClassification(); + ImplSVData *const pSVData = ImplGetSVData(); + assert(pSVData); - return xCharClass; + if (!pSVData->m_xCharClass.is()) + { + pSVData->m_xCharClass = vcl::unohelper::CreateCharacterClassification(); + } + + return pSVData->m_xCharClass; } static sal_Unicode* ImplAddString( sal_Unicode* pBuf, const OUString& rStr ) -- cgit