From 230a9da04f81c5ae54b6d7dc7972ac05a20a52c8 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 3 Dec 2024 16:21:27 +0100 Subject: vcl: Drop MenuFloatingWindow::KillActivePopup param Move logic to the only caller that passed something else than the default nullptr. Change-Id: I293f2ca7ccd22f8f0f57a7fd91a6b4dfaa6a8846 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177747 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/source/window/menu.cxx | 4 ++-- vcl/source/window/menufloatingwindow.cxx | 4 ++-- vcl/source/window/menufloatingwindow.hxx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'vcl/source') diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 5ab0eef8471a..6e7fc5494ca5 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2745,8 +2745,8 @@ PopupMenu::~PopupMenu() void PopupMenu::ClosePopup(PopupMenu* pPopupMenu) { MenuFloatingWindow* p = ImplGetFloatingWindow(); - if (p && pPopupMenu) - p->KillActivePopup(pPopupMenu); + if (p && pPopupMenu && p->GetActivePopup() == pPopupMenu) + p->KillActivePopup(); } namespace vcl diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index 0d6a60689c35..8beb36be0760 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -477,9 +477,9 @@ void MenuFloatingWindow::StopExecute() pMenu->pStartedFrom->ImplCallEventListeners( VclEventId::MenuSubmenuDeactivate, nPosInParent ); } -void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly ) +void MenuFloatingWindow::KillActivePopup() { - if ( !pActivePopup || ( pThisOnly && ( pThisOnly != pActivePopup ) ) ) + if (!pActivePopup) return; if (MenuFloatingWindow* pFloatWin = pActivePopup->ImplGetFloatingWindow()) diff --git a/vcl/source/window/menufloatingwindow.hxx b/vcl/source/window/menufloatingwindow.hxx index 5324197aa8bd..3d364847361a 100644 --- a/vcl/source/window/menufloatingwindow.hxx +++ b/vcl/source/window/menufloatingwindow.hxx @@ -113,7 +113,7 @@ public: void EndExecute( sal_uInt16 nSelectId ); PopupMenu* GetActivePopup() const { return pActivePopup; } - void KillActivePopup( PopupMenu* pThisOnly = nullptr ); + void KillActivePopup(); void ChangeHighlightItem(sal_uInt16 n, bool bStartPopupTimer); sal_uInt16 GetHighlightedItem() const { return nHighlightedItem; } -- cgit