diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-30 15:10:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-30 18:03:06 +0200 |
commit | 738f7a8cb971a884f74766da0cbf7e59ef8b90e7 (patch) | |
tree | 79775212880433f4e7e860bf0efef57baf9f24c8 /sd/source | |
parent | cf15c4dad74e31a035c0d1ca899dfbef4da90ad2 (diff) |
reduce cost of allocating and copying SvxNumRule
by using std::move to avoid copying unnecessarily
Change-Id: I940b57c9a05c8d75b9a16291fc4f05756fdeea12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118164
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/core/drawdoc4.cxx | 2 | ||||
-rw-r--r-- | sd/source/core/stlpool.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/dlg/dlgolbul.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fuolbull.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drtxtob1.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/viewshel.cxx | 2 |
7 files changed, 9 insertions, 9 deletions
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index e3d7080f953b..e078afc58b54 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -1268,7 +1268,7 @@ void SdDrawDocument::SetTextDefaults() const aNumRule.SetLevel( i, aNumberFormat ); } - SvxNumBulletItem aNumBulletItem( aNumRule, EE_PARA_NUMBULLET ); + SvxNumBulletItem aNumBulletItem( std::move(aNumRule), EE_PARA_NUMBULLET ); m_pItemPool->SetPoolDefaultItem( aNumBulletItem ); } diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index d6256bd6f9ae..d15aaf632b04 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -1095,7 +1095,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet, aNumRule.SetLevel( i, aNumberFormat ); } - rSet.Put( SvxNumBulletItem( aNumRule, EE_PARA_NUMBULLET ) ); + rSet.Put( SvxNumBulletItem( std::move(aNumRule), EE_PARA_NUMBULLET ) ); static_cast<SfxStyleSheet*>(pSheet)->Broadcast(SfxHint( SfxHintId::DataChanged ) ); } break; @@ -1127,7 +1127,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet, aNumRule.SetLevel(i, aFrmt); } - rSet.Put( SvxNumBulletItem( aNumRule, EE_PARA_NUMBULLET ) ); + rSet.Put( SvxNumBulletItem( std::move(aNumRule), EE_PARA_NUMBULLET ) ); static_cast<SfxStyleSheet*>(pSheet)->Broadcast(SfxHint( SfxHintId::DataChanged ) ); } } @@ -1151,7 +1151,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet, aNumRule.SetLevel( i, aNumberFormat ); } - rSet.Put( SvxNumBulletItem( aNumRule, EE_PARA_NUMBULLET ) ); + rSet.Put( SvxNumBulletItem( std::move(aNumRule), EE_PARA_NUMBULLET ) ); static_cast<SfxStyleSheet*>(pSheet)->Broadcast(SfxHint( SfxHintId::DataChanged ) ); } break; diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx index e82768d7dfa4..c30b31ad3ba7 100644 --- a/sd/source/ui/dlg/dlgolbul.cxx +++ b/sd/source/ui/dlg/dlgolbul.cxx @@ -108,7 +108,7 @@ OutlineBulletDlg::OutlineBulletDlg(weld::Window* pParent, const SfxItemSet* pAtt SvxNumRule aNewRule( rRule ); aNewRule.SetFeatureFlag( SvxNumRuleFlags::NO_NUMBERS ); - SvxNumBulletItem aNewItem( aNewRule, EE_PARA_NUMBULLET ); + SvxNumBulletItem aNewItem( std::move(aNewRule), EE_PARA_NUMBULLET ); m_aInputSet.Put(aNewItem); } diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx index 13db35c73079..5d1cf1dec398 100644 --- a/sd/source/ui/func/fuolbull.cxx +++ b/sd/source/ui/func/fuolbull.cxx @@ -327,7 +327,7 @@ const SfxPoolItem* FuBulletAndPosition::GetNumBulletItem(SfxItemSet& aNewAttr, s SvxNumRule aNewRule( rLclRule ); aNewRule.SetFeatureFlag( SvxNumRuleFlags::NO_NUMBERS ); - SvxNumBulletItem aNewItem( aNewRule, EE_PARA_NUMBULLET ); + SvxNumBulletItem aNewItem( std::move(aNewRule), EE_PARA_NUMBULLET ); aNewAttr.Put(aNewItem); } diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 09f37d6a2872..8c636345fc5b 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -488,7 +488,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) aNewRule.SetLevel(nLevel, aFmt); } - pFirstStyleSheet->GetItemSet().Put(SvxNumBulletItem(aNewRule, EE_PARA_NUMBULLET)); + pFirstStyleSheet->GetItemSet().Put(SvxNumBulletItem(std::move(aNewRule), EE_PARA_NUMBULLET)); SdStyleSheet::BroadcastSdStyleSheetChange(pFirstStyleSheet, PresentationObjects::Outline_1, pSSPool); } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 5a68e30abab9..dae22d8dfde8 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -446,7 +446,7 @@ private: aItemSet.Put(SvxWeightItem(WEIGHT_NORMAL, EE_CHAR_WEIGHT)); SvxNumRule aDefaultNumRule(SvxNumRuleFlags::NONE, 0, false); - aItemSet.Put(SvxNumBulletItem(aDefaultNumRule, EE_PARA_NUMBULLET)); + aItemSet.Put(SvxNumBulletItem(std::move(aDefaultNumRule), EE_PARA_NUMBULLET)); pOutliner->SetParaAttribs(nParagraph, aItemSet); } diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 7f481d9677bc..ac7a5d3489ac 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -857,7 +857,7 @@ const SfxPoolItem* ViewShell::GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt16& SvxNumRule aNewRule( rRule ); aNewRule.SetFeatureFlag( SvxNumRuleFlags::NO_NUMBERS ); - SvxNumBulletItem aNewItem( aNewRule, EE_PARA_NUMBULLET ); + SvxNumBulletItem aNewItem( std::move(aNewRule), EE_PARA_NUMBULLET ); aNewAttr.Put(aNewItem); } |