summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-11-11 20:59:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-11-13 13:01:06 +0100
commitbf2048b1d242c6d5b242f18903612cedf8eaef8e (patch)
tree2d4dc68a640b58f6cc1dc1b8056565a961988bf7 /oox
parenta339ebca55f53db5f0b72b26fcfbb3aaa2b2a825 (diff)
rtl::Static->thread-safe static in StaticNamespaceMap
Change-Id: Iea6f7f96685e332407288af7ada36527acc83a8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125119 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/fastparser.cxx2
-rw-r--r--oox/source/core/xmlfilterbase.cxx2
-rw-r--r--oox/source/token/namespacemap.cxx7
3 files changed, 9 insertions, 2 deletions
diff --git a/oox/source/core/fastparser.cxx b/oox/source/core/fastparser.cxx
index 9524b1403a90..53e5eb78a849 100644
--- a/oox/source/core/fastparser.cxx
+++ b/oox/source/core/fastparser.cxx
@@ -62,7 +62,7 @@ InputStreamCloseGuard::~InputStreamCloseGuard()
} // namespace
FastParser::FastParser() :
- mrNamespaceMap( StaticNamespaceMap::get() )
+ mrNamespaceMap( StaticNamespaceMap() )
{
// create a fast parser instance
mxParser = new sax_fastparser::FastSaxParser;
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 6c7aaac65476..7a9728e88f32 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -188,7 +188,7 @@ struct XmlFilterBaseImpl
constexpr OUStringLiteral gaBinSuffix( u".bin" );
XmlFilterBaseImpl::XmlFilterBaseImpl() :
- mrNamespaceMap(StaticNamespaceMap::get())
+ mrNamespaceMap(StaticNamespaceMap())
{
// register XML namespaces
registerNamespaces(maFastParser);
diff --git a/oox/source/token/namespacemap.cxx b/oox/source/token/namespacemap.cxx
index 11e7c9f0e45f..1cfa48a1ca28 100644
--- a/oox/source/token/namespacemap.cxx
+++ b/oox/source/token/namespacemap.cxx
@@ -31,6 +31,13 @@ NamespaceMap::NamespaceMap()
#include <namespaces-strictnames.inc>
};
}
+
+/** Thread-safe singleton of a map of all supported XML namespace URLs. */
+NamespaceMap& StaticNamespaceMap()
+{
+ static NamespaceMap SINGLETON;
+ return SINGLETON;
+}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */