summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-27 20:47:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-28 12:18:03 +0200
commit83fb7db6911aa77d713f3da0391b680e55563181 (patch)
treee54ce90695acf14f3a77ea4b2680997c22e55ae8 /dbaccess
parentfbfb57635b602b50cb22465047ae5bcdbef3dd0a (diff)
no need to allocate these SfxItemSet on the heap
use std::optional where the code needs to control the lifetime of the object explicitly Change-Id: Ia550ce051360f68911abc68c945a97d62a637b06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116291 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index fe28821bed62..03ad7038fc75 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -792,7 +792,7 @@ bool callColumnFormatDialog(weld::Widget* _pParent,
pPool->SetDefaultMetric( MapUnit::MapTwip ); // ripped, don't understand why
pPool->FreezeIdRanges(); // the same
- std::unique_ptr<SfxItemSet> pFormatDescriptor(new SfxItemSet(*pPool, aAttrMap));
+ std::optional<SfxItemSet> pFormatDescriptor(SfxItemSet(*pPool, aAttrMap));
// fill it
pFormatDescriptor->Put(SvxHorJustifyItem(_eJustify, SBA_ATTR_ALIGN_HOR_JUSTIFY));
bool bText = false;
@@ -818,7 +818,7 @@ bool callColumnFormatDialog(weld::Widget* _pParent,
}
{ // want the dialog to be destroyed before our set
- SbaSbAttrDlg aDlg(_pParent, pFormatDescriptor.get(), _pFormatter, _bHasFormat);
+ SbaSbAttrDlg aDlg(_pParent, &*pFormatDescriptor, _pFormatter, _bHasFormat);
if (RET_OK == aDlg.run())
{
// ItemSet->UNO