summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-09-19 20:50:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-20 08:56:03 +0200
commita64e503b77679d60997a2b6c69b7f1cd37aba5e9 (patch)
tree3123bc7b250e44f06d6948c5e8a3c3a52b21705e /sc
parent494358661a05ce548d09e51703f72cd2c012437b (diff)
no need to allocate these SfxItemSet on the heap
Change-Id: I2aa7f9e8f8bc93f7422acfaac2337087060d36a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122328 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/column2.cxx14
-rw-r--r--sc/source/core/data/documen2.cxx6
-rw-r--r--sc/source/core/data/documen8.cxx8
3 files changed, 14 insertions, 14 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index dfcce828e1e4..658a37b983d4 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -388,22 +388,22 @@ tools::Long ScColumn::GetNeededSize(
pDev->SetMapMode( aHMMMode );
pEngine->SetRefDevice( pDev );
rDocument.ApplyAsianEditSettings( *pEngine );
- std::unique_ptr<SfxItemSet> pSet(new SfxItemSet( pEngine->GetEmptyItemSet() ));
+ SfxItemSet aSet( pEngine->GetEmptyItemSet() );
if ( ScStyleSheet* pPreviewStyle = rDocument.GetPreviewCellStyle( nCol, nRow, nTab ) )
{
ScPatternAttr aPreviewPattern( *pPattern );
aPreviewPattern.SetStyleSheet(pPreviewStyle);
- aPreviewPattern.FillEditItemSet( pSet.get(), pCondSet );
+ aPreviewPattern.FillEditItemSet( &aSet, pCondSet );
}
else
{
SfxItemSet* pFontSet = rDocument.GetPreviewFont( nCol, nRow, nTab );
- pPattern->FillEditItemSet( pSet.get(), pFontSet ? pFontSet : pCondSet );
+ pPattern->FillEditItemSet( &aSet, pFontSet ? pFontSet : pCondSet );
}
// no longer needed, are set with the text (is faster)
// pEngine->SetDefaults( pSet );
- if ( pSet->Get(EE_PARA_HYPHENATE).GetValue() ) {
+ if ( aSet.Get(EE_PARA_HYPHENATE).GetValue() ) {
css::uno::Reference<css::linguistic2::XHyphenator> xXHyphenator( LinguMgr::GetHyphenator() );
pEngine->SetHyphenator( xXHyphenator );
@@ -456,7 +456,7 @@ tools::Long ScColumn::GetNeededSize(
if (aCell.meType == CELLTYPE_EDIT)
{
- pEngine->SetTextNewDefaults(*aCell.mpEditText, std::move(pSet));
+ pEngine->SetTextNewDefaults(*aCell.mpEditText, std::move(aSet));
}
else
{
@@ -467,9 +467,9 @@ tools::Long ScColumn::GetNeededSize(
rOptions.bFormula);
if (!aString.isEmpty())
- pEngine->SetTextNewDefaults(aString, std::move(pSet));
+ pEngine->SetTextNewDefaults(aString, std::move(aSet));
else
- pEngine->SetDefaults(std::move(pSet));
+ pEngine->SetDefaults(std::move(aSet));
}
bool bEngineVertical = pEngine->IsEffectivelyVertical();
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 8f77cb70ac46..dca102c16c89 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -478,9 +478,9 @@ ScNoteEditEngine& ScDocument::GetNoteEngine()
mpNoteEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM));
ApplyAsianEditSettings( *mpNoteEngine );
const SfxItemSet& rItemSet = GetDefPattern()->GetItemSet();
- std::unique_ptr<SfxItemSet> pEEItemSet(new SfxItemSet( mpNoteEngine->GetEmptyItemSet() ));
- ScPatternAttr::FillToEditItemSet( *pEEItemSet, rItemSet );
- mpNoteEngine->SetDefaults( std::move(pEEItemSet) ); // edit engine takes ownership
+ SfxItemSet aEEItemSet( mpNoteEngine->GetEmptyItemSet() );
+ ScPatternAttr::FillToEditItemSet( aEEItemSet, rItemSet );
+ mpNoteEngine->SetDefaults( std::move(aEEItemSet) ); // edit engine takes ownership
}
return *mpNoteEngine;
}
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 02148af2fdbd..1553c26c0f3e 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1250,19 +1250,19 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, Transliteratio
// defaults from cell attributes must be set so right language is used
const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab );
- std::unique_ptr<SfxItemSet> pDefaults(new SfxItemSet( pEngine->GetEmptyItemSet() ));
+ SfxItemSet aDefaults( pEngine->GetEmptyItemSet() );
if ( ScStyleSheet* pPreviewStyle = GetPreviewCellStyle( nCol, nRow, nTab ) )
{
ScPatternAttr aPreviewPattern( *pPattern );
aPreviewPattern.SetStyleSheet(pPreviewStyle);
- aPreviewPattern.FillEditItemSet( pDefaults.get() );
+ aPreviewPattern.FillEditItemSet( &aDefaults );
}
else
{
SfxItemSet* pFontSet = GetPreviewFont( nCol, nRow, nTab );
- pPattern->FillEditItemSet( pDefaults.get(), pFontSet );
+ pPattern->FillEditItemSet( &aDefaults, pFontSet );
}
- pEngine->SetDefaults( std::move(pDefaults) );
+ pEngine->SetDefaults( std::move(aDefaults) );
if (aCell.meType == CELLTYPE_STRING)
pEngine->SetTextCurrentDefaults(aCell.mpString->getString());
else if (aCell.mpEditText)