vcl: No longer let MenuFloatingWindow be a friend of MenuBar

MenuFloatingWindow is the window used of PopupMenu,
while the window for MenuBar is MenuBarWindow.

MenuFloatingWindow only needs access to the menu
bar's MenuBarWindow, so make MenuBar::getMenuBarWindow
public and no longer let MenuFloatingWindow be a
friend of MenuBar, to make a little clearer who
is able to access whose private members,...

Change-Id: I7ee492e36d6e94884d1dba652d11f26cb8543a52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177692
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
This commit is contained in:
Michael Weghorn 2024-12-02 12:55:09 +01:00
parent 654e3134ad
commit 09187a0208

View file

@ -420,7 +420,6 @@ class VCL_DLLPUBLIC MenuBar final : public Menu
friend class Application;
friend class Menu;
friend class MenuBarWindow;
friend class MenuFloatingWindow;
friend class SystemWindow;
SAL_DLLPRIVATE static VclPtr<vcl::Window> ImplCreate(vcl::Window* pParent, vcl::Window* pWindow, MenuBar* pMenu);
@ -428,9 +427,6 @@ class VCL_DLLPUBLIC MenuBar final : public Menu
SAL_DLLPRIVATE bool ImplHandleKeyEvent(const KeyEvent& rKEvent);
SAL_DLLPRIVATE bool ImplHandleCmdEvent(const CommandEvent& rCEvent);
/// Return the MenuBarWindow.
SAL_DLLPRIVATE MenuBarWindow* getMenuBarWindow();
public:
MenuBar();
SAL_DLLPRIVATE MenuBar( const MenuBar& rMenu );
@ -441,6 +437,9 @@ public:
virtual bool IsMenuBar() const override { return true; }
/// Return the MenuBarWindow.
SAL_DLLPRIVATE MenuBarWindow* getMenuBarWindow();
/// Close the 'pStartedFrom' menu window.
virtual void ClosePopup(Menu* pMenu) override;