summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-11-07 18:45:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-11-08 07:43:09 +0100
commita75324ccabcf09c0f1bc7a1a43256aa37f0da751 (patch)
tree6de2ef70e4c0a3006944454652681858c946b871 /oox
parent01878ce321dbbffbc877fbe9eb399dec95f99755 (diff)
rtl::Instance->thread-safe static in PropertyNameVector
Change-Id: I3f595585b78c9e5ac32d9fc345c55a4eb14101c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124824 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/helper/propertymap.cxx4
-rw-r--r--oox/source/token/propertynames.cxx9
2 files changed, 7 insertions, 6 deletions
diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx
index afb6ef6ff6f6..83495dc879b1 100644
--- a/oox/source/helper/propertymap.cxx
+++ b/oox/source/helper/propertymap.cxx
@@ -180,7 +180,7 @@ sal_Bool SAL_CALL GenericPropertySet::hasPropertyByName( const OUString& rProper
} // namespace
PropertyMap::PropertyMap() :
- mpPropNames( &StaticPropertyNameVector::get() ) // pointer instead reference to get compiler generated copy c'tor and operator=
+ mpPropNames( &GetPropertyNameVector() ) // pointer instead reference to get compiler generated copy c'tor and operator=
{
}
@@ -221,7 +221,7 @@ void PropertyMap::assignUsed( const PropertyMap& rPropMap )
const OUString& PropertyMap::getPropertyName( sal_Int32 nPropId )
{
OSL_ENSURE( (0 <= nPropId) && (nPropId < PROP_COUNT), "PropertyMap::getPropertyName - invalid property identifier" );
- return StaticPropertyNameVector::get()[ nPropId ];
+ return GetPropertyNameVector()[ nPropId ];
}
void PropertyMap::assignAll( const PropertyMap& rPropMap )
diff --git a/oox/source/token/propertynames.cxx b/oox/source/token/propertynames.cxx
index b7c5e544143c..eadf0d5d4d7a 100644
--- a/oox/source/token/propertynames.cxx
+++ b/oox/source/token/propertynames.cxx
@@ -21,12 +21,13 @@
namespace oox
{
-PropertyNameVector::PropertyNameVector()
- : ::std::vector<OUString>{
+const std::vector<OUString>& GetPropertyNameVector()
+{
+ static const std::vector<OUString> NAMES{
// include auto-generated C array with property names as C strings
#include <propertynames.inc>
- }
-{
+ };
+ return NAMES;
}
} // namespace oox