summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-20 11:21:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-20 14:47:49 +0100
commit9f0a4ae5dec545fe5d90c10ed4ddc2395e617e8e (patch)
treef70c3f2a96cdec00081c4bf6886a4cc0fdf7ef60 /toolkit
parent85123ef1ce3085b33884f688e99792468a118df3 (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')
-rw-r--r--toolkit/source/controls/formattedcontrol.cxx14
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();