diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-11-09 18:46:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-11-09 20:42:24 +0100 |
commit | 151316b6010c45078e0a031f0ba07d6117c0109d (patch) | |
tree | 6933deabeb7381e0f693b1e620b6b1231cd81a28 /drawinglayer/source/attribute/fillgradientattribute.cxx | |
parent | 2fe0881906462cbcbe8baf81068010310fb1c97a (diff) |
rtl::Static to thread-safe static
Change-Id: Iff3489ee171cf2eaecbd1aad6f942a1468f76512
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124928
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer/source/attribute/fillgradientattribute.cxx')
-rw-r--r-- | drawinglayer/source/attribute/fillgradientattribute.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drawinglayer/source/attribute/fillgradientattribute.cxx b/drawinglayer/source/attribute/fillgradientattribute.cxx index 0e42954e35e6..b8b06e20bbbf 100644 --- a/drawinglayer/source/attribute/fillgradientattribute.cxx +++ b/drawinglayer/source/attribute/fillgradientattribute.cxx @@ -19,7 +19,6 @@ #include <drawinglayer/attribute/fillgradientattribute.hxx> #include <basegfx/color/bcolor.hxx> -#include <rtl/instance.hxx> namespace drawinglayer::attribute @@ -92,8 +91,11 @@ namespace drawinglayer::attribute namespace { - struct theGlobalDefault : - public rtl::Static< FillGradientAttribute::ImplType, theGlobalDefault > {}; + FillGradientAttribute::ImplType& theGlobalDefault() + { + static FillGradientAttribute::ImplType SINGLETON; + return SINGLETON; + } } FillGradientAttribute::FillGradientAttribute( @@ -111,7 +113,7 @@ namespace drawinglayer::attribute } FillGradientAttribute::FillGradientAttribute() - : mpFillGradientAttribute(theGlobalDefault::get()) + : mpFillGradientAttribute(theGlobalDefault()) { } @@ -123,7 +125,7 @@ namespace drawinglayer::attribute bool FillGradientAttribute::isDefault() const { - return mpFillGradientAttribute.same_object(theGlobalDefault::get()); + return mpFillGradientAttribute.same_object(theGlobalDefault()); } FillGradientAttribute& FillGradientAttribute::operator=(const FillGradientAttribute&) = default; |