diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-12-02 14:16:19 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-12-02 19:27:48 +0100 |
commit | 88a6a8eb9a0b30a25a6996cd8677b47a42f4822a (patch) | |
tree | 929dde40dea5c913d34dcffbd2c212e1bb35f6ad /vcl | |
parent | 99379a3260f790d3a19662b08fd892da4f7323a3 (diff) |
vcl: Consistently use pMenuBarWindow in MenuBar::ImplCreate
Use `pWindow` only to assign initial value to
`pMenuBarWindow`, then consistently use only the latter
instead of keeping both in sync and using interchangeably.
This also prepares for changing the `pWindow` param
from `vcl::Window*` to `MenuBarWindow*` in an upcoming
commit without upsetting clang plugins.
Change-Id: I07482e23c365ce39c4aa581fb42bf97ad03f6e1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177696
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/menu.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 11d38a1a3bfb..ff6581d207a9 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2488,13 +2488,13 @@ VclPtr<vcl::Window> MenuBar::ImplCreate(vcl::Window* pParent, vcl::Window* pWind VclPtr<MenuBarWindow> pMenuBarWindow = dynamic_cast<MenuBarWindow*>(pWindow); if (!pMenuBarWindow) { - pWindow = pMenuBarWindow = VclPtr<MenuBarWindow>::Create( pParent ); + pMenuBarWindow = VclPtr<MenuBarWindow>::Create(pParent); } pMenu->pStartedFrom = nullptr; - pMenu->m_pWindow = pWindow; + pMenu->m_pWindow = pMenuBarWindow; pMenuBarWindow->SetMenu(pMenu); - tools::Long nHeight = pWindow ? pMenu->ImplCalcSize(pWindow).Height() : 0; + tools::Long nHeight = pMenuBarWindow ? pMenu->ImplCalcSize(pMenuBarWindow).Height() : 0; // depending on the native implementation or the displayable flag // the menubar windows is suppressed (ie, height=0) @@ -2504,7 +2504,7 @@ VclPtr<vcl::Window> MenuBar::ImplCreate(vcl::Window* pParent, vcl::Window* pWind } pMenuBarWindow->SetHeight(nHeight); - return pWindow; + return pMenuBarWindow; } void MenuBar::ImplDestroy( MenuBar* pMenu, bool bDelete ) |