diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-31 09:19:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-31 15:50:04 +0200 |
commit | 5b8729a741bd65c2f61ae9caba7ea15a139835e5 (patch) | |
tree | c8e11588f87115b51b932af5b89bd0c68787e0a6 /editeng/source/outliner | |
parent | 68a6c70f25762374f7aed0d4d755345c6f37c78d (diff) |
no need to allocate SvxNumRule separately in SvxNumBulletItem
Change-Id: I7903565a468fc0fbec603c88b92cca6560a86728
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116424
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source/outliner')
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 4 | ||||
-rw-r--r-- | editeng/source/outliner/outlvw.cxx | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 8c74fe883345..9c474131352c 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -1389,8 +1389,8 @@ const SvxNumberFormat* Outliner::GetNumberFormat( sal_Int32 nPara ) const if( nDepth >= 0 ) { const SvxNumBulletItem& rNumBullet = pEditEngine->GetParaAttrib( nPara, EE_PARA_NUMBULLET ); - if ( rNumBullet.GetNumRule()->GetLevelCount() > nDepth ) - pFmt = rNumBullet.GetNumRule()->Get( nDepth ); + if ( rNumBullet.GetNumRule().GetLevelCount() > nDepth ) + pFmt = rNumBullet.GetNumRule().Get( nDepth ); } return pFmt; diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index da1b2f6d51ec..aabe51c9efd8 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -851,7 +851,7 @@ void OutlinerView::ToggleBullets() const SfxItemSet aTmpSet(pOwner->pEditEngine->GetAttribs(aSelection)); const SfxPoolItem& rPoolItem = aTmpSet.GetPool()->GetDefaultItem( EE_PARA_NUMBULLET ); const SvxNumBulletItem* pNumBulletItem = dynamic_cast< const SvxNumBulletItem* >(&rPoolItem); - pDefaultBulletNumRule = pNumBulletItem ? pNumBulletItem->GetNumRule() : nullptr; + pDefaultBulletNumRule = pNumBulletItem ? &pNumBulletItem->GetNumRule() : nullptr; } } @@ -1034,17 +1034,17 @@ void OutlinerView::ApplyBulletsNumbering( const SvxNumBulletItem* pNumBulletItem = dynamic_cast< const SvxNumBulletItem* >(pPoolItem); if (pNumBulletItem) { - const sal_uInt16 nLevelCnt = std::min(pNumBulletItem->GetNumRule()->GetLevelCount(), aNewRule.GetLevelCount()); + const sal_uInt16 nLevelCnt = std::min(pNumBulletItem->GetNumRule().GetLevelCount(), aNewRule.GetLevelCount()); for ( sal_uInt16 nLevel = 0; nLevel < nLevelCnt; ++nLevel ) { - const SvxNumberFormat* pOldFmt = pNumBulletItem->GetNumRule()->Get(nLevel); + const SvxNumberFormat* pOldFmt = pNumBulletItem->GetNumRule().Get(nLevel); const SvxNumberFormat* pNewFmt = aNewRule.Get(nLevel); if (pOldFmt && pNewFmt && (pOldFmt->GetFirstLineOffset() != pNewFmt->GetFirstLineOffset() || pOldFmt->GetAbsLSpace() != pNewFmt->GetAbsLSpace())) { - std::unique_ptr<SvxNumberFormat> pNewFmtClone(new SvxNumberFormat(*pNewFmt)); - pNewFmtClone->SetFirstLineOffset(pOldFmt->GetFirstLineOffset()); - pNewFmtClone->SetAbsLSpace(pOldFmt->GetAbsLSpace()); - aNewRule.SetLevel(nLevel, pNewFmtClone.get()); + SvxNumberFormat aNewFmtClone(*pNewFmt); + aNewFmtClone.SetFirstLineOffset(pOldFmt->GetFirstLineOffset()); + aNewFmtClone.SetAbsLSpace(pOldFmt->GetAbsLSpace()); + aNewRule.SetLevel(nLevel, &aNewFmtClone); } } } |