diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/access/accpara.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index fab40746f65c..8296c0f660d5 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -640,15 +640,14 @@ SwXTextPortion* SwAccessibleParagraph::CreateUnoPortion( SwTextNode* pTextNode = const_cast<SwTextNode*>( GetTextNode() ); SwIndex aIndex( pTextNode, nStart ); SwPosition aStartPos( *pTextNode, aIndex ); - SwUnoCrsr* pUnoCursor = pTextNode->GetDoc()->CreateUnoCrsr( aStartPos ); + auto pUnoCursor(pTextNode->GetDoc()->CreateUnoCrsr2( aStartPos )); pUnoCursor->SetMark(); pUnoCursor->GetMark()->nContent = nEnd; // create a (dummy) text portion to be returned uno::Reference<text::XText> aEmpty; SwXTextPortion* pPortion = - new SwXTextPortion ( pUnoCursor, aEmpty, PORTION_TEXT); - delete pUnoCursor; + new SwXTextPortion ( pUnoCursor.get(), aEmpty, PORTION_TEXT); return pPortion; } |