diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-11-12 19:36:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-11-13 15:59:32 +0100 |
commit | 39f4fd491ca5abaa8a01b75eb500bb82248ff4aa (patch) | |
tree | 9ab668bdb597361e12c91e28a958a327c1e05af8 /oox | |
parent | 1b6e3efe964eec9110e656a8242f6f4d8b5e7f7e (diff) |
rtl::Static->thread-safe static
Change-Id: I3010494a750eee70ffe9c24c10417d0a3730dbd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125120
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/fasttokenhandler.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/customshapeproperties.cxx | 2 | ||||
-rw-r--r-- | oox/source/mathml/importutils.cxx | 2 | ||||
-rw-r--r-- | oox/source/token/tokenmap.cxx | 6 |
4 files changed, 9 insertions, 3 deletions
diff --git a/oox/source/core/fasttokenhandler.cxx b/oox/source/core/fasttokenhandler.cxx index a57be30e0c2c..398772df058f 100644 --- a/oox/source/core/fasttokenhandler.cxx +++ b/oox/source/core/fasttokenhandler.cxx @@ -30,7 +30,7 @@ namespace oox::core { using namespace ::com::sun::star::uno; FastTokenHandler::FastTokenHandler() : - mrTokenMap( StaticTokenMap::get() ) + mrTokenMap( StaticTokenMap() ) { } diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx index ac11d2d7eaa6..977afab04a6a 100644 --- a/oox/source/drawingml/customshapeproperties.cxx +++ b/oox/source/drawingml/customshapeproperties.cxx @@ -55,7 +55,7 @@ CustomShapeProperties::CustomShapeProperties() uno::Sequence< sal_Int8 > const & CustomShapeProperties::getShapePresetTypeName() const { - return StaticTokenMap::get().getUtf8TokenName( mnShapePresetType ); + return StaticTokenMap().getUtf8TokenName( mnShapePresetType ); } sal_Int32 CustomShapeProperties::SetCustomShapeGuideValue( std::vector< CustomShapeGuide >& rGuideList, const CustomShapeGuide& rGuide ) diff --git a/oox/source/mathml/importutils.cxx b/oox/source/mathml/importutils.cxx index 962528acba2a..16f527389924 100644 --- a/oox/source/mathml/importutils.cxx +++ b/oox/source/mathml/importutils.cxx @@ -51,7 +51,7 @@ AttributeListBuilder::AttributeListBuilder( const uno::Reference< xml::sax::XFas OString tokenToString( int token ) { - uno::Sequence< sal_Int8 > const & aTokenNameSeq = StaticTokenMap::get().getUtf8TokenName( token & TOKEN_MASK ); + uno::Sequence< sal_Int8 > const & aTokenNameSeq = StaticTokenMap().getUtf8TokenName( token & TOKEN_MASK ); OString tokenname( reinterpret_cast< const char* >( aTokenNameSeq.getConstArray() ), aTokenNameSeq.getLength() ); if( tokenname.isEmpty()) tokenname = "???"; diff --git a/oox/source/token/tokenmap.cxx b/oox/source/token/tokenmap.cxx index 7cbba35009ae..1e51116192c6 100644 --- a/oox/source/token/tokenmap.cxx +++ b/oox/source/token/tokenmap.cxx @@ -87,6 +87,12 @@ sal_Int32 TokenMap::getTokenPerfectHash( const char *pStr, sal_Int32 nLength ) return pToken ? pToken->nToken : XML_TOKEN_INVALID; } +TokenMap& StaticTokenMap() +{ + static TokenMap SINGLETON; + return SINGLETON; +} + } // namespace oox /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |