summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-11-07 13:38:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-11-08 06:01:39 +0100
commit1d1156b70d74033adecdb616c8276288785b84ac (patch)
tree3fded9706372506ccaa4227ab6e4c7e1aeea06ce
parentff3fb42b48c70ba5788507a6177bf0a9f3b50fdb (diff)
loplugin:fieldcast in WindowImpl
Change-Id: I6790f6272b606c2fe8f1bde63ec9d072975701df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159085 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--vcl/inc/window.h2
-rw-r--r--vcl/source/window/dlgctrl.cxx8
-rw-r--r--vcl/source/window/window.cxx1
3 files changed, 6 insertions, 5 deletions
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>