diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-07-06 09:45:44 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-07-06 13:59:04 +0200 |
commit | 3fdd0b9c90fbd6373adea90714a0d31099241393 (patch) | |
tree | b3005daad8bf62852e65388bd3b1ccad9d137c58 /sw/source | |
parent | 741d0665da6eb77df708cbba2906041fb9a974f3 (diff) |
ofz: more leaks
Change-Id: Ibb388c1596894ea3e9cd3d3ecd5f299aa9ccf8be
Reviewed-on: https://gerrit.libreoffice.org/39631
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/ww8/ww8graf.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par3.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 6 |
5 files changed, 9 insertions, 11 deletions
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 92564ddd4a3a..934c7952c0b9 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -605,7 +605,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp, if ( (68 == aRes.nSprmId) || (0x6A03 == aRes.nSprmId) ) { Read_PicLoc(aRes.nSprmId, aRes.pMemPos + - m_pSprmParser->DistanceToData(aRes.nSprmId), 4); + m_xSprmParser->DistanceToData(aRes.nSprmId), 4); // Ok, that's what we were looking for. Now let's get // out of here! break; @@ -1030,8 +1030,7 @@ void SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj, WW8PLCFx_Cp_FKP* pChp = m_xPlcxMan->GetChpPLCF(); WW8PLCFxDesc aDesc; pChp->GetSprms( &aDesc ); - WW8SprmIter aSprmIter(aDesc.pMemPos, aDesc.nSprmsLen, - *m_pSprmParser); + WW8SprmIter aSprmIter(aDesc.pMemPos, aDesc.nSprmsLen, *m_xSprmParser); for( int nLoop = 0; nLoop < 2; ++nLoop ) { diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 335f055be4d9..e9093bad8236 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4134,7 +4134,6 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SotStorage* pStorage, , m_aExtraneousParas(rD) , m_aInsertedTables(rD) , m_aSectionNameGenerator(rD, "WW") - , m_pSprmParser(nullptr) , m_aGrfNameGenerator(bNewDoc, OUString('G')) , m_aParaStyleMapper(rD) , m_aCharStyleMapper(rD) @@ -4933,7 +4932,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss) RedlineFlags eMode = RedlineFlags::ShowInsert; - m_pSprmParser = new wwSprmParser(*m_pWwFib); + m_xSprmParser.reset(new wwSprmParser(*m_pWwFib)); // Set handy helper variables m_bVer6 = (6 == m_pWwFib->m_nVersion); @@ -5255,7 +5254,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss) delete m_pWDop; DELETEZ( m_pFonts ); delete m_pAtnNames; - delete m_pSprmParser; + m_xSprmParser.reset(); ::EndProgress(m_pDocShell); m_pDataStream = nullptr; diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 40933875eb73..2df2d0c40ab1 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1156,7 +1156,7 @@ private: /* Knows how to split a series of bytes into sprms and their arguments */ - wwSprmParser *m_pSprmParser; + std::unique_ptr<wwSprmParser> m_xSprmParser; /* Creates unique names to give to graphics diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index ff970a225727..76fe2e8621ff 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -2081,7 +2081,7 @@ bool SwWW8ImplReader::ImportFormulaControl(WW8FormulaControl &aFormula, if ( (68 == aRes.nSprmId) || (0x6A03 == aRes.nSprmId) ) { Read_PicLoc( aRes.nSprmId, aRes.pMemPos + - m_pSprmParser->DistanceToData(aRes.nSprmId), 4); + m_xSprmParser->DistanceToData(aRes.nSprmId), 4); break; } } diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index a428746f0132..9f8ca0befd7d 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -6335,14 +6335,14 @@ void SwWW8ImplReader::EndSprm( sal_uInt16 nId ) short SwWW8ImplReader::ImportSprm(const sal_uInt8* pPos, sal_Int32 nMemLen, sal_uInt16 nId) { if (!nId) - nId = m_pSprmParser->GetSprmId(pPos); + nId = m_xSprmParser->GetSprmId(pPos); OSL_ENSURE( nId != 0xff, "Sprm FF !!!!" ); const SprmReadInfo& rSprm = GetSprmReadInfo(nId); - sal_uInt16 nFixedLen = m_pSprmParser->DistanceToData(nId); - sal_uInt16 nL = m_pSprmParser->GetSprmSize(nId, pPos, nMemLen); + sal_uInt16 nFixedLen = m_xSprmParser->DistanceToData(nId); + sal_uInt16 nL = m_xSprmParser->GetSprmSize(nId, pPos, nMemLen); if (rSprm.pReadFnc) (this->*rSprm.pReadFnc)(nId, pPos + nFixedLen, nL - nFixedLen); |