diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-28 14:07:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-29 08:42:20 +0200 |
commit | ff597693035d0f60dc53f884e3c456b1048d92ab (patch) | |
tree | c8922a7ae5dd51f001120748e3419c3d861595bc /sw | |
parent | 99147c8303016498f4bfcef3d5c1fe126ad43076 (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>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/ndole.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/ole/ndole.cxx | 8 |
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(); } } |