vcl/inc/window.h | 2 +- vcl/source/window/dlgctrl.cxx | 8 ++++---- vcl/source/window/window.cxx | 1 + xmlscript/source/xmldlg_imexp/imp_share.hxx | 4 ++-- xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 8 +++----- 5 files changed, 11 insertions(+), 12 deletions(-)
New commits: commit 1356892777b89b09ad7695e53d9e5ef1fca4f934 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Nov 7 12:59:44 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Nov 8 06:01:50 2023 +0100 loplugin:fieldcast in xmlscript Change-Id: Iecf8519ae43015a3ad850251a7027e22ce5bf836 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159082 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index c05460ddf274..9eec588c48f3 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -586,7 +586,7 @@ public: class ComboBoxElement : public ControlElement { - css::uno::Reference< css::xml::input::XElement > _popup; + rtl::Reference< MenuPopupElement > _popup; public: virtual css::uno::Reference< css::xml::input::XElement > SAL_CALL startChildElement( @@ -605,7 +605,7 @@ public: class MenuListElement : public ControlElement { - css::uno::Reference< css::xml::input::XElement > _popup; + rtl::Reference< MenuPopupElement > _popup; public: virtual css::uno::Reference< css::xml::input::XElement > SAL_CALL startChildElement( diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index 03344a5b7c4a..e64e60eabb3d 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -1371,11 +1371,10 @@ void MenuListElement::endElement() bool bHasSrcRange = ctx.importDataAwareProperty( "source-cell-range" , _xAttributes ); if (_popup.is()) { - MenuPopupElement * p = static_cast< MenuPopupElement * >( _popup.get() ); if ( !bHasSrcRange ) - xControlModel->setPropertyValue( "StringItemList", Any( p->getItemValues() ) ); + xControlModel->setPropertyValue( "StringItemList", Any( _popup->getItemValues() ) ); if ( !bHasLinkedCell ) - xControlModel->setPropertyValue( "SelectedItems", Any( p->getSelectedItems() ) ); + xControlModel->setPropertyValue( "SelectedItems", Any( _popup->getSelectedItems() ) ); } ctx.importEvents( _events ); @@ -1441,8 +1440,7 @@ void ComboBoxElement::endElement() bool bHasSrcRange = ctx.importDataAwareProperty( "source-cell-range" , _xAttributes ); if (_popup.is() && !bHasSrcRange ) { - MenuPopupElement * p = static_cast< MenuPopupElement * >( _popup.get() ); - xControlModel->setPropertyValue( "StringItemList", Any( p->getItemValues() ) ); + xControlModel->setPropertyValue( "StringItemList", Any( _popup->getItemValues() ) ); } ctx.importEvents( _events ); commit 1d1156b70d74033adecdb616c8276288785b84ac Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Nov 7 13:38:41 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Nov 8 06:01:39 2023 +0100 loplugin:fieldcast in WindowImpl Change-Id: I6790f6272b606c2fe8f1bde63ec9d072975701df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159085 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/vcl/inc/window.h b/vcl/inc/window.h index 7ddbb340c0fe..199fed977c4c 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -242,7 +242,7 @@ public: VclPtr<vcl::Window> mpNext; VclPtr<vcl::Window> mpNextOverlap; VclPtr<vcl::Window> mpLastFocusWindow; - VclPtr<vcl::Window> mpDlgCtrlDownWindow; + VclPtr<PushButton> mpDlgCtrlDownWindow; std::vector<Link<VclWindowEvent&,void>> maEventListeners; int mnEventListenersIteratingCount; std::set<Link<VclWindowEvent&,void>> maEventListenersDeleted; diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index 8db4402d9ef8..adf416b21769 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -754,7 +754,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) { if ( mpWindowImpl->mpDlgCtrlDownWindow.get() != pButtonWindow ) { - static_cast<PushButton*>(mpWindowImpl->mpDlgCtrlDownWindow.get())->SetPressed( false ); + mpWindowImpl->mpDlgCtrlDownWindow->SetPressed( false ); mpWindowImpl->mpDlgCtrlDownWindow = nullptr; return true; } @@ -965,12 +965,12 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) { if ( mpWindowImpl->mpDlgCtrlDownWindow && (mpWindowImpl->mpDlgCtrlDownWindow.get() != pButtonWindow) ) { - static_cast<PushButton*>(mpWindowImpl->mpDlgCtrlDownWindow.get())->SetPressed( false ); + mpWindowImpl->mpDlgCtrlDownWindow->SetPressed( false ); mpWindowImpl->mpDlgCtrlDownWindow = nullptr; } static_cast<PushButton*>(pButtonWindow)->SetPressed( true ); - mpWindowImpl->mpDlgCtrlDownWindow = pButtonWindow; + mpWindowImpl->mpDlgCtrlDownWindow = static_cast<PushButton*>(pButtonWindow); } else if ( mpWindowImpl->mpDlgCtrlDownWindow.get() == pButtonWindow ) { @@ -1092,7 +1092,7 @@ void Window::ImplDlgCtrlFocusChanged( vcl::Window* pWindow, bool bGetFocus ) { if ( mpWindowImpl->mpDlgCtrlDownWindow && !bGetFocus ) { - static_cast<PushButton*>(mpWindowImpl->mpDlgCtrlDownWindow.get())->SetPressed( false ); + mpWindowImpl->mpDlgCtrlDownWindow->SetPressed( false ); mpWindowImpl->mpDlgCtrlDownWindow = nullptr; } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 437a8b14dcb6..be029ca9572f 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -36,6 +36,7 @@ #include <vcl/dockwin.hxx> #include <vcl/wall.hxx> #include <vcl/toolkit/fixed.hxx> +#include <vcl/toolkit/button.hxx> #include <vcl/taskpanelist.hxx> #include <vcl/toolkit/unowrap.hxx> #include <vcl/lazydelete.hxx>