diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-09 14:44:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-10 08:16:31 +0200 |
commit | c302027510adb13a2d34d863e417460375588c4b (patch) | |
tree | 753aaebad792666c75602a901e6ae336975e410f /sc/source/ui/view/output2.cxx | |
parent | b2ea5031386d773f797b3f8cf8035ba5680db813 (diff) |
pass SfxItemSet by unique_ptr to ScEditEngineDefaulter
Change-Id: I2bcfb87f687355a66a8a855b2858220cf1fefd39
Reviewed-on: https://gerrit.libreoffice.org/72043
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/view/output2.cxx')
-rw-r--r-- | sc/source/ui/view/output2.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 3aaaaccd4f15..ab88adfc265c 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -2406,8 +2406,8 @@ void ScOutputData::DrawEditParam::setPatternToEngine(bool bUseStyleColor) bool bCellContrast = bUseStyleColor && Application::GetSettings().GetStyleSettings().GetHighContrastMode(); - SfxItemSet* pSet = new SfxItemSet( mpEngine->GetEmptyItemSet() ); - mpPattern->FillEditItemSet( pSet, mpCondSet ); + auto pSet = std::make_unique<SfxItemSet>( mpEngine->GetEmptyItemSet() ); + mpPattern->FillEditItemSet( pSet.get(), mpCondSet ); if ( mpPreviewFontSet ) { const SfxPoolItem* pItem; @@ -2424,7 +2424,8 @@ void ScOutputData::DrawEditParam::setPatternToEngine(bool bUseStyleColor) pSet->Put(*pItem); } } - mpEngine->SetDefaults( pSet ); + bool bParaHyphenate = pSet->Get(EE_PARA_HYPHENATE).GetValue(); + mpEngine->SetDefaults( std::move(pSet) ); mpOldPattern = mpPattern; mpOldCondSet = mpCondSet; mpOldPreviewFontSet = mpPreviewFontSet; @@ -2436,7 +2437,7 @@ void ScOutputData::DrawEditParam::setPatternToEngine(bool bUseStyleColor) nControl &= ~EEControlBits::ONECHARPERLINE; mpEngine->SetControlWord( nControl ); - if ( !mbHyphenatorSet && pSet->Get(EE_PARA_HYPHENATE).GetValue() ) + if ( !mbHyphenatorSet && bParaHyphenate ) { // set hyphenator the first time it is needed css::uno::Reference<css::linguistic2::XHyphenator> xXHyphenator( LinguMgr::GetHyphenator() ); @@ -4573,8 +4574,8 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) // StringDiffer doesn't look at hyphenate, language items if ( pPattern != pOldPattern || pCondSet != pOldCondSet ) { - SfxItemSet* pSet = new SfxItemSet( pEngine->GetEmptyItemSet() ); - pPattern->FillEditItemSet( pSet, pCondSet ); + auto pSet = std::make_unique<SfxItemSet>( pEngine->GetEmptyItemSet() ); + pPattern->FillEditItemSet( pSet.get(), pCondSet ); // adjustment for EditEngine SvxAdjust eSvxAdjust = SvxAdjust::Left; @@ -4583,7 +4584,8 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) // adjustment for bBreak is omitted here pSet->Put( SvxAdjustItem( eSvxAdjust, EE_PARA_JUST ) ); - pEngine->SetDefaults( pSet ); + bool bParaHyphenate = pSet->Get(EE_PARA_HYPHENATE).GetValue(); + pEngine->SetDefaults( std::move(pSet) ); pOldPattern = pPattern; pOldCondSet = pCondSet; @@ -4594,7 +4596,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) nControl &= ~EEControlBits::ONECHARPERLINE; pEngine->SetControlWord( nControl ); - if ( !bHyphenatorSet && pSet->Get(EE_PARA_HYPHENATE).GetValue() ) + if ( !bHyphenatorSet && bParaHyphenate ) { // set hyphenator the first time it is needed css::uno::Reference<css::linguistic2::XHyphenator> xXHyphenator( LinguMgr::GetHyphenator() ); |