diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-01 11:10:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-05 07:33:19 +0100 |
commit | 38667b4895b04fabcd9639d0154e55c23b743c7a (patch) | |
tree | cebd9dc47a0da71469bb81a680e170ddbab3d7f5 /lotuswordpro/source | |
parent | 23c6774691d6c745a21762765dc5036c7484e800 (diff) |
loplugin:useuniqueptr in LwpDrawPolygon
Change-Id: Ia9a6b312a7e0ce189257395c84f65156546cb955
Reviewed-on: https://gerrit.libreoffice.org/50739
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r-- | lotuswordpro/source/filter/lwpdrawobj.cxx | 8 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpdrawobj.hxx | 2 |
2 files changed, 2 insertions, 8 deletions
diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx b/lotuswordpro/source/filter/lwpdrawobj.cxx index b1711065217d..60a7b9a5a306 100644 --- a/lotuswordpro/source/filter/lwpdrawobj.cxx +++ b/lotuswordpro/source/filter/lwpdrawobj.cxx @@ -565,17 +565,11 @@ XFFrame* LwpDrawPolyLine::CreateStandardDrawObj(const OUString& rStyleName) LwpDrawPolygon::LwpDrawPolygon(SvStream * pStream, DrawingOffsetAndScale* pTransData) : LwpDrawObj(pStream, pTransData) , m_nNumPoints(0) - , m_pVector(nullptr) { } LwpDrawPolygon::~LwpDrawPolygon() { - if (m_pVector) - { - delete [] m_pVector; - m_pVector = nullptr; - } } /** @@ -589,7 +583,7 @@ void LwpDrawPolygon::Read() if (m_nNumPoints > m_pStream->remainingSize() / 4) throw BadRead(); - m_pVector = new SdwPoint[m_nNumPoints]; + m_pVector.reset( new SdwPoint[m_nNumPoints] ); for (sal_uInt16 nC = 0; nC < m_nNumPoints; nC++) { diff --git a/lotuswordpro/source/filter/lwpdrawobj.hxx b/lotuswordpro/source/filter/lwpdrawobj.hxx index 647a715eb30e..01b946653b8b 100644 --- a/lotuswordpro/source/filter/lwpdrawobj.hxx +++ b/lotuswordpro/source/filter/lwpdrawobj.hxx @@ -208,7 +208,7 @@ class LwpDrawPolygon : public LwpDrawObj { private: sal_uInt16 m_nNumPoints; - SdwPoint* m_pVector; + std::unique_ptr<SdwPoint[]> m_pVector; public: LwpDrawPolygon(SvStream * pStream, DrawingOffsetAndScale* pTransData); |