cui/qa/unit/cui-dialogs-test.cxx | 3 +-- cui/source/dialogs/sdrcelldlg.cxx | 6 +++--- cui/source/factory/dlgfact.cxx | 4 ++-- cui/source/factory/dlgfact.hxx | 2 +- cui/source/inc/sdrcelldlg.hxx | 2 +- include/svx/svxdlg.hxx | 2 +- sd/source/ui/table/TableDesignPane.cxx | 2 +- svx/source/table/tablecontroller.cxx | 2 +- 8 files changed, 11 insertions(+), 12 deletions(-)
New commits: commit 968428500501e247529ab998af0f8a1921782b0b Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Jul 1 20:01:26 2023 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Jul 2 15:51:06 2023 +0200 pAttr is always dereferenced, use a reference instead of a pointer Change-Id: I76ebce9085b9e47a6c571ddbcafa44d0d3a0f97f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153850 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/cui/qa/unit/cui-dialogs-test.cxx b/cui/qa/unit/cui-dialogs-test.cxx index cf8c302fc209..ac6344fad0ca 100644 --- a/cui/qa/unit/cui-dialogs-test.cxx +++ b/cui/qa/unit/cui-dialogs-test.cxx @@ -69,8 +69,7 @@ VclPtr<VclAbstractDialog> CuiDialogsTest::createDialogByID(sal_uInt32 nID) { case 0: // "cui/ui/formatcellsdialog.ui" { - pReturnDialog - = mpFact->CreateSvxFormatCellsDialog(nullptr, mxAttr.get(), *mxModel, true); + pReturnDialog = mpFact->CreateSvxFormatCellsDialog(nullptr, *mxAttr, *mxModel, true); break; } diff --git a/cui/source/dialogs/sdrcelldlg.cxx b/cui/source/dialogs/sdrcelldlg.cxx index c5c4d22e162c..6b10e5c688e3 100644 --- a/cui/source/dialogs/sdrcelldlg.cxx +++ b/cui/source/dialogs/sdrcelldlg.cxx @@ -28,9 +28,9 @@ #include <svx/svxids.hrc> #include <svx/dialogs.hrc> -SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel, bool bStyle) - : SfxTabDialogController(pParent, "cui/ui/formatcellsdialog.ui", "FormatCellsDialog", pAttr, bStyle) - , mrOutAttrs(*pAttr) +SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet& rAttr, const SdrModel& rModel, bool bStyle) + : SfxTabDialogController(pParent, "cui/ui/formatcellsdialog.ui", "FormatCellsDialog", &rAttr, bStyle) + , mrOutAttrs(rAttr) , mpColorTab(rModel.GetColorList()) , mnColorTabState ( ChangeType::NONE ) , mpGradientList(rModel.GetGradientList()) diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 265a9058317a..303467ba51d1 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1440,9 +1440,9 @@ VclPtr<SfxAbstractLinksDialog> AbstractDialogFactory_Impl::CreateLinksDialog(wel return VclPtr<AbstractLinksDialog_Impl>::Create(std::move(xLinkDlg)); } -VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel, bool bStyle) +VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet& rAttr, const SdrModel& rModel, bool bStyle) { - return VclPtr<CuiAbstractTabController_Impl>::Create(std::make_shared<SvxFormatCellsDialog>(pParent, pAttr, rModel, bStyle)); + return VclPtr<CuiAbstractTabController_Impl>::Create(std::make_shared<SvxFormatCellsDialog>(pParent, rAttr, rModel, bStyle)); } VclPtr<SvxAbstractSplitTableDialog> AbstractDialogFactory_Impl::CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, tools::Long nMaxVertical) diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 701082585589..900013184ddd 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -577,7 +577,7 @@ public: const sal_uInt16 _nInitiallySelectedEvent ) override; - virtual VclPtr<SfxAbstractTabDialog> CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel, bool bStyle) override; + virtual VclPtr<SfxAbstractTabDialog> CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet& rAttr, const SdrModel& rModel, bool bStyle) override; virtual VclPtr<SvxAbstractSplitTableDialog> CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, tools::Long nMaxVertical) override; diff --git a/cui/source/inc/sdrcelldlg.hxx b/cui/source/inc/sdrcelldlg.hxx index aac8d982b454..46f34c0dae28 100644 --- a/cui/source/inc/sdrcelldlg.hxx +++ b/cui/source/inc/sdrcelldlg.hxx @@ -38,7 +38,7 @@ private: XPatternListRef mpPatternList; public: - SvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel, bool bStyle); + SvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet& rAttr, const SdrModel& rModel, bool bStyle); virtual void PageCreated(const OUString& rId, SfxTabPage &rPage) override; diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx index d361c6800dca..3ac7ac86d008 100644 --- a/include/svx/svxdlg.hxx +++ b/include/svx/svxdlg.hxx @@ -437,7 +437,7 @@ public: const sal_uInt16 _nInitiallySelectedEvent ) = 0; - virtual VclPtr<SfxAbstractTabDialog> CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel, bool bStyle)=0; + virtual VclPtr<SfxAbstractTabDialog> CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet& rAttr, const SdrModel& rModel, bool bStyle)=0; virtual VclPtr<SvxAbstractSplitTableDialog> CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, tools::Long nMaxVertical) = 0; diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index c5f20588397b..5d4d50e3d68a 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -382,7 +382,7 @@ void TableDesignWidget::EditStyle(const OUString& rCommand) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSvxFormatCellsDialog( - mrBase.GetFrameWeld(), &aNewAttr, mrBase.GetDrawView()->GetModel(), true) : nullptr); + mrBase.GetFrameWeld(), aNewAttr, mrBase.GetDrawView()->GetModel(), true) : nullptr); if (pDlg && pDlg->Execute() == RET_OK) { endTextEditForStyle(xTableStyle); diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index af11e5c875f7..5b3ffd156ee0 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -958,7 +958,7 @@ void SvxTableController::onFormatTable(const SfxRequest& rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); VclPtr<SfxAbstractTabDialog> xDlg( pFact->CreateSvxFormatCellsDialog( rReq.GetFrameWeld(), - &aNewAttr, + aNewAttr, rModel, false) ); // Even Cancel Button is returning positive(101) value,