summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-01 10:33:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-05 07:31:32 +0100
commite8985cf0e01e1ed78c397455a5fcdaf0b2be035c (patch)
tree2e55d202bfda4b9b07bc7e937acdc242260331de /lotuswordpro
parentce7cb67aad5e49cfb59e7ca3927cfef610a6ca43 (diff)
loplugin:useuniqueptr in LwpDrawPolyLine
Change-Id: I75060c28aa877973b490ecf145d7c4e491c2c0cd Reviewed-on: https://gerrit.libreoffice.org/50723 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwpdrawobj.cxx7
-rw-r--r--lotuswordpro/source/filter/lwpdrawobj.hxx2
2 files changed, 2 insertions, 7 deletions
diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx b/lotuswordpro/source/filter/lwpdrawobj.cxx
index abc7326be812..b1711065217d 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -484,11 +484,6 @@ LwpDrawPolyLine::LwpDrawPolyLine(SvStream * pStream, DrawingOffsetAndScale* pTra
}
LwpDrawPolyLine::~LwpDrawPolyLine()
{
- if (m_pVector)
- {
- delete [] m_pVector;
- m_pVector = nullptr;
- }
}
/**
@@ -508,7 +503,7 @@ void LwpDrawPolyLine::Read()
if (m_aPolyLineRec.nNumPoints > m_pStream->remainingSize() / 4)
throw BadRead();
- m_pVector= new SdwPoint[m_aPolyLineRec.nNumPoints];
+ m_pVector.reset( new SdwPoint[m_aPolyLineRec.nNumPoints] );
for (sal_uInt16 nC = 0; nC < m_aPolyLineRec.nNumPoints; nC++)
{
diff --git a/lotuswordpro/source/filter/lwpdrawobj.hxx b/lotuswordpro/source/filter/lwpdrawobj.hxx
index 61d2c09e8c3b..647a715eb30e 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.hxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.hxx
@@ -187,7 +187,7 @@ class LwpDrawPolyLine : public LwpDrawObj
{
private:
SdwPolyLineRecord m_aPolyLineRec;
- SdwPoint* m_pVector;
+ std::unique_ptr<SdwPoint[]> m_pVector;
public:
LwpDrawPolyLine(SvStream * pStream, DrawingOffsetAndScale* pTransData);