summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-05-29 18:34:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-05-30 17:21:27 +0200
commitebbb0674b4d98b1807c2fa94afaa3003111a9dc8 (patch)
tree9099b49c4fbecd816cc48d2b7e57e2dbd9fbe49a /sw/source
parent304cc248f15d795bc9fe8b751b0d98841b8ff5d1 (diff)
simplify
Change-Id: I596765e0f0922e1b1ca4c185560f29fef31c4d06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/edit/edattr.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index d3445944e6cb..e98dbebd397f 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -293,7 +293,6 @@ std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell
sal_Int32 nSttCnt = rCurrentPaM.Start()->GetContentIndex();
sal_Int32 nEndCnt = rCurrentPaM.End()->GetContentIndex();
- SwPaM* pNewPaM = nullptr;
const SfxPoolItem* pItem = nullptr;
// for all the nodes in the current selection
@@ -320,9 +319,8 @@ std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell
// item from attribute set
if( pTextNd->HasSwAttrSet() )
{
- pNewPaM = new SwPaM(*pNd, nStt, *pNd, nEnd);
pItem = pTextNd->GetSwAttrSet().GetItem( nWhich );
- vItem.emplace_back( pItem, std::unique_ptr<SwPaM>(pNewPaM) );
+ vItem.emplace_back( pItem, std::make_unique<SwPaM>(*pNd, nStt, *pNd, nEnd) );
}
if( !pTextNd->HasHints() )
@@ -368,8 +366,7 @@ std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell
nStop = nEnd;
else
nStop = *pAttrEnd;
- pNewPaM = new SwPaM(*pNd, nStart, *pNd, nStop);
- vItem.emplace_back( pItem, std::unique_ptr<SwPaM>(pNewPaM) );
+ vItem.emplace_back( pItem, std::make_unique<SwPaM>(*pNd, nStart, *pNd, nStop) );
break;
}
pItem = aItemIter.NextItem();
@@ -377,9 +374,8 @@ std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell
// default item
if( !pItem && !pTextNd->HasSwAttrSet() )
{
- pNewPaM = new SwPaM(*pNd, nStt, *pNd, nEnd);
pItem = pAutoSet->GetPool()->GetUserDefaultItem( nWhich );
- vItem.emplace_back( pItem, std::unique_ptr<SwPaM>(pNewPaM) );
+ vItem.emplace_back( pItem, std::make_unique<SwPaM>(*pNd, nStt, *pNd, nEnd) );
}
}
}