diff options
-rw-r--r-- | comphelper/source/misc/mimeconfighelper.cxx | 20 | ||||
-rw-r--r-- | include/comphelper/mimeconfighelper.hxx | 6 |
2 files changed, 17 insertions, 9 deletions
diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx index 82867b7bae48..4bc4410c225c 100644 --- a/comphelper/source/misc/mimeconfighelper.cxx +++ b/comphelper/source/misc/mimeconfighelper.cxx @@ -116,8 +116,12 @@ uno::Sequence< sal_Int8 > MimeConfigurationHelper::GetSequenceClassIDRepresentat uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetConfigurationByPath( const OUString& aPath ) { - osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); + return GetConfigurationByPathImpl(aPath); +} +uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetConfigurationByPathImpl( const OUString& aPath ) +{ uno::Reference< container::XNameAccess > xConfig; try @@ -143,10 +147,10 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetConfigurati uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetObjConfiguration() { - osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if ( !m_xObjectConfig.is() ) - m_xObjectConfig = GetConfigurationByPath( + m_xObjectConfig = GetConfigurationByPathImpl( "/org.openoffice.Office.Embedding/Objects" ); return m_xObjectConfig; @@ -155,10 +159,10 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetObjConfigur uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetVerbsConfiguration() { - osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if ( !m_xVerbsConfig.is() ) - m_xVerbsConfig = GetConfigurationByPath( + m_xVerbsConfig = GetConfigurationByPathImpl( "/org.openoffice.Office.Embedding/Verbs"); return m_xVerbsConfig; @@ -167,10 +171,10 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetVerbsConfig uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetMediaTypeConfiguration() { - osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if ( !m_xMediaTypeConfig.is() ) - m_xMediaTypeConfig = GetConfigurationByPath( + m_xMediaTypeConfig = GetConfigurationByPathImpl( "/org.openoffice.Office.Embedding/MimeTypeClassIDRelations"); return m_xMediaTypeConfig; @@ -179,7 +183,7 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetMediaTypeCo uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetFilterFactory() { - osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if ( !m_xFilterFactory.is() ) m_xFilterFactory.set( diff --git a/include/comphelper/mimeconfighelper.hxx b/include/comphelper/mimeconfighelper.hxx index 5a5585f00d55..4e674538e29c 100644 --- a/include/comphelper/mimeconfighelper.hxx +++ b/include/comphelper/mimeconfighelper.hxx @@ -22,6 +22,7 @@ #include <com/sun/star/uno/Reference.hxx> #include <comphelper/comphelperdllapi.h> +#include <mutex> namespace com::sun::star::beans { struct NamedValue; } namespace com::sun::star::beans { struct PropertyValue; } @@ -37,7 +38,7 @@ namespace comphelper { class COMPHELPER_DLLPUBLIC MimeConfigurationHelper { - ::osl::Mutex m_aMutex; + std::mutex m_aMutex; css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::lang::XMultiServiceFactory > m_xConfigProvider; @@ -133,6 +134,9 @@ public: static css::uno::Sequence< sal_Int8 > GetSequenceClassID( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3, sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11, sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15 ); +private: + css::uno::Reference< css::container::XNameAccess > + GetConfigurationByPathImpl( const OUString& aPath ); }; } |