diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-01-04 09:56:10 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-01-04 22:05:31 +0100 |
commit | 85cbefac5bb6631927e29aac9e27fbf07a280a4e (patch) | |
tree | be6c43e19f6fb718704f893d7548e38415c96787 /filter | |
parent | ofz#4950 Direct-leak (diff) | |
download | core-85cbefac5bb6631927e29aac9e27fbf07a280a4e.tar.gz core-85cbefac5bb6631927e29aac9e27fbf07a280a4e.zip |
migrate to std::unique_ptr
Change-Id: I4986d3e2893554bc875e64a1f27f9203814f4d55
Reviewed-on: https://gerrit.libreoffice.org/47374
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 7f5e7a024e36..bc1ccb59f2dd 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -499,8 +499,6 @@ SvStream& ReadPptOEPlaceholderAtom( SvStream& rIn, PptOEPlaceholderAtom& rAtom ) } PptSlidePersistEntry::PptSlidePersistEntry() : - pStyleSheet ( nullptr ), - pSolverContainer ( nullptr ), nSlidePersistStartOffset( 0 ), nSlidePersistEndOffset ( 0 ), nBackgroundOffset ( 0 ), @@ -515,12 +513,9 @@ PptSlidePersistEntry::PptSlidePersistEntry() : HeaderFooterOfs[ 0 ] = HeaderFooterOfs[ 1 ] = HeaderFooterOfs[ 2 ] = HeaderFooterOfs[ 3 ] = 0; } - PptSlidePersistEntry::~PptSlidePersistEntry() { - delete pStyleSheet; - delete pSolverContainer; -}; +} SdrEscherImport::SdrEscherImport( PowerPointImportParam& rParam, const OUString& rBaseURL ) : SvxMSDffManager ( rParam.rDocStream, rBaseURL ), @@ -1242,9 +1237,9 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi { pRet->NbcSetSnapRect( tools::Rectangle( Point(), rData.pPage.page->GetSize() ) ); // set size } - if ( rPersistEntry.pSolverContainer ) + if (rPersistEntry.xSolverContainer) { - for (SvxMSDffConnectorRule* pPtr : rPersistEntry.pSolverContainer->aCList) + for (SvxMSDffConnectorRule* pPtr : rPersistEntry.xSolverContainer->aCList) { if ( rObjData.nShapeId == pPtr->nShapeC ) pPtr->pCObj = pRet; @@ -1587,8 +1582,8 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const O } if ( SeekToRec( rStCtrl, DFF_msofbtSolverContainer, aPPTDgContainer.GetRecEndFilePos() ) ) { - rE2.pSolverContainer = new SvxMSDffSolverContainer; - ReadSvxMSDffSolverContainer( rStCtrl, *( rE2.pSolverContainer ) ); + rE2.xSolverContainer.reset(new SvxMSDffSolverContainer); + ReadSvxMSDffSolverContainer(rStCtrl, *rE2.xSolverContainer); } aPPTDgContainer.SeekToBegOfRecord( rStCtrl ); SetDgContainer( rStCtrl ); // set this, so that the escherimport is knowing of our drawings @@ -1601,8 +1596,8 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const O if ( aTxSIStyle.bValid && !aTxSIStyle.aList.empty() ) aTxSI = *( aTxSIStyle.aList[ 0 ] ); - rE2.pStyleSheet = new PPTStyleSheet( aSlideHd, rStCtrl, *this, aTxPFStyle, aTxSI ); - pDefaultSheet = rE2.pStyleSheet; + rE2.xStyleSheet.reset(new PPTStyleSheet(aSlideHd, rStCtrl, *this, aTxPFStyle, aTxSI)); + pDefaultSheet = rE2.xStyleSheet.get(); } if ( SeekToRec( rStCtrl, PPT_PST_ColorSchemeAtom, aSlideHd.GetRecEndFilePos() ) ) ReadPptColorSchemeAtom( rStCtrl, rE2.aColorScheme ); @@ -2216,7 +2211,6 @@ SdrObject* SdrPowerPointImport::ReadObjText( PPTTextObj* pTextObj, SdrObject* pS return pSdrObj; } - SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pSdrText, SdPageCapsule /*pPage*/, SfxStyleSheet* pSheet, SfxStyleSheet** ppStyleSheetAry ) const { @@ -2479,13 +2473,13 @@ void SdrPowerPointImport::SetPageNum( sal_uInt16 nPageNum, PptPageKind eKind ) if ( pPageList && nMasterIndex < pPageList->size() ) { PptSlidePersistEntry* pMasterPersist = &(*pPageList)[ nMasterIndex ]; - if ( ( pMasterPersist->pStyleSheet == nullptr ) && pMasterPersist->aSlideAtom.nMasterId ) + if (!pMasterPersist->xStyleSheet && pMasterPersist->aSlideAtom.nMasterId) { nMasterIndex = m_pMasterPages->FindPage( pMasterPersist->aSlideAtom.nMasterId ); if ( nMasterIndex != PPTSLIDEPERSIST_ENTRY_NOTFOUND ) pMasterPersist = &(*pPageList)[ nMasterIndex ]; } - pPPTStyleSheet = pMasterPersist->pStyleSheet; + pPPTStyleSheet = pMasterPersist->xStyleSheet.get(); } } if ( !pPPTStyleSheet ) @@ -2878,7 +2872,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry* if ( pObj ) { if ( aProcessData.pTableRowProperties ) - pObj = CreateTable( pObj, aProcessData.pTableRowProperties.get(), aProcessData.rPersistEntry.pSolverContainer ); + pObj = CreateTable(pObj, aProcessData.pTableRowProperties.get(), aProcessData.rPersistEntry.xSolverContainer.get()); pRet->NbcInsertObject( pObj ); @@ -2927,9 +2921,9 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry* // to the Page and delete it. pRet->getSdrPageProperties().ClearItem(); pRet->getSdrPageProperties().PutItemSet(rSlidePersist.pBObj->GetMergedItemSet()); - if (rSlidePersist.pSolverContainer) + if (rSlidePersist.xSolverContainer) { - for (SvxMSDffConnectorRule* pPtr : rSlidePersist.pSolverContainer->aCList) + for (SvxMSDffConnectorRule* pPtr : rSlidePersist.xSolverContainer->aCList) { // check connections to the group object if (pPtr->pAObj == rSlidePersist.pBObj) @@ -2949,8 +2943,8 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry* if (!aHd.SeekToEndOfRecord(rStCtrl)) break; } - if ( rSlidePersist.pSolverContainer ) - SolveSolver( *rSlidePersist.pSolverContainer ); + if (rSlidePersist.xSolverContainer) + SolveSolver(*rSlidePersist.xSolverContainer); } rStCtrl.Seek( nMerk ); } |