diff options
-rw-r--r-- | include/sfx2/notebookbar/NotebookbarTabControl.hxx | 3 | ||||
-rw-r--r-- | sfx2/source/notebookbar/NotebookbarTabControl.cxx | 15 |
2 files changed, 9 insertions, 9 deletions
diff --git a/include/sfx2/notebookbar/NotebookbarTabControl.hxx b/include/sfx2/notebookbar/NotebookbarTabControl.hxx index 062fe9631f48..0d4ce9b9632c 100644 --- a/include/sfx2/notebookbar/NotebookbarTabControl.hxx +++ b/include/sfx2/notebookbar/NotebookbarTabControl.hxx @@ -32,9 +32,10 @@ private: const OUString& aModuleName, ToolBox* pShortcuts ); - DECL_STATIC_LINK(NotebookbarTabControl, OpenNotebookbarPopupMenu, NotebookBar*, void); + DECL_LINK(OpenNotebookbarPopupMenu, NotebookBar*, void); ChangedUIEventListener* m_pListener; + css::uno::Reference<css::frame::XFrame> m_xFrame; protected: bool m_bInitialized; diff --git a/sfx2/source/notebookbar/NotebookbarTabControl.cxx b/sfx2/source/notebookbar/NotebookbarTabControl.cxx index 47a230097542..a443c045ffa1 100644 --- a/sfx2/source/notebookbar/NotebookbarTabControl.cxx +++ b/sfx2/source/notebookbar/NotebookbarTabControl.cxx @@ -143,7 +143,7 @@ void NotebookbarTabControl::StateChanged(StateChangedType nStateChange) pShortcuts->Show(); SetToolBox( static_cast<ToolBox*>( pShortcuts.get() ) ); - SetIconClickHdl( LINK( nullptr, NotebookbarTabControl, OpenNotebookbarPopupMenu ) ); + SetIconClickHdl( LINK( this, NotebookbarTabControl, OpenNotebookbarPopupMenu ) ); m_pListener = new ChangedUIEventListener( this ); @@ -159,10 +159,10 @@ void NotebookbarTabControl::StateChanged(StateChangedType nStateChange) Reference<XComponentContext> xContext = comphelper::getProcessComponentContext(); const Reference<XModuleManager> xModuleManager = ModuleManager::create( xContext ); - Reference<XFrame> xFrame = SfxViewFrame::Current()->GetFrame().GetFrameInterface(); - OUString aModuleName = xModuleManager->identify( xFrame ); + m_xFrame = SfxViewFrame::Current()->GetFrame().GetFrameInterface(); + OUString aModuleName = xModuleManager->identify( m_xFrame ); - FillShortcutsToolBox( xContext, xFrame, aModuleName, pToolBox ); + FillShortcutsToolBox( xContext, m_xFrame, aModuleName, pToolBox ); Size aSize( pToolBox->GetOptimalSize() ); Point aPos( ICON_SIZE + 10, 0 ); @@ -229,14 +229,13 @@ void NotebookbarTabControl::FillShortcutsToolBox(Reference<XComponentContext>& x } } -IMPL_STATIC_LINK(NotebookbarTabControl, OpenNotebookbarPopupMenu, NotebookBar*, pNotebookbar, void) +IMPL_LINK(NotebookbarTabControl, OpenNotebookbarPopupMenu, NotebookBar*, pNotebookbar, void) { - SfxViewFrame* pViewFrame = SfxViewFrame::Current(); - if (pNotebookbar && pViewFrame) + if (pNotebookbar && m_xFrame.is()) { Sequence<Any> aArgs { makeAny(comphelper::makePropertyValue("Value", OUString("notebookbar"))), - makeAny(comphelper::makePropertyValue("Frame", pViewFrame->GetFrame().GetFrameInterface())) }; + makeAny(comphelper::makePropertyValue("Frame", m_xFrame)) }; Reference<XComponentContext> xContext = comphelper::getProcessComponentContext(); Reference<XPopupMenuController> xPopupController( |