vcl: Simplify MenuBar::ImplDestroy a bit

MenuBar::GetWindow() and MenuBar::getMenuBarWindow
return a pointer to the same object, so there's no
need to use + check both for null.

Change-Id: I1b7065e4cd04a24e6215118a8dc71f147ed75132
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177699
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn 2024-12-02 14:28:47 +01:00
parent 228f40c5f6
commit 6c48547069

View file

@ -2509,13 +2509,11 @@ VclPtr<MenuBarWindow> MenuBar::ImplCreate(vcl::Window* pParent, MenuBarWindow* p
void MenuBar::ImplDestroy( MenuBar* pMenu, bool bDelete )
{
vcl::Window *pWindow = pMenu->GetWindow();
if (pWindow && bDelete)
MenuBarWindow* pMenuWin = pMenu->getMenuBarWindow();
if (pMenuWin && bDelete)
{
MenuBarWindow* pMenuWin = pMenu->getMenuBarWindow();
if (pMenuWin)
pMenuWin->KillActivePopup();
pWindow->disposeOnce();
pMenuWin->KillActivePopup();
pMenuWin->disposeOnce();
}
pMenu->m_pWindow = nullptr;
if (pMenu->mpSalMenu) {