diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index b60cdc42b39b..36259d5ffb7f 100644 --- a/include/vcl/menu.hxx +++ b/include/vcl/menu.hxx @@ -421,7 +421,7 @@ class VCL_DLLPUBLIC MenuBar final : public Menu friend class MenuBarWindow; friend class SystemWindow; - SAL_DLLPRIVATE static VclPtr ImplCreate(vcl::Window* pParent, vcl::Window* pWindow, MenuBar* pMenu); + SAL_DLLPRIVATE static VclPtr ImplCreate(vcl::Window* pParent, MenuBarWindow* pWindow, MenuBar* pMenu); SAL_DLLPRIVATE static void ImplDestroy(MenuBar* pMenu, bool bDelete); SAL_DLLPRIVATE bool ImplHandleKeyEvent(const KeyEvent& rKEvent); SAL_DLLPRIVATE bool ImplHandleCmdEvent(const CommandEvent& rCEvent); diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index ff6581d207a9..6bc427ba28f3 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2483,9 +2483,9 @@ void MenuBar::SetDisplayable( bool bDisplayable ) } } -VclPtr MenuBar::ImplCreate(vcl::Window* pParent, vcl::Window* pWindow, MenuBar* pMenu) +VclPtr MenuBar::ImplCreate(vcl::Window* pParent, MenuBarWindow* pWindow, MenuBar* pMenu) { - VclPtr pMenuBarWindow = dynamic_cast(pWindow); + VclPtr pMenuBarWindow = pWindow; if (!pMenuBarWindow) { pMenuBarWindow = VclPtr::Create(pParent); diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index d4e1f9e51997..e92806e739fe 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -19,6 +19,8 @@ #include +#include "menubarwindow.hxx" + #include #include #include @@ -844,14 +846,14 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar) return; MenuBar* pOldMenuBar = mpMenuBar; - vcl::Window* pOldWindow = nullptr; - VclPtr pNewWindow; + MenuBarWindow* pOldWindow = nullptr; + VclPtr pNewWindow; mpMenuBar = pMenuBar; if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) ) { if ( pOldMenuBar ) - pOldWindow = pOldMenuBar->GetWindow(); + pOldWindow = pOldMenuBar->getMenuBarWindow(); else pOldWindow = nullptr; if ( pOldWindow ) @@ -888,9 +890,9 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar) else { if( pMenuBar ) - pNewWindow = pMenuBar->GetWindow(); + pNewWindow = pMenuBar->getMenuBarWindow(); if( pOldMenuBar ) - pOldWindow = pOldMenuBar->GetWindow(); + pOldWindow = pOldMenuBar->getMenuBarWindow(); } // update taskpane list to make menubar accessible