[Libreoffice-commits] core.git: 2 commits - lotuswordpro/source
Noel Grandin
noel.grandin at collabora.co.uk
Mon Mar 5 06:31:56 UTC 2018
lotuswordpro/source/filter/lwpdrawobj.cxx | 7 +------
lotuswordpro/source/filter/lwpdrawobj.hxx | 2 +-
lotuswordpro/source/filter/lwpfribbreaks.cxx | 7 +------
lotuswordpro/source/filter/lwpfribbreaks.hxx | 2 +-
4 files changed, 4 insertions(+), 14 deletions(-)
New commits:
commit dca7203aaba8e3ded03850d53b5d58280fdf5fb6
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Mar 1 10:34:23 2018 +0200
loplugin:useuniqueptr in LwpFribPageBreak
Change-Id: Id4d5c4c21a02be578d0cf571c744ec03b19d7d84
Reviewed-on: https://gerrit.libreoffice.org/50724
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/lotuswordpro/source/filter/lwpfribbreaks.cxx b/lotuswordpro/source/filter/lwpfribbreaks.cxx
index ee3f90c35129..540bf2f78fa0 100644
--- a/lotuswordpro/source/filter/lwpfribbreaks.cxx
+++ b/lotuswordpro/source/filter/lwpfribbreaks.cxx
@@ -106,11 +106,6 @@ LwpFribPageBreak::LwpFribPageBreak( LwpPara* pPara )
LwpFribPageBreak::~LwpFribPageBreak()
{
- if(m_pMasterPage)
- {
- delete m_pMasterPage;
- m_pMasterPage = nullptr;
- }
}
void LwpFribPageBreak::Read(LwpObjectStream * pObjStrm, sal_uInt16 /*len*/)
@@ -126,7 +121,7 @@ void LwpFribPageBreak::RegisterBreakStyle(LwpPara* pPara)
LwpPageLayout* pLayout = dynamic_cast<LwpPageLayout*>(m_Layout.obj().get());
if(pLayout)
{
- m_pMasterPage = new LwpMasterPage(pPara, pLayout);
+ m_pMasterPage.reset( new LwpMasterPage(pPara, pLayout) );
m_pMasterPage->RegisterMasterPage(this);
return;
}
diff --git a/lotuswordpro/source/filter/lwpfribbreaks.hxx b/lotuswordpro/source/filter/lwpfribbreaks.hxx
index bb4f42e01859..2c061041dcd8 100644
--- a/lotuswordpro/source/filter/lwpfribbreaks.hxx
+++ b/lotuswordpro/source/filter/lwpfribbreaks.hxx
@@ -81,7 +81,7 @@ private:
LwpObjectID m_Layout;
bool m_bLastFrib;
- LwpMasterPage* m_pMasterPage;
+ std::unique_ptr<LwpMasterPage> m_pMasterPage;
};
class LwpFribLineBreak: public LwpFrib
commit e8985cf0e01e1ed78c397455a5fcdaf0b2be035c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Mar 1 10:33:27 2018 +0200
loplugin:useuniqueptr in LwpDrawPolyLine
Change-Id: I75060c28aa877973b490ecf145d7c4e491c2c0cd
Reviewed-on: https://gerrit.libreoffice.org/50723
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
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);
More information about the Libreoffice-commits
mailing list