summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
-rw-r--r--include/svx/svxdlg.hxx2
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx8
-rw-r--r--svx/source/dialog/imapwnd.cxx10
-rw-r--r--sw/source/ui/misc/glossary.cxx8
9 files changed, 29 insertions, 25 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 e3556334e6a3..46afb253ba6b 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1206,10 +1206,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();
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index aa73fb57e5c2..b92adec13b3d 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -418,7 +418,7 @@ public:
sal_uInt32 nResId )=0;
virtual VclPtr<SfxAbstractDialog> CreateCharMapDialog(weld::Window* pParent, const SfxItemSet& rAttr,
const css::uno::Reference<css::frame::XFrame>& rFrame) = 0;
- virtual VclPtr<SfxAbstractDialog> CreateEventConfigDialog(weld::Widget* pParent, const SfxItemSet& rAttr,
+ virtual VclPtr<SfxAbstractDialog> CreateEventConfigDialog(weld::Widget* pParent, std::unique_ptr<const SfxItemSet> xAttr,
const css::uno::Reference< css::frame::XFrame >& rFrame) = 0;
virtual VclPtr<AbstractSvxPostItDialog> CreateSvxPostItDialog(weld::Widget* pParent, const SfxItemSet& rCoreSet, bool bPrevNext = false) = 0;
virtual VclPtr<VclAbstractDialog> CreateSvxScriptOrgDialog(weld::Window* pParent, const OUString& rLanguage) override = 0;
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 53ca99000933..b24888e5c0f5 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -426,19 +426,19 @@ void ScDrawShell::ExecuteMacroAssign(SdrObject* pObj, weld::Window* pWin)
}
// create empty itemset for macro-dlg
- SfxItemSetFixed<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG> aItemSet(SfxGetpApp()->GetPool() );
- aItemSet.Put ( aItem );
+ auto xItemSet = std::make_unique<SfxItemSetFixed<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG>>( SfxGetpApp()->GetPool() );
+ xItemSet->Put ( aItem );
SfxEventNamesItem aNamesItem(SID_EVENTCONFIG);
aNamesItem.AddEvent( ScResId(RID_SCSTR_ONCLICK), OUString(), SvMacroItemId::OnClick );
- aItemSet.Put( aNamesItem );
+ xItemSet->Put( aNamesItem );
css::uno::Reference < css::frame::XFrame > xFrame;
if (GetViewShell())
xFrame = GetViewShell()->GetViewFrame().GetFrame().GetFrameInterface();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- VclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateEventConfigDialog( pWin, aItemSet, xFrame ));
+ VclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateEventConfigDialog( pWin, std::move(xItemSet), xFrame ));
pMacroDlg->StartExecuteAsync(
[this, pMacroDlg, pObj, pInfo] (sal_Int32 nResult) mutable -> void
{
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index 0de8de06a050..fc7b540b83a3 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -673,21 +673,21 @@ void IMapWindow::DoMacroAssign()
if ( !pSdrObj )
return;
- SfxItemSetFixed<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG>
- aSet(*pIMapPool);
+ auto xSet = std::make_unique<SfxItemSetFixed<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG>>
+ (*pIMapPool);
SfxEventNamesItem aNamesItem(SID_EVENTCONFIG);
aNamesItem.AddEvent( u"MouseOver"_ustr, u""_ustr, SvMacroItemId::OnMouseOver );
aNamesItem.AddEvent( u"MouseOut"_ustr, u""_ustr, SvMacroItemId::OnMouseOut );
- aSet.Put( aNamesItem );
+ xSet->Put( aNamesItem );
SvxMacroItem aMacroItem(SID_ATTR_MACROITEM);
IMapObject* pIMapObj = GetIMapObj( pSdrObj );
aMacroItem.SetMacroTable( pIMapObj->GetMacroTable() );
- aSet.Put( aMacroItem );
+ xSet->Put( aMacroItem );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- VclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateEventConfigDialog(GetDrawingArea(), aSet, mxDocumentFrame));
+ VclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateEventConfigDialog(GetDrawingArea(), std::move(xSet), mxDocumentFrame));
pMacroDlg->StartExecuteAsync(
[this, pMacroDlg, pIMapObj] (sal_Int32 nResult)->void
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 985c597efefa..85d6d52eb68b 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -633,7 +633,7 @@ IMPL_LINK(SwGlossaryDlg, MenuHdl, const OUString&, rItemIdent, void)
}
else if (rItemIdent == "macro")
{
- SfxItemSetFixed<RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG> aSet( m_pShell->GetAttrPool() );
+ auto xSet = std::make_unique<SfxItemSetFixed<RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG>>( m_pShell->GetAttrPool() );
SvxMacro aStart(OUString(), OUString(), STARBASIC);
SvxMacro aEnd(OUString(), OUString(), STARBASIC);
@@ -645,11 +645,11 @@ IMPL_LINK(SwGlossaryDlg, MenuHdl, const OUString&, rItemIdent, void)
if( aEnd.HasMacro() )
aItem.SetMacro( SvMacroItemId::SwEndInsGlossary, aEnd );
- aSet.Put( aItem );
- aSet.Put( SwMacroAssignDlg::AddEvents( MACASSGN_AUTOTEXT ) );
+ xSet->Put( aItem );
+ xSet->Put( SwMacroAssignDlg::AddEvents( MACASSGN_AUTOTEXT ) );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- VclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateEventConfigDialog(m_xDialog.get(), aSet,
+ VclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateEventConfigDialog(m_xDialog.get(), std::move(xSet),
m_pShell->GetView().GetViewFrame().GetFrame().GetFrameInterface() ));
if (pMacroDlg)
pMacroDlg->StartExecuteAsync(