framework/inc/uielement/statusbaritem.hxx    |   10 ++++------
 framework/source/uielement/statusbaritem.cxx |   12 +++++-------
 2 files changed, 9 insertions(+), 13 deletions(-)

New commits:
commit 8566b3f8d2c89ac408e5a66335f978848bfc9e9f
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Fri Dec 24 20:42:20 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Dec 26 08:23:53 2021 +0100

    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.gran...@collabora.co.uk>

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;
 }
 

Reply via email to