sd/inc/sdabstdlg.hxx | 2 +- sd/qa/unit/dialogs-test.cxx | 4 ++-- sd/source/ui/dlg/sddlgfact.cxx | 4 ++-- sd/source/ui/dlg/sddlgfact.hxx | 2 +- sd/source/ui/dlg/tpaction.cxx | 6 +++--- sd/source/ui/func/fuoaprms.cxx | 4 ++-- sd/source/ui/inc/tpaction.hxx | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-)
New commits: commit 372060b8a3d74c854dff7abe24eed5856a9ce3d4 Author: Caolán McNamara <[email protected]> AuthorDate: Sun Aug 18 21:15:42 2024 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Aug 19 15:14:50 2024 +0200 pAttr is always dereferenced, use a reference here Change-Id: I183a522704d0fbe2ba2907e75e8794621e94c178 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172022 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx index 594602af2589..924caf904b17 100644 --- a/sd/inc/sdabstdlg.hxx +++ b/sd/inc/sdabstdlg.hxx @@ -177,7 +177,7 @@ public: virtual VclPtr<SfxAbstractTabDialog> CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) = 0; virtual VclPtr<AbstractSdPresLayoutDlg> CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, const SfxItemSet& rInAttrs) = 0; virtual VclPtr<SfxAbstractTabDialog> CreateSdTabTemplateDlg(weld::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView) = 0; - virtual VclPtr<SfxAbstractDialog> CreatSdActionDialog(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) = 0; + virtual VclPtr<SfxAbstractDialog> CreatSdActionDialog(weld::Window* pParent, const SfxItemSet& rAttr, ::sd::View* pView) = 0; virtual VclPtr<AbstractSdVectorizeDlg> CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell) = 0; virtual VclPtr<VclAbstractDialog> CreateMasterLayoutDialog(weld::Window* pParent, SdDrawDocument* pDoc, SdPage*) = 0; diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx index e709d8a235c0..bebbb2629341 100644 --- a/sd/qa/unit/dialogs-test.cxx +++ b/sd/qa/unit/dialogs-test.cxx @@ -473,7 +473,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID) } case 17: { - // CreatSdActionDialog(const SfxItemSet* pAttr, ::sd::View* pView) override; + // CreatSdActionDialog(const SfxItemSet& rAttr, ::sd::View* pView) override; SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc(); CPPUNIT_ASSERT(pDrawDoc); SfxItemSet aSet(pDrawDoc->GetItemPool(), svl::Items<ATTR_ANIMATION_START, ATTR_ACTION_END>); @@ -495,7 +495,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID) aSet.Put(SfxBoolItem(ATTR_ACTION_PLAYFULL, false)); pRetval = getSdAbstractDialogFactory()->CreatSdActionDialog( getViewShell()->GetFrameWeld(), - &aSet, + aSet, getDrawView()); break; } diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx index 661e9e57204c..921bcba1f88f 100644 --- a/sd/source/ui/dlg/sddlgfact.cxx +++ b/sd/source/ui/dlg/sddlgfact.cxx @@ -667,9 +667,9 @@ VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdTabTemplateD return VclPtr<SdAbstractTabController_Impl>::Create(std::make_shared<SdTabTemplateDlg>(pParent, pDocShell, rStyleBase, pModel, pView)); } -VclPtr<SfxAbstractDialog> SdAbstractDialogFactory_Impl::CreatSdActionDialog(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView ) +VclPtr<SfxAbstractDialog> SdAbstractDialogFactory_Impl::CreatSdActionDialog(weld::Window* pParent, const SfxItemSet& rAttr, ::sd::View* pView ) { - return VclPtr<SdAbstractSfxDialog_Impl>::Create(std::make_unique<SdActionDlg>(pParent, pAttr, pView)); + return VclPtr<SdAbstractSfxDialog_Impl>::Create(std::make_unique<SdActionDlg>(pParent, rAttr, pView)); } VclPtr<AbstractSdVectorizeDlg> SdAbstractDialogFactory_Impl::CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell) diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx index 6697d437a666..af494244739d 100644 --- a/sd/source/ui/dlg/sddlgfact.hxx +++ b/sd/source/ui/dlg/sddlgfact.hxx @@ -407,7 +407,7 @@ public: virtual VclPtr<SfxAbstractTabDialog> CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) override; virtual VclPtr<AbstractSdPresLayoutDlg> CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, const SfxItemSet& rInAttrs) override; virtual VclPtr<SfxAbstractTabDialog> CreateSdTabTemplateDlg(weld::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView ) override; - virtual VclPtr<SfxAbstractDialog> CreatSdActionDialog(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) override; + virtual VclPtr<SfxAbstractDialog> CreatSdActionDialog(weld::Window* pParent, const SfxItemSet& rAttr, ::sd::View* pView) override; virtual VclPtr<AbstractSdVectorizeDlg> CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell) override; virtual VclPtr<VclAbstractDialog> CreateSdPhotoAlbumDialog(weld::Window* pWindow, SdDrawDocument* pDoc) override; diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index ef31f2e71ff3..8f3db490d4eb 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -68,12 +68,12 @@ constexpr OUStringLiteral pStarDrawXMLContent( u"content.xml" ); /** * Constructor of the Tab dialog: appends the pages to the dialog */ -SdActionDlg::SdActionDlg(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View const * pView) - : SfxSingleTabDialogController(pParent, pAttr, u"modules/simpress/ui/interactiondialog.ui"_ustr, +SdActionDlg::SdActionDlg(weld::Window* pParent, const SfxItemSet& rAttr, ::sd::View const * pView) + : SfxSingleTabDialogController(pParent, &rAttr, u"modules/simpress/ui/interactiondialog.ui"_ustr, u"InteractionDialog"_ustr) , m_xContent(m_xBuilder->weld_container(u"content"_ustr)) { - std::unique_ptr<SfxTabPage> xNewPage = SdTPAction::Create(m_xContent.get(), this, *pAttr); + std::unique_ptr<SfxTabPage> xNewPage = SdTPAction::Create(m_xContent.get(), this, rAttr); // formerly in PageCreated static_cast<SdTPAction*>( xNewPage.get() )->SetView( pView ); diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx index 976defe90259..95ddea361627 100644 --- a/sd/source/ui/func/fuoaprms.cxx +++ b/sd/source/ui/func/fuoaprms.cxx @@ -446,7 +446,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) rReq.Ignore(); // the 'old' request is not relevant any more SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - VclPtr<SfxAbstractDialog> pDlg( pFact->CreatSdActionDialog(mpViewShell->GetFrameWeld(), &*aSet, mpView) ); + VclPtr<SfxAbstractDialog> pDlg( pFact->CreatSdActionDialog(mpViewShell->GetFrameWeld(), *aSet, mpView) ); rtl::Reference<FuObjectAnimationParameters> xThis( this ); // avoid destruction within async processing pDlg->StartExecuteAsync([pDlg, xThis, xRequest=std::move(xRequest), aSet](sal_Int32 nResult){ if (nResult == RET_OK) { diff --git a/sd/source/ui/inc/tpaction.hxx b/sd/source/ui/inc/tpaction.hxx index d2d370602716..f45776548801 100644 --- a/sd/source/ui/inc/tpaction.hxx +++ b/sd/source/ui/inc/tpaction.hxx @@ -40,7 +40,7 @@ class SdActionDlg final : public SfxSingleTabDialogController { std::unique_ptr<weld::Container> m_xContent; public: - SdActionDlg(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View const * pView); + SdActionDlg(weld::Window* pParent, const SfxItemSet& rAttr, ::sd::View const * pView); }; /** commit fe2c7f209b0ecfcf81ba775bd39cd355af2a64df Author: Caolán McNamara <[email protected]> AuthorDate: Sun Aug 18 21:10:52 2024 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Aug 19 15:14:38 2024 +0200 cid#1616525 COPY_INSTEAD_OF_MOVE Change-Id: I508df311ec1785be11077c1f657be57b84ed8cfa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172021 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx index f90354e2b601..976defe90259 100644 --- a/sd/source/ui/func/fuoaprms.cxx +++ b/sd/source/ui/func/fuoaprms.cxx @@ -448,7 +448,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); VclPtr<SfxAbstractDialog> pDlg( pFact->CreatSdActionDialog(mpViewShell->GetFrameWeld(), &*aSet, mpView) ); rtl::Reference<FuObjectAnimationParameters> xThis( this ); // avoid destruction within async processing - pDlg->StartExecuteAsync([pDlg, xThis, xRequest, aSet](sal_Int32 nResult){ + pDlg->StartExecuteAsync([pDlg, xThis, xRequest=std::move(xRequest), aSet](sal_Int32 nResult){ if (nResult == RET_OK) { xThis->Finish(xRequest, pDlg); }
