toolkit/source/controls/formattedcontrol.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
New commits: commit 9f0a4ae5dec545fe5d90c10ed4ddc2395e617e8e Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Nov 20 11:21:23 2018 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Nov 20 14:47:49 2018 +0100 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.gran...@collabora.co.uk> Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> 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(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits