diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-20 11:21:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-20 14:47:49 +0100 |
commit | 9f0a4ae5dec545fe5d90c10ed4ddc2395e617e8e (patch) | |
tree | f70c3f2a96cdec00081c4bf6886a4cc0fdf7ef60 /toolkit/source/controls | |
parent | 85123ef1ce3085b33884f688e99792468a118df3 (diff) |
clean up s_bTriedCreation static bool
very weird code, no need for hiding this bool inside a method
Change-Id: I75ee67af32ab012fe5ab5ae766abc56212bb08e6
Reviewed-on: https://gerrit.libreoffice.org/63643
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit/source/controls')
-rw-r--r-- | toolkit/source/controls/formattedcontrol.cxx | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/toolkit/source/controls/formattedcontrol.cxx b/toolkit/source/controls/formattedcontrol.cxx index 7c763703a2b2..1bc3178305f8 100644 --- a/toolkit/source/controls/formattedcontrol.cxx +++ b/toolkit/source/controls/formattedcontrol.cxx @@ -59,22 +59,16 @@ namespace toolkit } - bool& lcl_getTriedCreation() - { - static bool s_bTriedCreation = false; - return s_bTriedCreation; - } - + static bool s_bTriedCreation = false; const Reference< XNumberFormatsSupplier >& lcl_getDefaultFormats_throw() { ::osl::MutexGuard aGuard( getDefaultFormatsMutex() ); - bool& rbTriedCreation = lcl_getTriedCreation(); Reference< XNumberFormatsSupplier >& rDefaultFormats( lcl_getDefaultFormatsAccess_nothrow() ); - if ( !rDefaultFormats.is() && !rbTriedCreation ) + if ( !rDefaultFormats.is() && !s_bTriedCreation ) { - rbTriedCreation = true; + s_bTriedCreation = true; rDefaultFormats = NumberFormatsSupplier::createWithDefaultLocale( ::comphelper::getProcessComponentContext() ); } if ( !rDefaultFormats.is() ) @@ -101,7 +95,7 @@ namespace toolkit Reference< XNumberFormatsSupplier >& rDefaultFormats( lcl_getDefaultFormatsAccess_nothrow() ); Reference< XNumberFormatsSupplier > xReleasePotentialLastReference( rDefaultFormats ); rDefaultFormats.clear(); - lcl_getTriedCreation() = false; + s_bTriedCreation = false; aGuard.clear(); xReleasePotentialLastReference.clear(); |