summaryrefslogtreecommitdiff
path: root/sc/source/ui/app/inputhdl.cxx
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 /sc/source/ui/app/inputhdl.cxx
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 'sc/source/ui/app/inputhdl.cxx')
-rw-r--r--sc/source/ui/app/inputhdl.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index a8bf4a39e8f9..f01f93d46d70 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3088,7 +3088,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
// Find common (cell) attributes before RemoveAdjust
if ( pActiveViewSh && bUniformAttribs )
{
- std::unique_ptr<SfxItemSet> pCommonAttrs;
+ std::optional<SfxItemSet> pCommonAttrs;
for (sal_uInt16 nId = EE_CHAR_START; nId <= EE_CHAR_END; nId++)
{
SfxItemState eState = aOldAttribs.GetItemState( nId, false, &pItem );
@@ -3098,7 +3098,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
*pItem != pEditDefaults->Get(nId) )
{
if ( !pCommonAttrs )
- pCommonAttrs.reset(new SfxItemSet( mpEditEngine->GetEmptyItemSet() ));
+ pCommonAttrs.emplace( mpEditEngine->GetEmptyItemSet() );
pCommonAttrs->Put( *pItem );
}
}
@@ -3107,7 +3107,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
{
ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocument();
pCellAttrs = std::make_unique<ScPatternAttr>(rDoc.GetPool());
- pCellAttrs->GetFromEditItemSet( pCommonAttrs.get() );
+ pCellAttrs->GetFromEditItemSet( &*pCommonAttrs );
}
}