From 3298e3beec6674f5bb2e480d4bf12e637ba5f3e2 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 21 Jul 2026 12:04:08 +0200 Subject: [PATCH] starmath: Pass SmCmdBoxWindow's SfxBindings param by ref Change-Id: Ia7d8d49605a0f501f5420a39c03fb99711310107 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208378 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- starmath/inc/view.hxx | 4 +--- starmath/qa/cppunit/test_starmath.cxx | 2 +- starmath/source/view.cxx | 11 ++++++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx index 572984e69038..aa6f2a086c17 100644 --- a/starmath/inc/view.hxx +++ b/starmath/inc/view.hxx @@ -202,9 +202,7 @@ class SmCmdBoxWindow final : public SfxDockingWindow virtual void ToggleFloatingMode() override; public: - SmCmdBoxWindow(SfxBindings *pBindings, - SfxChildWindow *pChildWindow, - Window *pParent); + SmCmdBoxWindow(SfxBindings& rBindings, SfxChildWindow* pChildWindow, Window* pParent); virtual ~SmCmdBoxWindow () override; virtual void dispose() override; diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx index e5d6f150ec28..1f0cafe42d16 100644 --- a/starmath/qa/cppunit/test_starmath.cxx +++ b/starmath/qa/cppunit/test_starmath.cxx @@ -127,7 +127,7 @@ void Test::setUp() m_pDispatcher.reset(new SfxDispatcher(pViewFrame)); m_aBindings.SetDispatcher(m_pDispatcher.get()); m_aBindings.EnterRegistrations(); - m_pSmCmdBoxWindow.reset(VclPtr::Create(&m_aBindings, nullptr, nullptr)); + m_pSmCmdBoxWindow.reset(VclPtr::Create(m_aBindings, nullptr, nullptr)); m_aBindings.LeaveRegistrations(); m_pViewShell = m_pSmCmdBoxWindow->GetView(); CPPUNIT_ASSERT_MESSAGE("Should have a SmViewShell", m_pViewShell); diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index e03c274d7a3e..251cf9072a18 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -955,11 +955,12 @@ void SmEditController::StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemStat } /**************************************************************************/ -SmCmdBoxWindow::SmCmdBoxWindow(SfxBindings *pBindings_, SfxChildWindow *pChildWindow, - vcl::Window *pParent) - : SfxDockingWindow(pBindings_, pChildWindow, pParent, u"EditWindow"_ustr, u"modules/smath/ui/editwindow.ui"_ustr) +SmCmdBoxWindow::SmCmdBoxWindow(SfxBindings& rBindings_, SfxChildWindow* pChildWindow, + vcl::Window* pParent) + : SfxDockingWindow(&rBindings_, pChildWindow, pParent, u"EditWindow"_ustr, + u"modules/smath/ui/editwindow.ui"_ustr) , m_xEdit(new SmEditWindow(*this, *m_xBuilder)) - , aController(*m_xEdit, SID_TEXT, *pBindings_) + , aController(*m_xEdit, SID_TEXT, rBindings_) , bExiting(false) , aInitialFocusTimer("SmCmdBoxWindow aInitialFocusTimer") { @@ -1149,7 +1150,7 @@ SmCmdBoxWrapper::SmCmdBoxWrapper(vcl::Window* pParentWindow, sal_uInt16 nId, Sfx SfxChildWinInfo& rInfo) : SfxChildWindow(pParentWindow, nId) { - VclPtrInstance pDialog(&rBindings, this, pParentWindow); + VclPtrInstance pDialog(rBindings, this, pParentWindow); SetWindow(pDialog); // make window docked to the bottom initially (after first start) SetAlignment(SfxChildAlignment::BOTTOM);