summaryrefslogtreecommitdiff
path: root/sw/source/core/access/accpara.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-09-24 13:41:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-24 18:58:16 +0200
commite8edc8edbf820d8358b465b92e697eb6831d23de (patch)
tree3095d1b490fbbd479dff18d974f6517fe7146e84 /sw/source/core/access/accpara.cxx
parentfb7d05f3d56c3e21ed7ba5cf8723a02801640caa (diff)
no need to allocate these SwPaM on the heap
Change-Id: Ief142e6410599ea50aee4065d843d7eaea55e21c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122578 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/access/accpara.cxx')
-rw-r--r--sw/source/core/access/accpara.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 9aed81d4759e..6d75fe4abf86 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1630,7 +1630,7 @@ void SwAccessibleParagraph::_getRunAttributesImpl(
tAccParaPropValMap& rRunAttrSeq )
{
// create PaM for character at position <nIndex>
- std::unique_ptr<SwPaM> pPaM;
+ std::optional<SwPaM> pPaM;
const TextFrameIndex nCorePos(GetPortionData().GetCoreViewPosition(nIndex));
SwTextFrame const*const pFrame(static_cast<SwTextFrame const*>(GetFrame()));
SwPosition const aModelPos(pFrame->MapViewToModelPos(nCorePos));
@@ -1640,7 +1640,7 @@ void SwAccessibleParagraph::_getRunAttributesImpl(
aModelPos.nContent.GetIndex() == pTextNode->Len()
? pTextNode->Len() // ???
: aModelPos.nContent.GetIndex() + 1);
- pPaM.reset(new SwPaM(aModelPos, aEndPos));
+ pPaM.emplace(aModelPos, aEndPos);
}
// retrieve character attributes for the created PaM <pPaM>