diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-08 15:18:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-10 12:36:48 +0100 |
commit | 28756e84e48330b12087f6fc7d043c2fc5d67f28 (patch) | |
tree | f4607e6e05244dde3474a7af82cea81382658304 | |
parent | e88c98f81c7ff515c3cf44db43c4961a1050a03b (diff) |
loplugin:fieldcast in framework::AddonsToolBarWrapper
Change-Id: I1fc692581acc805d6c84156d6df57093cf9dff93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159281
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | framework/inc/uielement/addonstoolbarwrapper.hxx | 5 | ||||
-rw-r--r-- | framework/source/uielement/addonstoolbarwrapper.cxx | 20 |
2 files changed, 9 insertions, 16 deletions
diff --git a/framework/inc/uielement/addonstoolbarwrapper.hxx b/framework/inc/uielement/addonstoolbarwrapper.hxx index 68cfc0ff31d0..fc09465eea5a 100644 --- a/framework/inc/uielement/addonstoolbarwrapper.hxx +++ b/framework/inc/uielement/addonstoolbarwrapper.hxx @@ -20,12 +20,13 @@ #pragma once #include <helper/uielementwrapperbase.hxx> - +#include <rtl/ref.hxx> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/uno/XComponentContext.hpp> namespace framework { +class ToolBarManager; class AddonsToolBarWrapper final : public UIElementWrapperBase { @@ -47,7 +48,7 @@ class AddonsToolBarWrapper final : public UIElementWrapperBase private: css::uno::Reference< css::uno::XComponentContext > m_xContext; - css::uno::Reference< css::lang::XComponent > m_xToolBarManager; + rtl::Reference< ToolBarManager > m_xToolBarManager; css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > m_aConfigData; bool m_bCreatedImages; }; diff --git a/framework/source/uielement/addonstoolbarwrapper.cxx b/framework/source/uielement/addonstoolbarwrapper.cxx index 6547d1c6bcde..f0bb99549fcf 100644 --- a/framework/source/uielement/addonstoolbarwrapper.cxx +++ b/framework/source/uielement/addonstoolbarwrapper.cxx @@ -134,14 +134,10 @@ Reference< XInterface > SAL_CALL AddonsToolBarWrapper::getRealInterface() { SolarMutexGuard g; - if ( m_xToolBarManager.is() ) + if ( m_xToolBarManager ) { - ToolBarManager* pToolBarManager = static_cast< ToolBarManager *>( m_xToolBarManager.get() ); - if ( pToolBarManager ) - { - vcl::Window* pWindow = pToolBarManager->GetToolBar(); - return Reference< XInterface >( VCLUnoHelper::GetInterface( pWindow ), UNO_QUERY ); - } + vcl::Window* pWindow = m_xToolBarManager->GetToolBar(); + return Reference< XInterface >( VCLUnoHelper::GetInterface( pWindow ), UNO_QUERY ); } return Reference< XInterface >(); @@ -155,14 +151,10 @@ void AddonsToolBarWrapper::populateImages() if (m_bCreatedImages) return; - if ( m_xToolBarManager.is() ) + if (m_xToolBarManager) { - ToolBarManager* pToolBarManager = static_cast< ToolBarManager *>( m_xToolBarManager.get() ); - if (pToolBarManager) - { - pToolBarManager->RequestImages(); - m_bCreatedImages = true; - } + m_xToolBarManager->RequestImages(); + m_bCreatedImages = true; } } |