summaryrefslogtreecommitdiff
path: root/sd/source/ui/func
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-01 11:01:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-02 15:34:38 +0200
commit2024780f9e169a6c1d167e494d37f46f7640dc97 (patch)
tree2488052807d613f63f6afe9a624d8f8fddda674b /sd/source/ui/func
parentd656191ec308d4280b93c7169372e543a255d108 (diff)
can allocate these SfxItemSet on the stack
Change-Id: I85a749429a3a14aca5c6eaeaa5da37b25eb9f730 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118283 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/func')
-rw-r--r--sd/source/ui/func/fupage.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index 6d5fdbc896ec..32b98a08bf58 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -285,7 +285,7 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* pParent, const SfxRequest&
MergePageBackgroundFilling(mpPage, pStyleSheet, mbMasterPage, aMergedAttr);
}
- std::unique_ptr< SfxItemSet > pTempSet;
+ std::optional< SfxItemSet > pTempSet;
const sal_uInt16 nId = GetSlotID();
if (nId == SID_SAVE_BACKGROUND)
@@ -330,14 +330,14 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* pParent, const SfxRequest&
if (nError == ERRCODE_NONE)
{
- pTempSet.reset( new SfxItemSet( mpDoc->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}) );
+ pTempSet.emplace( mpDoc->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{} );
pTempSet->Put( XFillStyleItem( drawing::FillStyle_BITMAP ) );
// MigrateItemSet makes sure the XFillBitmapItem will have a unique name
SfxItemSet aMigrateSet( mpDoc->GetPool(), svl::Items<XATTR_FILLBITMAP, XATTR_FILLBITMAP>{} );
aMigrateSet.Put(XFillBitmapItem("background", aGraphic));
- SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), mpDoc );
+ SdrModel::MigrateItemSet( &aMigrateSet, &*pTempSet, mpDoc );
pTempSet->Put( XFillBmpStretchItem( true ));
pTempSet->Put( XFillBmpTileItem( false ));
@@ -352,7 +352,7 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* pParent, const SfxRequest&
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractTabDialog> pDlg( pFact->CreateSdTabPageDialog(mpViewShell->GetFrameWeld(), &aMergedAttr, mpDocSh, mbDisplayBackgroundTabPage, bIsImpressDoc) );
if( pDlg->Execute() == RET_OK )
- pTempSet.reset( new SfxItemSet(*pDlg->GetOutputItemSet()) );
+ pTempSet.emplace( *pDlg->GetOutputItemSet() );
}
if (pTempSet && pStyleSheet)
@@ -398,7 +398,7 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* pParent, const SfxRequest&
// MigrateItemSet guarantees unique gradient names
SfxItemSet aMigrateSet( mpDoc->GetPool(), svl::Items<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT>{} );
aMigrateSet.Put( XFillGradientItem("gradient", pTempGradItem->GetGradientValue()) );
- SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), mpDoc);
+ SdrModel::MigrateItemSet( &aMigrateSet, &*pTempSet, mpDoc);
}
const XFillHatchItem* pTempHatchItem = pTempSet->GetItem<XFillHatchItem>(XATTR_FILLHATCH);
@@ -407,7 +407,7 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* pParent, const SfxRequest&
// MigrateItemSet guarantees unique hatch names
SfxItemSet aMigrateSet( mpDoc->GetPool(), svl::Items<XATTR_FILLHATCH, XATTR_FILLHATCH>{} );
aMigrateSet.Put( XFillHatchItem("hatch", pTempHatchItem->GetHatchValue()) );
- SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), mpDoc);
+ SdrModel::MigrateItemSet( &aMigrateSet, &*pTempSet, mpDoc);
}
if( !mbMasterPage && bChanges && mbPageBckgrdDeleted )