vcl/source/window/menu.cxx |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 88a6a8eb9a0b30a25a6996cd8677b47a42f4822a
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Dec 2 14:16:19 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Dec 2 19:27:48 2024 +0100

    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.wegh...@posteo.de>

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 )
commit 99379a3260f790d3a19662b08fd892da4f7323a3
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Dec 2 13:49:55 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Dec 2 19:27:40 2024 +0100

    vcl: Drop commented code in menu.cxx
    
    Commented out ever since
    
        commit 8ab086b6cc054501bfbf7ef6fa509c393691e860
        Author: Jens-Heiner Rechtien <h...@openoffice.org>
        Date:   Mon Sep 18 16:07:07 2000 +0000
    
            initial import
    
    Change-Id: I147a6f6376e624bce2164d156e9360f99ac3b1d7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177695
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 63597fc9dee4..11d38a1a3bfb 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2724,8 +2724,6 @@ int MenuBar::GetMenuBarHeight() const
     return nMenubarHeight;
 }
 
-// bool PopupMenu::bAnyPopupInExecute = false;
-
 MenuFloatingWindow * PopupMenu::ImplGetFloatingWindow() const {
     return static_cast<MenuFloatingWindow*>(GetWindow());
 }

Reply via email to