diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-11-18 20:08:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-11-19 07:33:00 +0100 |
commit | 6f3c6b12eaf0466827c9ec6b84c2516e38061b04 (patch) | |
tree | 7cfc74a48d377cffa170277f52ef005b3740a9da /svx/source/sdr/attribute/sdrtextattribute.cxx | |
parent | 79db82976e3070b7889d2ec350dde3eff703ebe4 (diff) |
rtl::Static->thread-safe static in svx
Change-Id: I743d252befd948580a1b3619f51d3f0343cb469d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125493
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/sdr/attribute/sdrtextattribute.cxx')
-rw-r--r-- | svx/source/sdr/attribute/sdrtextattribute.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx index c9623a92498f..5c9ecb34ede2 100644 --- a/svx/source/sdr/attribute/sdrtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrtextattribute.cxx @@ -23,7 +23,6 @@ #include <svx/svdotext.hxx> #include <editeng/outlobj.hxx> #include <svx/sdr/properties/properties.hxx> -#include <rtl/instance.hxx> namespace drawinglayer::attribute @@ -229,8 +228,11 @@ namespace drawinglayer::attribute namespace { - struct theGlobalDefault : - public rtl::Static< SdrTextAttribute::ImplType, theGlobalDefault > {}; + SdrTextAttribute::ImplType& theGlobalDefault() + { + static SdrTextAttribute::ImplType SINGLETON; + return SINGLETON; + } } SdrTextAttribute::SdrTextAttribute( @@ -264,7 +266,7 @@ namespace drawinglayer::attribute } SdrTextAttribute::SdrTextAttribute() - : mpSdrTextAttribute(theGlobalDefault::get()) + : mpSdrTextAttribute(theGlobalDefault()) { } @@ -284,7 +286,7 @@ namespace drawinglayer::attribute bool SdrTextAttribute::isDefault() const { - return mpSdrTextAttribute.same_object(theGlobalDefault::get()); + return mpSdrTextAttribute.same_object(theGlobalDefault()); } SdrTextAttribute& SdrTextAttribute::operator=(const SdrTextAttribute& rCandidate) |