From a81cc28ba6c416a70c1c9c6fa7060c1f81de8a9c Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 21 Jul 2026 12:54:05 +0200 Subject: [PATCH] sfx2: Pass SfxDockingWindow's SfxBindings param by ref With the refactoring from previous commits in place, it's clear that all callers pass a non-null SfxBindings* param. Switch the param to a reference, to make that clear and prepare for further refactoring. Change-Id: Id9f1487dba4b84860f9afa52ff9ffb4dd7b1d2c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208387 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- avmedia/source/framework/mediaplayer.cxx | 2 +- include/sfx2/dockwin.hxx | 15 ++++++--------- sd/source/ui/dlg/animobjs.cxx | 2 +- sd/source/ui/dlg/titledockwin.cxx | 2 +- .../devtools/DevelopmentToolDockingWindow.cxx | 2 +- sfx2/source/dialog/dockwin.cxx | 15 ++++++++------- sfx2/source/dialog/navigat.cxx | 2 +- sfx2/source/dialog/partwnd.cxx | 2 +- sfx2/source/dialog/quickfind.cxx | 2 +- sfx2/source/sidebar/SidebarDockingWindow.cxx | 2 +- starmath/source/view.cxx | 2 +- svx/source/dialog/_bmpmask.cxx | 2 +- svx/source/dialog/fontwork.cxx | 2 +- svx/source/engine3d/float3d.cxx | 2 +- svx/source/form/datanavi.cxx | 6 ++++-- svx/source/form/filtnav.cxx | 2 +- svx/source/form/fmexpl.cxx | 2 +- svx/source/tbxctrls/colrctrl.cxx | 2 +- 18 files changed, 33 insertions(+), 33 deletions(-) diff --git a/avmedia/source/framework/mediaplayer.cxx b/avmedia/source/framework/mediaplayer.cxx index 876806309222..84d0dc7a2f5a 100644 --- a/avmedia/source/framework/mediaplayer.cxx +++ b/avmedia/source/framework/mediaplayer.cxx @@ -50,7 +50,7 @@ MediaPlayer::~MediaPlayer() SFX_IMPL_DOCKINGWINDOW_WITHID( MediaPlayer, SID_AVMEDIA_PLAYER ) MediaFloater::MediaFloater(SfxBindings& rBindings, SfxChildWindow* pCW, vcl::Window* pParent) - : SfxDockingWindow(&rBindings, pCW, pParent, + : SfxDockingWindow(rBindings, pCW, pParent, WB_CLOSEABLE | WB_MOVEABLE | WB_SIZEABLE | WB_DOCKABLE) , mpMediaWindow(new MediaWindow(this, true)) { diff --git a/include/sfx2/dockwin.hxx b/include/sfx2/dockwin.hxx index 333bff44a59d..7baa5d86574d 100644 --- a/include/sfx2/dockwin.hxx +++ b/include/sfx2/dockwin.hxx @@ -73,15 +73,12 @@ protected: SAL_DLLPRIVATE SfxChildWindow* GetChildWindow_Impl() { return m_pMgr; } public: - SfxDockingWindow( SfxBindings *pBindings, - SfxChildWindow *pCW, - vcl::Window* pParent, - WinBits nWinBits); - SfxDockingWindow( SfxBindings *pBindings, - SfxChildWindow *pCW, - vcl::Window* pParent, - const OUString& rID, const OUString& rUIXMLDescription ); - virtual ~SfxDockingWindow() override; + SfxDockingWindow(SfxBindings& rBindings, SfxChildWindow* pCW, vcl::Window* pParent, + WinBits nWinBits); + SfxDockingWindow(SfxBindings& rBindings, SfxChildWindow* pCW, vcl::Window* pParent, + const OUString& rID, const OUString& rUIXMLDescription); + virtual ~SfxDockingWindow() override; + virtual void dispose() override; void Initialize(SfxChildWinInfo& rInfo); diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index 846ff7039c53..5a786374d6b9 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -121,7 +121,7 @@ void SdDisplay::SetDrawingArea(weld::DrawingArea* pDrawingArea) * AnimationWindow - FloatingWindow */ AnimationWindow::AnimationWindow(SfxBindings& rBindings, SfxChildWindow* pCW, vcl::Window* pParent) - : SfxDockingWindow(&rBindings, pCW, pParent, u"DockingAnimation"_ustr, + : SfxDockingWindow(rBindings, pCW, pParent, u"DockingAnimation"_ustr, u"modules/simpress/ui/dockinganimation.ui"_ustr) , m_xCtlDisplay(new SdDisplay) , m_xCtlDisplayWin(new weld::CustomWeld(*m_xBuilder, u"preview"_ustr, *m_xCtlDisplay)) diff --git a/sd/source/ui/dlg/titledockwin.cxx b/sd/source/ui/dlg/titledockwin.cxx index 1145848592b4..2d0ee2ec2c2c 100644 --- a/sd/source/ui/dlg/titledockwin.cxx +++ b/sd/source/ui/dlg/titledockwin.cxx @@ -37,7 +37,7 @@ namespace sd { //= TitledDockingWindow TitledDockingWindow::TitledDockingWindow(SfxBindings& rBindings, SfxChildWindow* i_pChildWindow, vcl::Window* i_pParent, const OUString& rsTitle ) - :SfxDockingWindow(&rBindings, i_pChildWindow, i_pParent, WB_MOVEABLE|WB_CLOSEABLE|WB_DOCKABLE|WB_HIDE|WB_3DLOOK ) + :SfxDockingWindow(rBindings, i_pChildWindow, i_pParent, WB_MOVEABLE|WB_CLOSEABLE|WB_DOCKABLE|WB_HIDE|WB_3DLOOK ) ,m_aToolbox( VclPtr::Create(this) ) ,m_aContentWindow( VclPtr::Create(this, WB_DIALOGCONTROL) ) ,m_aBorder( 3, 1, 3, 3 ) diff --git a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx index c30f5ef42c51..6101e18746d2 100644 --- a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx +++ b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx @@ -29,7 +29,7 @@ using namespace css; DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(SfxBindings& rBindings, SfxChildWindow* pChildWindow, vcl::Window* pParent) - : SfxDockingWindow(&rBindings, pChildWindow, pParent, u"DevelopmentTool"_ustr, + : SfxDockingWindow(rBindings, pChildWindow, pParent, u"DevelopmentTool"_ustr, u"sfx/ui/developmenttool.ui"_ustr) , mpObjectInspectorWidgets(new ObjectInspectorWidgets(m_xBuilder)) , mpDocumentModelTreeView(m_xBuilder->weld_tree_view(u"leftside_treeview_id"_ustr)) diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index 11beed0adbc9..2aeaf67fa5f0 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -231,7 +231,7 @@ SfxChildWinInfo SfxDockingWrapper::GetInfo() const SfxTitleDockingWindow::SfxTitleDockingWindow(SfxBindings& rBindings, SfxChildWindow* pChildWin, vcl::Window* pParent, WinBits nBits) - : SfxDockingWindow(&rBindings, pChildWin, pParent, nBits) + : SfxDockingWindow(rBindings, pChildWin, pParent, nBits) , m_pWrappedWindow(nullptr) { } @@ -754,10 +754,10 @@ void SfxDockingWindow::Resizing( Size& /*rSize*/ ) Constructor for the SfxDockingWindow class. A SfxChildWindow will be required because the docking is implemented in Sfx through SfxChildWindows. */ -SfxDockingWindow::SfxDockingWindow(SfxBindings* pBindinx, SfxChildWindow* pCW, vcl::Window* pParent, - WinBits nWinBits) +SfxDockingWindow::SfxDockingWindow(SfxBindings& rBindings, SfxChildWindow* pCW, + vcl::Window* pParent, WinBits nWinBits) : ResizableDockingWindow(pParent, nWinBits) - , m_pBindings(pBindinx) + , m_pBindings(&rBindings) , m_pMgr(pCW) { m_pImpl.reset(new SfxDockingWindow_Impl(this)); @@ -766,10 +766,11 @@ SfxDockingWindow::SfxDockingWindow(SfxBindings* pBindinx, SfxChildWindow* pCW, v /** Constructor for the SfxDockingWindow class. A SfxChildWindow will be required because the docking is implemented in Sfx through SfxChildWindows. */ -SfxDockingWindow::SfxDockingWindow(SfxBindings* pBindinx, SfxChildWindow* pCW, vcl::Window* pParent, - const OUString& rID, const OUString& rUIXMLDescription) +SfxDockingWindow::SfxDockingWindow(SfxBindings& rBindings, SfxChildWindow* pCW, + vcl::Window* pParent, const OUString& rID, + const OUString& rUIXMLDescription) : ResizableDockingWindow(pParent) - , m_pBindings(pBindinx) + , m_pBindings(&rBindings) , m_pMgr(pCW) { m_xBuilder = Application::CreateInterimBuilder(m_xBox, rUIXMLDescription, true); diff --git a/sfx2/source/dialog/navigat.cxx b/sfx2/source/dialog/navigat.cxx index 6a2471fee72e..70db333aa368 100644 --- a/sfx2/source/dialog/navigat.cxx +++ b/sfx2/source/dialog/navigat.cxx @@ -37,7 +37,7 @@ void SfxNavigatorWrapper::Initialize() SfxNavigator::SfxNavigator(SfxBindings& rBindings, SfxChildWindow* pChildWin, vcl::Window* pParent, SfxChildWinInfo& rInfo) - : SfxDockingWindow(&rBindings, pChildWin, pParent, u"Navigator"_ustr, + : SfxDockingWindow(rBindings, pChildWin, pParent, u"Navigator"_ustr, u"sfx/ui/navigator.ui"_ustr) { SetText(SfxResId(STR_SID_NAVIGATOR)); diff --git a/sfx2/source/dialog/partwnd.cxx b/sfx2/source/dialog/partwnd.cxx index a640d3e62250..51f8013bb27b 100644 --- a/sfx2/source/dialog/partwnd.cxx +++ b/sfx2/source/dialog/partwnd.cxx @@ -85,7 +85,7 @@ bool SfxPartChildWnd_Impl::QueryClose() SfxPartDockWnd_Impl::SfxPartDockWnd_Impl(SfxBindings& rBindings, SfxChildWindow* pChildWin, vcl::Window* pParent, WinBits nBits) - : SfxDockingWindow(&rBindings, pChildWin, pParent, nBits) + : SfxDockingWindow(rBindings, pChildWin, pParent, nBits) { css::uno::Reference < css::frame::XFrame2 > xFrame = css::frame::Frame::create( ::comphelper::getProcessComponentContext() ); diff --git a/sfx2/source/dialog/quickfind.cxx b/sfx2/source/dialog/quickfind.cxx index c9a283d574ac..c0131b603bf9 100644 --- a/sfx2/source/dialog/quickfind.cxx +++ b/sfx2/source/dialog/quickfind.cxx @@ -25,7 +25,7 @@ void SfxQuickFindWrapper::Initialize() { SetHideNotDelete(true); } SfxQuickFind::SfxQuickFind(SfxBindings& rBindings, SfxChildWindow* pChildWin, vcl::Window* pParent, SfxChildWinInfo& rInfo) - : SfxDockingWindow(&rBindings, pChildWin, pParent, u"QuickFind"_ustr, + : SfxDockingWindow(rBindings, pChildWin, pParent, u"QuickFind"_ustr, u"sfx/ui/quickfind.ui"_ustr) { SetText(SfxResId(STR_SID_QUICKFIND)); diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx index 2a8b05dca92f..187f9f50ad60 100644 --- a/sfx2/source/sidebar/SidebarDockingWindow.cxx +++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx @@ -43,7 +43,7 @@ namespace sfx2::sidebar { SidebarDockingWindow::SidebarDockingWindow(SfxBindings& rSfxBindings, SidebarChildWindow& rChildWindow, vcl::Window* pParentWindow, WinBits nBits) - : SfxDockingWindow(&rSfxBindings, &rChildWindow, pParentWindow, nBits) + : SfxDockingWindow(rSfxBindings, &rChildWindow, pParentWindow, nBits) , mbIsReadyToDrag(false) { // Get the XFrame from the bindings. diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 251cf9072a18..df35750d7455 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -957,7 +957,7 @@ void SmEditController::StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemStat /**************************************************************************/ SmCmdBoxWindow::SmCmdBoxWindow(SfxBindings& rBindings_, SfxChildWindow* pChildWindow, vcl::Window* pParent) - : SfxDockingWindow(&rBindings_, pChildWindow, pParent, u"EditWindow"_ustr, + : 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, rBindings_) diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index ab6b832baca8..f13ba089e379 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -351,7 +351,7 @@ SvxBmpMaskChildWindow::SvxBmpMaskChildWindow(vcl::Window* pParent_, sal_uInt16 n } SvxBmpMask::SvxBmpMask(SfxBindings& rBindings, SfxChildWindow* pCW, vcl::Window* pParent) - : SfxDockingWindow(&rBindings, pCW, pParent, u"DockingColorReplace"_ustr, + : SfxDockingWindow(rBindings, pCW, pParent, u"DockingColorReplace"_ustr, u"svx/ui/dockingcolorreplace.ui"_ustr) , m_xTbxPipette(m_xBuilder->weld_toolbar(u"toolbar"_ustr)) , m_xCtlPipette(new BmpColorWindow) diff --git a/svx/source/dialog/fontwork.cxx b/svx/source/dialog/fontwork.cxx index 2329b25ea4b3..b98d0f338c6c 100644 --- a/svx/source/dialog/fontwork.cxx +++ b/svx/source/dialog/fontwork.cxx @@ -175,7 +175,7 @@ SvxFontWorkChildWindow::SvxFontWorkChildWindow(vcl::Window* _pParent, sal_uInt16 // Floating Window to the attribution of text effects SvxFontWorkDialog::SvxFontWorkDialog(SfxBindings& rBindings, SfxChildWindow* pCW, vcl::Window* _pParent) - : SfxDockingWindow(&rBindings, pCW, _pParent, u"DockingFontwork"_ustr, + : SfxDockingWindow(rBindings, pCW, _pParent, u"DockingFontwork"_ustr, u"svx/ui/dockingfontwork.ui"_ustr) , m_rBindings(rBindings) , m_aInputIdle("SvxFontWorkDialog Input") diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index 75cdb292d61a..974e7583e657 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -84,7 +84,7 @@ namespace { } Svx3DWin::Svx3DWin(SfxBindings& rBindings, SfxChildWindow* pCW, vcl::Window* pParent) - : SfxDockingWindow(&rBindings, pCW, pParent, u"Docking3DEffects"_ustr, + : SfxDockingWindow(rBindings, pCW, pParent, u"Docking3DEffects"_ustr, u"svx/ui/docking3deffects.ui"_ustr) , m_xBtnGeo(m_xBuilder->weld_toggle_button(u"geometry"_ustr)) diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index 68152f1eb37e..6ca07ed5f005 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -2023,8 +2023,10 @@ namespace svxform } } - DataNavigator::DataNavigator(SfxBindings& rBindings, SfxChildWindow* _pMgr, vcl::Window* _pParent) - : SfxDockingWindow(&rBindings, _pMgr, _pParent, u"DataNavigator"_ustr, u"svx/ui/datanavigator.ui"_ustr) + DataNavigator::DataNavigator(SfxBindings& rBindings, SfxChildWindow* _pMgr, + vcl::Window* _pParent) + : SfxDockingWindow(rBindings, _pMgr, _pParent, u"DataNavigator"_ustr, + u"svx/ui/datanavigator.ui"_ustr) , SfxControllerItem(SID_FM_DATANAVIGATOR_CONTROL, rBindings) , m_xDataWin(new DataNavigatorWindow(this, *m_xBuilder, &rBindings)) { diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 1f370d45f4b0..bb470b810d8f 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1724,7 +1724,7 @@ void FmFilterNavigator::DeleteSelection() FmFilterNavigatorWin::FmFilterNavigatorWin(SfxBindings& rBindings, SfxChildWindow* _pMgr, vcl::Window* _pParent) - : SfxDockingWindow(&rBindings, _pMgr, _pParent, u"FilterNavigator"_ustr, + : SfxDockingWindow(rBindings, _pMgr, _pParent, u"FilterNavigator"_ustr, u"svx/ui/filternavigator.ui"_ustr) , SfxControllerItem(SID_FM_FILTER_NAVIGATOR_CONTROL, rBindings) , m_xNavigatorTree(new FmFilterNavigator(this, m_xBuilder->weld_tree_view(u"treeview"_ustr))) diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx index c8178ec4c773..b4cf0e9659dd 100644 --- a/svx/source/form/fmexpl.cxx +++ b/svx/source/form/fmexpl.cxx @@ -396,7 +396,7 @@ namespace svxform NavigatorFrame::NavigatorFrame(SfxBindings& rBindings, SfxChildWindow* _pMgr, vcl::Window* _pParent) - : SfxDockingWindow(&rBindings, _pMgr, _pParent, u"FormNavigator"_ustr, u"svx/ui/formnavigator.ui"_ustr) + : SfxDockingWindow(rBindings, _pMgr, _pParent, u"FormNavigator"_ustr, u"svx/ui/formnavigator.ui"_ustr) , SfxControllerItem(SID_FM_FMEXPLORER_CONTROL, rBindings) , m_xNavigatorTree(new NavigatorTree(m_xBuilder->weld_tree_view(u"treeview"_ustr))) { diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx index 013587de605e..4dcd89ba668c 100644 --- a/svx/source/tbxctrls/colrctrl.cxx +++ b/svx/source/tbxctrls/colrctrl.cxx @@ -180,7 +180,7 @@ constexpr sal_uInt16 gnRightSlot = SID_ATTR_LINE_COLOR; SvxColorDockingWindow::SvxColorDockingWindow(SfxBindings& rBindings, SfxChildWindow* pCW, vcl::Window* _pParent) - : SfxDockingWindow(&rBindings, pCW, _pParent, u"DockingColorWindow"_ustr, + : SfxDockingWindow(rBindings, pCW, _pParent, u"DockingColorWindow"_ustr, u"svx/ui/dockingcolorwindow.ui"_ustr) , m_pColorSet( new SvxColorValueSet_docking(m_xBuilder->weld_scrolled_window(u"valuesetwin"_ustr, true)))