diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-02 14:45:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-03 08:17:44 +0200 |
commit | 24218c21712bc900a6641bd1844878f07b173df7 (patch) | |
tree | 586f30baa35e102d0a08f745adb23c3f101e8f93 | |
parent | 3769a6271120e0e856b53f906654bc2c593804fe (diff) |
loplugin:useuniqueptr in SwDropPortionPart
Change-Id: I9aaaeb2b5cb05d350059554555ecb0c195c51a74
Reviewed-on: https://gerrit.libreoffice.org/56830
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/source/core/text/pordrop.hxx | 8 | ||||
-rw-r--r-- | sw/source/core/text/txtdrop.cxx | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sw/source/core/text/pordrop.hxx b/sw/source/core/text/pordrop.hxx index e0f7a4ea21f4..7d2293d17648 100644 --- a/sw/source/core/text/pordrop.hxx +++ b/sw/source/core/text/pordrop.hxx @@ -33,8 +33,8 @@ extern SwDropCapCache *pDropCapCache; // attribute changes inside them. class SwDropPortionPart { - SwDropPortionPart* pFollow; - SwFont* pFnt; + std::unique_ptr<SwDropPortionPart> pFollow; + std::unique_ptr<SwFont> pFnt; TextFrameIndex nLen; sal_uInt16 nWidth; bool m_bJoinBorderWithNext; @@ -45,8 +45,8 @@ public: : pFollow( nullptr ), pFnt( &rFont ), nLen( nL ), nWidth( 0 ), m_bJoinBorderWithNext(false), m_bJoinBorderWithPrev(false) {}; ~SwDropPortionPart(); - SwDropPortionPart* GetFollow() const { return pFollow; }; - void SetFollow( SwDropPortionPart* pNew ) { pFollow = pNew; }; + SwDropPortionPart* GetFollow() const { return pFollow.get(); }; + void SetFollow( std::unique_ptr<SwDropPortionPart> pNew ) { pFollow = std::move(pNew); }; SwFont& GetFont() const { return *pFnt; } TextFrameIndex GetLen() const { return nLen; } sal_uInt16 GetWidth() const { return nWidth; } diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index 317eb084a4c1..6ced927d91cb 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -95,8 +95,8 @@ SwDropSave::~SwDropSave() /// SwDropPortionPart DTor SwDropPortionPart::~SwDropPortionPart() { - delete pFollow; - delete pFnt; + pFollow.reset(); + pFnt.reset(); } /// SwDropPortion CTor, DTor @@ -641,7 +641,7 @@ SwDropPortion *SwTextFormatter::NewDropPortion( SwTextFormatInfo &rInf ) if ( ! pCurrPart ) pDropPor->SetPart( pPart ); else - pCurrPart->SetFollow( pPart ); + pCurrPart->SetFollow( std::unique_ptr<SwDropPortionPart>(pPart) ); pCurrPart = pPart; } |