summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-22 13:41:07 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-22 19:04:39 +0200
commit3a58fa09d89bff3d5d8588c9ace3b4af90a9a2ce (patch)
tree19f10b4e305efe99a44c4b05c4d31b107441507c /sw
parentd0f8daa0980ba8e403b32006831657c5a0a4ea17 (diff)
loplugin:useuniqueptr in SwTextLine
Change-Id: I3c3cdf14d8d86028c452e190dea5fa1bb3da0cbb Reviewed-on: https://gerrit.libreoffice.org/59443 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/txtcache.cxx6
-rw-r--r--sw/source/core/text/txtcache.hxx2
2 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/core/text/txtcache.cxx b/sw/source/core/text/txtcache.cxx
index b2f412b07c5b..b0f540a2a024 100644
--- a/sw/source/core/text/txtcache.cxx
+++ b/sw/source/core/text/txtcache.cxx
@@ -21,9 +21,9 @@
#include <txtfrm.hxx>
#include "porlay.hxx"
-SwTextLine::SwTextLine( SwTextFrame const *pFrame, SwParaPortion *pNew ) :
+SwTextLine::SwTextLine( SwTextFrame const *pFrame, std::unique_ptr<SwParaPortion> pNew ) :
SwCacheObj( static_cast<void const *>(pFrame) ),
- pLine( pNew )
+ pLine( std::move(pNew) )
{
}
@@ -125,7 +125,7 @@ void SwTextFrame::SetPara( SwParaPortion *pNew, bool bDelete )
}
else if ( pNew )
{ // Insert a new one
- SwTextLine *pTextLine = new SwTextLine( this, pNew );
+ SwTextLine *pTextLine = new SwTextLine( this, std::unique_ptr<SwParaPortion>(pNew) );
if ( SwTextFrame::GetTextCache()->Insert( pTextLine ) )
mnCacheIndex = pTextLine->GetCachePos();
else
diff --git a/sw/source/core/text/txtcache.hxx b/sw/source/core/text/txtcache.hxx
index 805ffa068fef..c42018c8da86 100644
--- a/sw/source/core/text/txtcache.hxx
+++ b/sw/source/core/text/txtcache.hxx
@@ -31,7 +31,7 @@ class SwTextLine : public SwCacheObj
std::unique_ptr<SwParaPortion> pLine;
public:
- SwTextLine( SwTextFrame const *pFrame, SwParaPortion *pNew = nullptr );
+ SwTextLine( SwTextFrame const *pFrame, std::unique_ptr<SwParaPortion> pNew = nullptr );
virtual ~SwTextLine() override;
SwParaPortion *GetPara() { return pLine.get(); }