diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-12-03 16:21:27 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-12-04 08:36:51 +0100 |
commit | 230a9da04f81c5ae54b6d7dc7972ac05a20a52c8 (patch) | |
tree | 96405e1b88b0ca5047a3bfdc981535417a9850db | |
parent | 3e144ccb3cd9a1a093357b55140cc0be61beb3f7 (diff) |
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 <m.weghorn@posteo.de>
Tested-by: Jenkins
-rw-r--r-- | vcl/source/window/menu.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/menufloatingwindow.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/menufloatingwindow.hxx | 2 |
3 files changed, 5 insertions, 5 deletions
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; } |