From a9ff204b12618cc2e5f2a43f65d31322c3378715 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 21 Jul 2026 12:06:43 +0200 Subject: [PATCH] svx: Pass SvxBmpMask's SfxBindings param by ref That makes clear it's non-null and therefore the unconditional dereferencing done previously was unproblematic. Change-Id: I85e5f1a226396865cc6a835bc63170ccfc479162 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208379 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- include/svx/bmpmask.hxx | 3 +-- svx/source/dialog/_bmpmask.cxx | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/svx/bmpmask.hxx b/include/svx/bmpmask.hxx index bf146831d6b0..db62f5b2711f 100644 --- a/include/svx/bmpmask.hxx +++ b/include/svx/bmpmask.hxx @@ -148,8 +148,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBmpMask final : public SfxDockingWindow const Color& rColor ); public: - - SvxBmpMask(SfxBindings *pBindinx, SfxChildWindow *pCW, vcl::Window* pParent); + SvxBmpMask(SfxBindings& rBindings, SfxChildWindow* pCW, vcl::Window* pParent); virtual ~SvxBmpMask() override; virtual void dispose() override; diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index 7144957d52f6..ab6b832baca8 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -343,15 +343,15 @@ SvxBmpMaskChildWindow::SvxBmpMaskChildWindow(vcl::Window* pParent_, sal_uInt16 n SfxBindings& rBindings, SfxChildWinInfo& rInfo) : SfxChildWindow(pParent_, nId) { - VclPtr pDlg = VclPtr::Create(&rBindings, this, pParent_); + VclPtr pDlg = VclPtr::Create(rBindings, this, pParent_); SetWindow( pDlg ); pDlg->Initialize(rInfo); } -SvxBmpMask::SvxBmpMask(SfxBindings *pBindinx, SfxChildWindow *pCW, vcl::Window* pParent) - : SfxDockingWindow(pBindinx, pCW, pParent, u"DockingColorReplace"_ustr, +SvxBmpMask::SvxBmpMask(SfxBindings& rBindings, SfxChildWindow* pCW, vcl::Window* pParent) + : 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) @@ -379,9 +379,9 @@ SvxBmpMask::SvxBmpMask(SfxBindings *pBindinx, SfxChildWindow *pCW, vcl::Window* , m_xLbColor4(new ColorListBox(m_xBuilder->weld_menu_button(u"color4"_ustr), [this]{ return GetFrameWeld(); })) , m_xCbxTrans(m_xBuilder->weld_check_button(u"cbx5"_ustr)) , m_xLbColorTrans(new ColorListBox(m_xBuilder->weld_menu_button(u"color5"_ustr), [this]{ return GetFrameWeld(); })) - , m_xData(new MaskData(this, *pBindinx)) + , m_xData(new MaskData(this, rBindings)) , m_aPipetteColor(COL_WHITE) - , m_aSelItem(*this, *pBindinx) + , m_aSelItem(*this, rBindings) { SetText(SvxResId(RID_SVXDLG_BMPMASK_STR_TITLE));