summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-24 20:42:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-26 08:23:53 +0100
commit8566b3f8d2c89ac408e5a66335f978848bfc9e9f (patch)
tree15de251b26a795db6af3e699a827ea2ed150be31 /framework
parenta839a6afada46b44095be184548f6fa75d80e961 (diff)
use comphelper::WeakComponentImplHelper in StatusbarItem
Change-Id: I2c278547d16c5ad0530188f1e465cb784d345746 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127460 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/uielement/statusbaritem.hxx10
-rw-r--r--framework/source/uielement/statusbaritem.cxx12
2 files changed, 9 insertions, 13 deletions
diff --git a/framework/inc/uielement/statusbaritem.hxx b/framework/inc/uielement/statusbaritem.hxx
index 62e3c1f4e62e..44fecd1dff68 100644
--- a/framework/inc/uielement/statusbaritem.hxx
+++ b/framework/inc/uielement/statusbaritem.hxx
@@ -19,8 +19,7 @@
#pragma once
#include <com/sun/star/ui/XStatusbarItem.hpp>
-#include <cppuhelper/compbase.hxx>
-#include <cppuhelper/basemutex.hxx>
+#include <comphelper/compbase.hxx>
#include <vcl/vclptr.hxx>
class StatusBar;
@@ -30,10 +29,9 @@ namespace framework
struct AddonStatusbarItemData;
-typedef cppu::WeakComponentImplHelper< css::ui::XStatusbarItem > StatusbarItem_Base;
+typedef comphelper::WeakComponentImplHelper< css::ui::XStatusbarItem > StatusbarItem_Base;
-class StatusbarItem final : protected cppu::BaseMutex,
- public StatusbarItem_Base
+class StatusbarItem final : public StatusbarItem_Base
{
public:
explicit StatusbarItem(
@@ -42,7 +40,7 @@ public:
const OUString& aCommand );
virtual ~StatusbarItem() override;
- void SAL_CALL disposing() override;
+ void disposing(std::unique_lock<std::mutex>&) override;
// css::ui::XStatusbarItem Attributes
virtual OUString SAL_CALL getCommand() override;
diff --git a/framework/source/uielement/statusbaritem.cxx b/framework/source/uielement/statusbaritem.cxx
index a453f0079fc0..27985791ae86 100644
--- a/framework/source/uielement/statusbaritem.cxx
+++ b/framework/source/uielement/statusbaritem.cxx
@@ -62,8 +62,7 @@ StatusbarItem::StatusbarItem(
StatusBar *pStatusBar,
sal_uInt16 nId,
const OUString& aCommand )
- : StatusbarItem_Base( m_aMutex )
- , m_pStatusBar( pStatusBar )
+ : m_pStatusBar( pStatusBar )
, m_nId( nId )
, m_nStyle( 0 )
, m_aCommand( aCommand )
@@ -77,21 +76,20 @@ StatusbarItem::~StatusbarItem()
{
}
-void SAL_CALL StatusbarItem::disposing()
+void StatusbarItem::disposing(std::unique_lock<std::mutex>&)
{
- osl::MutexGuard aGuard( m_aMutex );
m_pStatusBar = nullptr;
}
OUString SAL_CALL StatusbarItem::getCommand()
{
- osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
return m_aCommand;
}
::sal_uInt16 SAL_CALL StatusbarItem::getItemId()
{
- osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
return m_nId;
}
@@ -106,7 +104,7 @@ OUString SAL_CALL StatusbarItem::getCommand()
::sal_uInt16 SAL_CALL StatusbarItem::getStyle()
{
- osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
return m_nStyle;
}