summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-28 14:07:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-29 08:42:20 +0200
commitff597693035d0f60dc53f884e3c456b1048d92ab (patch)
treec8922a7ae5dd51f001120748e3419c3d861595bc
parent99147c8303016498f4bfcef3d5c1fe126ad43076 (diff)
loplugin:useuniqueptr in SwOLEObj
Change-Id: I36b14c31bfdf66b158dd2cf8f6a7a125d52cddb5 Reviewed-on: https://gerrit.libreoffice.org/56627 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/inc/ndole.hxx2
-rw-r--r--sw/source/core/ole/ndole.cxx8
2 files changed, 4 insertions, 6 deletions
diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx
index cc72ff6279a3..f77f70905a32 100644
--- a/sw/inc/ndole.hxx
+++ b/sw/inc/ndole.hxx
@@ -46,7 +46,7 @@ class SW_DLLPUBLIC SwOLEObj
// eventually buffered data if it is a chart OLE
drawinglayer::primitive2d::Primitive2DContainer m_aPrimitive2DSequence;
basegfx::B2DRange m_aRange;
- DeflateData* m_pDeflateData;
+ std::unique_ptr<DeflateData> m_pDeflateData;
SwOLEObj( const SwOLEObj& rObj ) = delete;
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 755410d33bc9..6101302bf40b 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -1019,8 +1019,7 @@ drawinglayer::primitive2d::Primitive2DContainer const & SwOLEObj::tryToGetChartC
// copy the result data and cleanup
m_aPrimitive2DSequence = m_pDeflateData->getSequence();
m_aRange = m_pDeflateData->getRange();
- delete m_pDeflateData;
- m_pDeflateData = nullptr;
+ m_pDeflateData.reset();
}
}
@@ -1048,7 +1047,7 @@ drawinglayer::primitive2d::Primitive2DContainer const & SwOLEObj::tryToGetChartC
// is okay (preview will be reused)
if(!m_pDeflateData)
{
- m_pDeflateData = new DeflateData(aXModel);
+ m_pDeflateData.reset( new DeflateData(aXModel) );
DeflateThread* pNew = new DeflateThread(*m_pDeflateData);
comphelper::ThreadPool::getSharedOptimalPool().pushTask(pNew);
}
@@ -1074,8 +1073,7 @@ void SwOLEObj::resetBufferedData()
{
// load is in progress, wait until finished and cleanup without using it
m_pDeflateData->waitFinished();
- delete m_pDeflateData;
- m_pDeflateData = nullptr;
+ m_pDeflateData.reset();
}
}