diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-12-02 11:45:22 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-12-02 15:19:54 +0100 |
commit | 44f6a3e9583357ac882f1660285214231961204a (patch) | |
tree | 7d23d2bf9a845133b92c34285175cfe1034bcb40 /vcl/source | |
parent | 1336fc1713f50d743cc151c78ead4621d48ecfb9 (diff) |
vcl: Use existing PopupMenu::ImplGetFloatingWindow
... instead of manually casting the `m_pWindow`
member in another place.
While at it, also just call GetWindow()
in PopupMenu::ImplGetFloatingWindow, not explicitly
the base class Menu::ImplGetFloatingWindow. Both
are the same, as this is a non-virtual method
only implemented in the base class.
Change-Id: I12debc7c5bad8b21722fabb093cbc4a7a669dff1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177672
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/window/menu.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/menufloatingwindow.cxx | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 80f14042b0b7..300ecf535980 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2727,7 +2727,7 @@ int MenuBar::GetMenuBarHeight() const // bool PopupMenu::bAnyPopupInExecute = false; MenuFloatingWindow * PopupMenu::ImplGetFloatingWindow() const { - return static_cast<MenuFloatingWindow *>(Menu::GetWindow()); + return static_cast<MenuFloatingWindow*>(GetWindow()); } PopupMenu::PopupMenu() diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index 64fba7d7a4f6..0d6a60689c35 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -482,9 +482,11 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly ) if ( !pActivePopup || ( pThisOnly && ( pThisOnly != pActivePopup ) ) ) return; - if (pActivePopup->m_pWindow) - if (static_cast<FloatingWindow *>(pActivePopup->m_pWindow.get())->IsInCleanUp()) + if (MenuFloatingWindow* pFloatWin = pActivePopup->ImplGetFloatingWindow()) + { + if (pFloatWin->IsInCleanUp()) return; // kill it later + } if ( pActivePopup->bInCallback ) pActivePopup->bCanceled = true; |