framework/inc/uielement/menubarwrapper.hxx | 4 ++-- framework/source/uielement/menubarwrapper.cxx | 17 ++++++----------- include/xmloff/XMLPageExport.hxx | 4 ++-- xmloff/source/style/XMLPageExport.cxx | 3 +-- 4 files changed, 11 insertions(+), 17 deletions(-)
New commits: commit d294d1a32d88174559bd4490a8ee44bc5bb604ea Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Nov 8 13:38:47 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Nov 10 12:35:26 2023 +0100 loplugin:fieldcast in XMLPageExport Change-Id: I07c5f2a6af46a3952d4fbc617d86174b1e23d518 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159222 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/xmloff/XMLPageExport.hxx b/include/xmloff/XMLPageExport.hxx index ba06efc38e08..0a1d7c1cfd23 100644 --- a/include/xmloff/XMLPageExport.hxx +++ b/include/xmloff/XMLPageExport.hxx @@ -38,7 +38,7 @@ class SvXMLExport; class XMLPropertyHandlerFactory; class XMLPropertySetMapper; class SvXMLExportPropertyMapper; - +class XMLPageMasterExportPropMapper; struct XMLPageExportNameEntry { @@ -58,7 +58,7 @@ class XMLOFF_DLLPUBLIC XMLPageExport : public salhelper::SimpleReferenceObject rtl::Reference < XMLPropertyHandlerFactory > m_xPageMasterPropHdlFactory; rtl::Reference < XMLPropertySetMapper > m_xPageMasterPropSetMapper; - rtl::Reference < SvXMLExportPropertyMapper > m_xPageMasterExportPropMapper; + rtl::Reference < XMLPageMasterExportPropMapper > m_xPageMasterExportPropMapper; rtl::Reference<XMLPropertySetMapper> m_xPageMasterDrawingPagePropSetMapper; rtl::Reference<SvXMLExportPropertyMapper> m_xPageMasterDrawingPageExportPropMapper; diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx index 500f9463b68e..c827eb14bdde 100644 --- a/xmloff/source/style/XMLPageExport.cxx +++ b/xmloff/source/style/XMLPageExport.cxx @@ -242,8 +242,7 @@ XMLPageExport::XMLPageExport(SvXMLExport & rExp) xProps->getPropertyValue("GutterAtTop") >>= bGutterAtTop; if (bGutterAtTop) { - static_cast<XMLPageMasterExportPropMapper*>(m_xPageMasterExportPropMapper.get()) - ->SetGutterAtTop(true); + m_xPageMasterExportPropMapper->SetGutterAtTop(true); } } commit 86441791e2ace0517025649ae4bbc33c371e5947 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Nov 8 15:13:20 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Nov 10 12:35:17 2023 +0100 loplugin:fieldcast in framework::MenuBarWrapper Change-Id: I7e44ad4db77db5fe4de543f47ffc4b8127e0ebea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159255 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/framework/inc/uielement/menubarwrapper.hxx b/framework/inc/uielement/menubarwrapper.hxx index c764ecdf14b8..848af5c693f7 100644 --- a/framework/inc/uielement/menubarwrapper.hxx +++ b/framework/inc/uielement/menubarwrapper.hxx @@ -36,7 +36,7 @@ class MenuBarWrapper final : public MenuBarWrapper_Base MenuBarWrapper( css::uno::Reference< css::uno::XComponentContext > xContext ); virtual ~MenuBarWrapper() override; - MenuBarManager* GetMenuBarManager() const { return static_cast< MenuBarManager* >( m_xMenuBarManager.get() ); } + MenuBarManager* GetMenuBarManager() const { return m_xMenuBarManager.get(); } // XComponent virtual void SAL_CALL dispose() override; @@ -64,7 +64,7 @@ class MenuBarWrapper final : public MenuBarWrapper_Base void fillPopupControllerCache(); bool m_bRefreshPopupControllerCache : 1; - css::uno::Reference< css::lang::XComponent > m_xMenuBarManager; + rtl::Reference< MenuBarManager > m_xMenuBarManager; PopupControllerCache m_aPopupControllerCache; css::uno::Reference< css::uno::XComponentContext > m_xContext; }; diff --git a/framework/source/uielement/menubarwrapper.cxx b/framework/source/uielement/menubarwrapper.cxx index c1ac0025d55e..24f4d738bf7f 100644 --- a/framework/source/uielement/menubarwrapper.cxx +++ b/framework/source/uielement/menubarwrapper.cxx @@ -175,11 +175,9 @@ void SAL_CALL MenuBarWrapper::updateSettings() { try { - MenuBarManager* pMenuBarManager = static_cast< MenuBarManager *>( m_xMenuBarManager.get() ); - m_xConfigData = m_xConfigSource->getSettings( m_aResourceURL, false ); if ( m_xConfigData.is() ) - pMenuBarManager->SetItemContainer( m_xConfigData ); + m_xMenuBarManager->SetItemContainer( m_xConfigData ); } catch ( const NoSuchElementException& ) { @@ -193,19 +191,16 @@ void SAL_CALL MenuBarWrapper::updateSettings() void MenuBarWrapper::impl_fillNewData() { // Transient menubar => Fill menubar with new data - MenuBarManager* pMenuBarManager = static_cast< MenuBarManager *>( m_xMenuBarManager.get() ); - - if ( pMenuBarManager ) - pMenuBarManager->SetItemContainer( m_xConfigData ); + if ( m_xMenuBarManager ) + m_xMenuBarManager->SetItemContainer( m_xConfigData ); } void MenuBarWrapper::fillPopupControllerCache() { if ( m_bRefreshPopupControllerCache ) { - MenuBarManager* pMenuBarManager = static_cast< MenuBarManager *>( m_xMenuBarManager.get() ); - if ( pMenuBarManager ) - pMenuBarManager->GetPopupController( m_aPopupControllerCache ); + if ( m_xMenuBarManager ) + m_xMenuBarManager->GetPopupController( m_aPopupControllerCache ); if ( !m_aPopupControllerCache.empty() ) m_bRefreshPopupControllerCache = false; } @@ -282,7 +277,7 @@ Reference< XInterface > SAL_CALL MenuBarWrapper::getRealInterface() if ( m_bDisposed ) throw DisposedException(); - return Reference< XInterface >( m_xMenuBarManager, UNO_QUERY ); + return Reference< XInterface >( static_cast<cppu::OWeakObject*>(m_xMenuBarManager.get()), UNO_QUERY ); } } // namespace framework