diff options
-rw-r--r-- | include/vcl/menubarupdateicon.hxx | 2 | ||||
-rw-r--r-- | vcl/source/window/bubblewindow.cxx | 24 |
2 files changed, 11 insertions, 15 deletions
diff --git a/include/vcl/menubarupdateicon.hxx b/include/vcl/menubarupdateicon.hxx index 8e04c3f65a72..99aea9581a4f 100644 --- a/include/vcl/menubarupdateicon.hxx +++ b/include/vcl/menubarupdateicon.hxx @@ -66,7 +66,7 @@ private: sal_uInt16 GetIconID(MenuBar* pMenuBar) const; - void AddMenuBarIcon(SystemWindow* pSysWin, bool bAddEventHdl); + void AddMenuBarIcon(SystemWindow& rSysWin, bool bAddEventHdl); void RemoveMenuBarIcon(MenuBar* pMenuBar); void RemoveMenuBarIcons(); diff --git a/vcl/source/window/bubblewindow.cxx b/vcl/source/window/bubblewindow.cxx index dd11dce12ae6..9b8432a14a9a 100644 --- a/vcl/source/window/bubblewindow.cxx +++ b/vcl/source/window/bubblewindow.cxx @@ -295,10 +295,8 @@ IMPL_LINK(MenuBarUpdateIconManager, WindowEventHdl, VclWindowEvent&, rEvent, voi if ( pWindow ) { SystemWindow *pSysWin = pWindow->GetSystemWindow(); - if ( pSysWin ) - { - AddMenuBarIcon( pSysWin, false ); - } + if (pSysWin) + AddMenuBarIcon(*pSysWin, false); } } else if ( VclEventId::WindowMenubarRemoved == nEventID ) @@ -343,9 +341,7 @@ IMPL_LINK(MenuBarUpdateIconManager, ApplicationEventHdl, VclSimpleEvent&, rEvent SystemWindow *pSysWin = pWindow->GetSystemWindow(); MenuBar *pMBar = pSysWin ? pSysWin->GetMenuBar() : nullptr; if (pMBar) - { - AddMenuBarIcon( pSysWin, true ); - } + AddMenuBarIcon(*pSysWin, true); } break; } @@ -378,7 +374,7 @@ IMPL_LINK_NOARG(MenuBarUpdateIconManager, UserEventHdl, void*, void) } if ( pActiveSysWin ) - AddMenuBarIcon( pActiveSysWin, true ); + AddMenuBarIcon(*pActiveSysWin, true); } IMPL_LINK_NOARG(MenuBarUpdateIconManager, ClickHdl, MenuBarButtonCallbackArg&, bool) @@ -500,13 +496,13 @@ Image GetMenuBarIcon( MenuBar const * pMBar ) } } -void MenuBarUpdateIconManager::AddMenuBarIcon(SystemWindow *pSysWin, bool bAddEventHdl) +void MenuBarUpdateIconManager::AddMenuBarIcon(SystemWindow& rSysWin, bool bAddEventHdl) { if (!mbShowMenuIcon) return; - MenuBar *pActiveMBar = pSysWin->GetMenuBar(); - if (pSysWin != mpActiveSysWin || pActiveMBar != mpActiveMBar) + MenuBar *pActiveMBar = rSysWin.GetMenuBar(); + if (&rSysWin != mpActiveSysWin || pActiveMBar != mpActiveMBar) RemoveBubbleWindow(); auto aI = std::find(maIconMBars.begin(), maIconMBars.end(), pActiveMBar); @@ -532,8 +528,8 @@ void MenuBarUpdateIconManager::AddMenuBarIcon(SystemWindow *pSysWin, bool bAddEv maIconIDs.push_back(nIconID); } - if (bAddEventHdl && pSysWin) - pSysWin->AddEventListener( maWindowEventHdl ); + if (bAddEventHdl) + rSysWin.AddEventListener( maWindowEventHdl ); } if (mpActiveMBar != pActiveMBar) @@ -551,7 +547,7 @@ void MenuBarUpdateIconManager::AddMenuBarIcon(SystemWindow *pSysWin, bool bAddEv } } - mpActiveSysWin = pSysWin; + mpActiveSysWin = &rSysWin; if (mbShowBubble && pActiveMBar) { |