summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-24 20:46:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-26 08:23:14 +0100
commita839a6afada46b44095be184548f6fa75d80e961 (patch)
tree2f380709932c41b89f4474df7cf61ab7ac26b3d8 /framework
parent92c0775f2fa4f90ef9a19cb1d466e6bfec3dd9f0 (diff)
use comphelper::WeakComponentImplHelper in UICommandDescription
Change-Id: I042c9761c60d3b1c39950cfede80958edf2d84c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127461 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/uielement/uicommanddescription.hxx8
-rw-r--r--framework/source/uielement/uicommanddescription.cxx14
2 files changed, 9 insertions, 13 deletions
diff --git a/framework/inc/uielement/uicommanddescription.hxx b/framework/inc/uielement/uicommanddescription.hxx
index 146b4f42db3a..aeeb1f9aa216 100644
--- a/framework/inc/uielement/uicommanddescription.hxx
+++ b/framework/inc/uielement/uicommanddescription.hxx
@@ -26,19 +26,17 @@
#include <com/sun/star/frame/XModuleManager2.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <cppuhelper/basemutex.hxx>
-#include <cppuhelper/compbase.hxx>
+#include <comphelper/compbase.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <rtl/ustring.hxx>
#include <i18nlangtag/languagetag.hxx>
namespace framework
{
-typedef ::cppu::WeakComponentImplHelper< css::lang::XServiceInfo,
+typedef comphelper::WeakComponentImplHelper< css::lang::XServiceInfo,
css::container::XNameAccess > UICommandDescription_BASE;
-class UICommandDescription : private cppu::BaseMutex,
- public UICommandDescription_BASE
+class UICommandDescription : public UICommandDescription_BASE
{
public:
UICommandDescription( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx
index 682b482766fc..9f81afced1a7 100644
--- a/framework/source/uielement/uicommanddescription.cxx
+++ b/framework/source/uielement/uicommanddescription.cxx
@@ -565,8 +565,7 @@ void UICommandDescription::ensureGenericUICommandsForLanguage(const LanguageTag&
}
UICommandDescription::UICommandDescription(const Reference< XComponentContext >& rxContext)
- : UICommandDescription_BASE(m_aMutex)
- , m_aPrivateResourceURL(PRIVATE_RESOURCE_URL)
+ : m_aPrivateResourceURL(PRIVATE_RESOURCE_URL)
, m_xContext(rxContext)
{
SvtSysLocale aSysLocale;
@@ -584,14 +583,13 @@ UICommandDescription::UICommandDescription(const Reference< XComponentContext >&
}
UICommandDescription::UICommandDescription(const Reference< XComponentContext >& rxContext, bool)
- : UICommandDescription_BASE(m_aMutex)
- , m_xContext(rxContext)
+ : m_xContext(rxContext)
{
}
UICommandDescription::~UICommandDescription()
{
- osl::MutexGuard g(rBHelper.rMutex);
+ std::unique_lock g(m_aMutex);
m_aModuleToCommandFileMap.clear();
m_aUICommandsHashMap.clear();
m_xGenericUICommands.clear();
@@ -637,7 +635,7 @@ Any SAL_CALL UICommandDescription::getByName( const OUString& aName )
const LanguageTag& rCurrentLanguage = aSysLocale.GetUILanguageTag();
Any a;
- osl::MutexGuard g(rBHelper.rMutex);
+ std::unique_lock g(m_aMutex);
ModuleToCommandFileMap::const_iterator pM2CIter = m_aModuleToCommandFileMap.find( aName );
if ( pM2CIter != m_aModuleToCommandFileMap.end() )
@@ -682,14 +680,14 @@ Any SAL_CALL UICommandDescription::getByName( const OUString& aName )
Sequence< OUString > SAL_CALL UICommandDescription::getElementNames()
{
- osl::MutexGuard g(rBHelper.rMutex);
+ std::unique_lock g(m_aMutex);
return comphelper::mapKeysToSequence( m_aModuleToCommandFileMap );
}
sal_Bool SAL_CALL UICommandDescription::hasByName( const OUString& aName )
{
- osl::MutexGuard g(rBHelper.rMutex);
+ std::unique_lock g(m_aMutex);
ModuleToCommandFileMap::const_iterator pIter = m_aModuleToCommandFileMap.find( aName );
return ( pIter != m_aModuleToCommandFileMap.end() );