summaryrefslogtreecommitdiff
path: root/filter/source/msfilter/svdfppt.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-28 15:50:29 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-05 12:44:32 +0100
commit4245454d0c3d6df2d0e0a75aed6f22f0a26ce3e2 (patch)
treec7e708889fed58868c9f31fa4fc4bbb6d44171e3 /filter/source/msfilter/svdfppt.cxx
parent05a195ffca41bc3883627b9503ade8cdd0b6d909 (diff)
loplugin:useuniqueptr in SdrPowerPointImport
Change-Id: I9a8d1669cbd94f73dc75e4b7339910f8201e06aa Reviewed-on: https://gerrit.libreoffice.org/50695 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter/source/msfilter/svdfppt.cxx')
-rw-r--r--filter/source/msfilter/svdfppt.cxx32
1 files changed, 14 insertions, 18 deletions
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 8de6562a9c71..c9997744421b 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1498,9 +1498,9 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const O
// TODO:: PPT_PST_TxPFStyleAtom
// read SlidePersists
- m_pMasterPages = new PptSlidePersistList;
- m_pSlidePages = new PptSlidePersistList;
- m_pNotePages = new PptSlidePersistList;
+ m_pMasterPages.reset( new PptSlidePersistList );
+ m_pSlidePages.reset( new PptSlidePersistList );
+ m_pNotePages.reset( new PptSlidePersistList );
// now always creating the handout page, it will be the first in our masterpage list
std::unique_ptr<PptSlidePersistEntry> pE(new PptSlidePersistEntry);
@@ -1655,13 +1655,9 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const O
SdrPowerPointImport::~SdrPowerPointImport()
{
- for (SdHyperlinkEntry* i : aHyperList) {
- delete i;
- }
- aHyperList.clear();
- delete m_pMasterPages;
- delete m_pSlidePages;
- delete m_pNotePages;
+ m_pMasterPages.reset();
+ m_pSlidePages.reset();
+ m_pNotePages.reset();
}
bool PPTConvertOCXControls::ReadOCXStream( tools::SvRef<SotStorage>& rSrc,
@@ -2196,11 +2192,11 @@ bool SdrPowerPointImport::ReadFontCollection()
PptSlidePersistList* SdrPowerPointImport::GetPageList(PptPageKind ePageKind) const
{
if ( ePageKind == PPT_MASTERPAGE )
- return m_pMasterPages;
+ return m_pMasterPages.get();
if ( ePageKind == PPT_SLIDEPAGE )
- return m_pSlidePages;
+ return m_pSlidePages.get();
if ( ePageKind == PPT_NOTEPAGE )
- return m_pNotePages;
+ return m_pNotePages.get();
return nullptr;
}
@@ -6874,9 +6870,9 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
{
PptInteractiveInfoAtom aInteractiveInfoAtom;
ReadPptInteractiveInfoAtom( rIn, aInteractiveInfoAtom );
- for (SdHyperlinkEntry* pHyperlink : rSdrPowerPointImport.aHyperList)
+ for (SdHyperlinkEntry& rHyperlink : rSdrPowerPointImport.aHyperList)
{
- if ( pHyperlink->nIndex == aInteractiveInfoAtom.nExHyperlinkId )
+ if ( rHyperlink.nIndex == aInteractiveInfoAtom.nExHyperlinkId )
{
if (!aTextHd.SeekToEndOfRecord(rIn))
{
@@ -6898,11 +6894,11 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
xEntry.reset(new PPTFieldEntry);
xEntry->nPos = static_cast<sal_uInt16>(nStartPos);
xEntry->nTextRangeEnd = static_cast<sal_uInt16>(nEndPos);
- OUString aTarget( pHyperlink->aTarget );
- if ( !pHyperlink->aConvSubString.isEmpty() )
+ OUString aTarget( rHyperlink.aTarget );
+ if ( !rHyperlink.aConvSubString.isEmpty() )
{
aTarget += "#";
- aTarget += pHyperlink->aConvSubString;
+ aTarget += rHyperlink.aConvSubString;
}
xEntry->xField1.reset(new SvxFieldItem( SvxURLField( aTarget, OUString(), SvxURLFormat::Repr ), EE_FEATURE_FIELD ));
}