summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-28 17:23:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-29 07:14:25 +0100
commit388369ad8fad3684da03d23c850e9f4e1b7bec1d (patch)
treec3162d6da617c396fc3139c97c27b40292edc2f5
parentf030d899d8f52684b0d34bcc1f4d9864f243ce73 (diff)
use comphelper::WeakComponentImplHelper in sd::framework::Configuration
Change-Id: Ib86f6da9dabac4cec43d7ee53de56972b2301c97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127650 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sd/source/ui/framework/configuration/Configuration.cxx21
-rw-r--r--sd/source/ui/inc/framework/Configuration.hxx12
2 files changed, 14 insertions, 19 deletions
diff --git a/sd/source/ui/framework/configuration/Configuration.cxx b/sd/source/ui/framework/configuration/Configuration.cxx
index 415339586613..7b813a42bddb 100644
--- a/sd/source/ui/framework/configuration/Configuration.cxx
+++ b/sd/source/ui/framework/configuration/Configuration.cxx
@@ -62,8 +62,7 @@ public:
Configuration::Configuration (
const Reference<XConfigurationControllerBroadcaster>& rxBroadcaster,
bool bBroadcastRequestEvents)
- : ConfigurationInterfaceBase(m_aMutex),
- mpResourceContainer(new ResourceContainer()),
+ : mpResourceContainer(new ResourceContainer()),
mxBroadcaster(rxBroadcaster),
mbBroadcastRequestEvents(bBroadcastRequestEvents)
{
@@ -73,8 +72,7 @@ Configuration::Configuration (
const Reference<XConfigurationControllerBroadcaster>& rxBroadcaster,
bool bBroadcastRequestEvents,
const ResourceContainer& rResourceContainer)
- : ConfigurationInterfaceBase(m_aMutex),
- mpResourceContainer(new ResourceContainer(rResourceContainer)),
+ : mpResourceContainer(new ResourceContainer(rResourceContainer)),
mxBroadcaster(rxBroadcaster),
mbBroadcastRequestEvents(bBroadcastRequestEvents)
{
@@ -84,9 +82,8 @@ Configuration::~Configuration()
{
}
-void SAL_CALL Configuration::disposing()
+void Configuration::disposing(std::unique_lock<std::mutex>&)
{
- ::osl::MutexGuard aGuard (m_aMutex);
mpResourceContainer->clear();
mxBroadcaster = nullptr;
}
@@ -130,7 +127,7 @@ Sequence<Reference<XResourceId> > SAL_CALL Configuration::getResources (
const OUString& rsResourceURLPrefix,
AnchorBindingMode eMode)
{
- ::osl::MutexGuard aGuard (m_aMutex);
+ std::unique_lock aGuard (m_aMutex);
ThrowIfDisposed();
const bool bFilterResources (!rsResourceURLPrefix.isEmpty());
@@ -168,7 +165,7 @@ Sequence<Reference<XResourceId> > SAL_CALL Configuration::getResources (
sal_Bool SAL_CALL Configuration::hasResource (const Reference<XResourceId>& rxResourceId)
{
- ::osl::MutexGuard aGuard (m_aMutex);
+ std::unique_lock aGuard (m_aMutex);
ThrowIfDisposed();
return rxResourceId.is()
@@ -179,7 +176,7 @@ sal_Bool SAL_CALL Configuration::hasResource (const Reference<XResourceId>& rxRe
Reference<util::XCloneable> SAL_CALL Configuration::createClone()
{
- ::osl::MutexGuard aGuard (m_aMutex);
+ std::unique_lock aGuard (m_aMutex);
ThrowIfDisposed();
return new Configuration(
@@ -192,10 +189,10 @@ Reference<util::XCloneable> SAL_CALL Configuration::createClone()
OUString SAL_CALL Configuration::getName()
{
- ::osl::MutexGuard aGuard (m_aMutex);
+ std::unique_lock aGuard (m_aMutex);
OUStringBuffer aString;
- if (rBHelper.bDisposed || rBHelper.bInDispose)
+ if (m_bDisposed)
aString.append("DISPOSED ");
aString.append("Configuration[");
@@ -263,7 +260,7 @@ void Configuration::PostEvent (
void Configuration::ThrowIfDisposed() const
{
- if (rBHelper.bDisposed || rBHelper.bInDispose)
+ if (m_bDisposed)
{
throw lang::DisposedException ("Configuration object has already been disposed",
const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this)));
diff --git a/sd/source/ui/inc/framework/Configuration.hxx b/sd/source/ui/inc/framework/Configuration.hxx
index 11c4093efd76..8f33ef4311be 100644
--- a/sd/source/ui/inc/framework/Configuration.hxx
+++ b/sd/source/ui/inc/framework/Configuration.hxx
@@ -22,8 +22,7 @@
#include <com/sun/star/drawing/framework/XConfiguration.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XNamed.hpp>
-#include <cppuhelper/basemutex.hxx>
-#include <cppuhelper/compbase.hxx>
+#include <comphelper/compbase.hxx>
#include <memory>
@@ -32,7 +31,7 @@ namespace com::sun::star::drawing::framework { class XConfigurationControllerBro
namespace sd::framework {
-typedef ::cppu::WeakComponentImplHelper <
+typedef comphelper::WeakComponentImplHelper <
css::drawing::framework::XConfiguration,
css::container::XNamed,
css::lang::XServiceInfo
@@ -57,9 +56,8 @@ typedef ::cppu::WeakComponentImplHelper <
exception of the configuration controller and objects that implement the
XConfigurationChangeOperation interface.
*/
-class Configuration
- : private cppu::BaseMutex,
- public ConfigurationInterfaceBase
+class Configuration final
+ : public ConfigurationInterfaceBase
{
public:
/** Create a new configuration with a broadcaster that is used to send
@@ -78,7 +76,7 @@ public:
bool bBroadcastRequestEvents);
virtual ~Configuration() override;
- virtual void SAL_CALL disposing() override;
+ virtual void disposing(std::unique_lock<std::mutex>&) override;
// XConfiguration