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>
This commit is contained in:
Noel Grandin 2023-11-08 15:18:22 +02:00
parent e88c98f81c
commit 28756e84e4
2 changed files with 9 additions and 16 deletions

View file

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

View file

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