diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2023-03-23 11:11:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-23 19:49:25 +0000 |
commit | e7dbef922a2fc73469f12c520bcc1af54fe038fb (patch) | |
tree | 02c18e1d1c9d0d85914626f66ace24a79f892e79 /oox | |
parent | 462ebbd10bd537f42104fe991a0aeebcd563f178 (diff) |
rtl::Static to thread-safe-static
Change-Id: Ife02e6d2be3ebfbb08522ab0183ef4aa31a99e19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149415
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/color.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx index 592d0734efc2..805ca6c4faed 100644 --- a/oox/source/drawingml/color.cxx +++ b/oox/source/drawingml/color.cxx @@ -159,7 +159,11 @@ PresetColorsPool::PresetColorsPool() : maHighlightColors[static_cast<size_t>(nEntry.first)] = nEntry.second; } -struct StaticPresetColorsPool : public ::rtl::Static< PresetColorsPool, StaticPresetColorsPool > {}; +PresetColorsPool& StaticPresetColorsPool() +{ + static PresetColorsPool thePool; + return thePool; +} const double DEC_GAMMA = 2.3; const double INC_GAMMA = 1.0 / DEC_GAMMA; @@ -264,7 +268,7 @@ Color::Color() : /* Do not pass nDefaultRgb to ContainerHelper::getVectorElement(), to be able to catch the existing vector entries without corresponding XML token identifier. */ - ::Color nRgbValue = ContainerHelper::getVectorElement( StaticPresetColorsPool::get().maDmlColors, nToken, API_RGB_TRANSPARENT ); + ::Color nRgbValue = ContainerHelper::getVectorElement( StaticPresetColorsPool().maDmlColors, nToken, API_RGB_TRANSPARENT ); return (sal_Int32(nRgbValue) >= 0) ? nRgbValue : nDefaultRgb; } @@ -273,7 +277,7 @@ Color::Color() : /* Do not pass nDefaultRgb to ContainerHelper::getVectorElement(), to be able to catch the existing vector entries without corresponding XML token identifier. */ - ::Color nRgbValue = ContainerHelper::getVectorElement( StaticPresetColorsPool::get().maVmlColors, nToken, API_RGB_TRANSPARENT ); + ::Color nRgbValue = ContainerHelper::getVectorElement( StaticPresetColorsPool().maVmlColors, nToken, API_RGB_TRANSPARENT ); return (sal_Int32(nRgbValue) >= 0) ? nRgbValue : nDefaultRgb; } @@ -282,7 +286,7 @@ Color::Color() : /* Do not pass nDefaultRgb to ContainerHelper::getVectorElement(), to be able to catch the existing vector entries without corresponding XML token identifier. */ - ::Color nRgbValue = ContainerHelper::getVectorElement( StaticPresetColorsPool::get().maHighlightColors, nToken, API_RGB_TRANSPARENT ); + ::Color nRgbValue = ContainerHelper::getVectorElement( StaticPresetColorsPool().maHighlightColors, nToken, API_RGB_TRANSPARENT ); return (sal_Int32(nRgbValue) >= 0) ? nRgbValue : nDefaultRgb; } |