summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-08-01 10:58:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-08-01 13:10:07 +0200
commit514d7384470434a0b0b119e369ff615e2a1499c9 (patch)
tree58fd31b3883f82fa875d53197eb0b08d5808dbc8 /cui/source
parentfe727997949d94cda5e867b7d2f3cb68f7b3a4b8 (diff)
tdf#161968 UI Assign macro to shape crashes CALC
regression from commit f690e8218a74a0f7792407a1d46198883d2528ff Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Tue Jan 23 13:24:29 2024 +0200 make event config dialog async Change-Id: Ie68aeb1171831da3b457afd945ccaaa248e652af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171370 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/dialogs/hltpbase.cxx6
-rw-r--r--cui/source/factory/dlgfact.cxx4
-rw-r--r--cui/source/factory/dlgfact.hxx2
-rw-r--r--cui/source/inc/macroass.hxx4
-rw-r--r--cui/source/tabpages/macroass.cxx10
5 files changed, 15 insertions, 11 deletions
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 9ac9be2baf8b..854c3aa6d3d7 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -334,12 +334,12 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl, weld::Button&, voi
aItem.SetMacroTable( *pMacroTbl );
// create empty itemset for macro-dlg
- SfxItemSetFixed<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM> aItemSet( SfxGetpApp()->GetPool() );
- aItemSet.Put ( aItem );
+ auto xItemSet = std::make_unique<SfxItemSetFixed<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM>>( SfxGetpApp()->GetPool() );
+ xItemSet->Put( aItem );
DisableClose( true );
- SfxMacroAssignDlg aDlg(mpDialog->getDialog(), mxDocumentFrame, aItemSet);
+ SfxMacroAssignDlg aDlg(mpDialog->getDialog(), mxDocumentFrame, std::move(xItemSet));
// add events
SfxMacroTabPage *pMacroPage = aDlg.GetTabPage();
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index ffb2ee562c10..4e8a2dab3c5a 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1212,10 +1212,10 @@ VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateCharMapDialog(weld::
}
VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateEventConfigDialog(weld::Widget* pParent,
- const SfxItemSet& rAttr,
+ std::unique_ptr<const SfxItemSet> xAttr,
const Reference< XFrame >& rDocumentFrame)
{
- return VclPtr<CuiAbstractSingleTabController_Impl>::Create(std::make_unique<SfxMacroAssignDlg>(pParent, rDocumentFrame, rAttr));
+ return VclPtr<CuiAbstractSingleTabController_Impl>::Create(std::make_unique<SfxMacroAssignDlg>(pParent, rDocumentFrame, std::move(xAttr)));
}
VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateSfxDialog(weld::Window* pParent,
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index ca11ec7427dc..b1c82104c7a0 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -444,7 +444,7 @@ public:
const SfxItemSet& rAttr,
const css::uno::Reference< css::frame::XFrame >& rFrame) override;
virtual VclPtr<SfxAbstractDialog> CreateEventConfigDialog(weld::Widget* pParent,
- const SfxItemSet& rAttr,
+ std::unique_ptr<const SfxItemSet> xAttr,
const css::uno::Reference< css::frame::XFrame >& rFrame) override;
virtual VclPtr<VclAbstractDialog> CreateFrameDialog(weld::Window* pParent, const css::uno::Reference< css::frame::XFrame >& rxFrame,
sal_uInt32 nResId, sal_uInt16 nPageId, const OUString& rParameter) override;
diff --git a/cui/source/inc/macroass.hxx b/cui/source/inc/macroass.hxx
index ba3c1de11717..3142cb4068ef 100644
--- a/cui/source/inc/macroass.hxx
+++ b/cui/source/inc/macroass.hxx
@@ -80,11 +80,13 @@ class SfxMacroAssignDlg : public SfxSingleTabDialogController
public:
SfxMacroAssignDlg(weld::Widget* pParent,
const css::uno::Reference< css::frame::XFrame >& rxDocumentFrame,
- const SfxItemSet& rSet);
+ std::unique_ptr<const SfxItemSet> xSet);
SfxMacroTabPage* GetTabPage()
{
return static_cast<SfxMacroTabPage*>(m_xSfxPage.get());
}
+private:
+ std::unique_ptr<const SfxItemSet> mxItemSet;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index 9da8e8ce83fe..c0442e7fceaa 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -387,11 +387,13 @@ std::unique_ptr<SfxTabPage> SfxMacroTabPage::Create(weld::Container* pPage, weld
}
SfxMacroAssignDlg::SfxMacroAssignDlg(weld::Widget* pParent,
- const Reference< XFrame >& rxDocumentFrame, const SfxItemSet& rSet)
- : SfxSingleTabDialogController(pParent, &rSet,u"cui/ui/eventassigndialog.ui"_ustr,
- u"EventAssignDialog"_ustr)
+ const Reference< XFrame >& rxDocumentFrame, std::unique_ptr<const SfxItemSet> xSet)
+ : SfxSingleTabDialogController(pParent, nullptr, u"cui/ui/eventassigndialog.ui"_ustr,
+ u"EventAssignDialog"_ustr),
+ mxItemSet(std::move(xSet))
{
- std::unique_ptr<SfxMacroTabPage> xPage = CreateSfxMacroTabPage(get_content_area(), this, rSet);
+ SetInputSet(mxItemSet.get());
+ std::unique_ptr<SfxMacroTabPage> xPage = CreateSfxMacroTabPage(get_content_area(), this, *mxItemSet);
xPage->SetFrame(rxDocumentFrame);
SetTabPage(std::move(xPage));
GetTabPage()->LaunchFillGroup();