summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-11-08 15:11:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-11-10 09:53:17 +0100
commitba1c844fe8735702af31f79843221c5b94af8fe1 (patch)
treea9618a7fc296911c97e71ccaceddb6a8b202a0da /framework
parent11a97db6c8552b3b4a6e312268ddc5f8ade0ee4e (diff)
loplugin:fieldcast in framework::StatusBarWrapper
Change-Id: I10198364323ed1886f6f356c964fc68bab8627e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159254 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/uielement/statusbarwrapper.hxx5
-rw-r--r--framework/source/uielement/statusbarwrapper.cxx16
2 files changed, 8 insertions, 13 deletions
diff --git a/framework/inc/uielement/statusbarwrapper.hxx b/framework/inc/uielement/statusbarwrapper.hxx
index 203ae6956a16..c281b4f4866f 100644
--- a/framework/inc/uielement/statusbarwrapper.hxx
+++ b/framework/inc/uielement/statusbarwrapper.hxx
@@ -20,12 +20,13 @@
#pragma once
#include <helper/uiconfigelementwrapperbase.hxx>
-
+#include <rtl/ref.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
namespace framework
{
+class StatusBarManager;
class StatusBarWrapper final : public UIConfigElementWrapperBase
{
@@ -47,7 +48,7 @@ class StatusBarWrapper final : public UIConfigElementWrapperBase
virtual void SAL_CALL updateSettings() override;
private:
- css::uno::Reference< css::lang::XComponent > m_xStatusBarManager;
+ rtl::Reference< StatusBarManager > m_xStatusBarManager;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
};
diff --git a/framework/source/uielement/statusbarwrapper.cxx b/framework/source/uielement/statusbarwrapper.cxx
index 8ce6e48e5eb1..845a0b9269cf 100644
--- a/framework/source/uielement/statusbarwrapper.cxx
+++ b/framework/source/uielement/statusbarwrapper.cxx
@@ -137,11 +137,9 @@ void SAL_CALL StatusBarWrapper::updateSettings()
try
{
- StatusBarManager* pStatusBarManager = static_cast< StatusBarManager *>( m_xStatusBarManager.get() );
-
m_xConfigData = m_xConfigSource->getSettings( m_aResourceURL, false );
if ( m_xConfigData.is() )
- pStatusBarManager->FillStatusBar( m_xConfigData );
+ m_xStatusBarManager->FillStatusBar( m_xConfigData );
}
catch ( const NoSuchElementException& )
{
@@ -152,15 +150,11 @@ Reference< XInterface > SAL_CALL StatusBarWrapper::getRealInterface()
{
SolarMutexGuard g;
- if ( m_xStatusBarManager.is() )
+ if ( m_xStatusBarManager )
{
- StatusBarManager* pStatusBarManager = static_cast< StatusBarManager *>( m_xStatusBarManager.get() );
- if ( pStatusBarManager )
- {
- vcl::Window* pWindow = pStatusBarManager->GetStatusBar();
- if ( pWindow )
- return Reference< XInterface >( VCLUnoHelper::GetInterface( pWindow ), UNO_QUERY );
- }
+ vcl::Window* pWindow = m_xStatusBarManager->GetStatusBar();
+ if ( pWindow )
+ return Reference< XInterface >( VCLUnoHelper::GetInterface( pWindow ), UNO_QUERY );
}
return Reference< XInterface >();