From 83fb7db6911aa77d713f3da0391b680e55563181 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 27 May 2021 20:47:06 +0200 Subject: 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 --- dbaccess/source/ui/misc/UITools.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dbaccess') 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 pFormatDescriptor(new SfxItemSet(*pPool, aAttrMap)); + std::optional 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 -- cgit