Kaydet (Commit) 91101181 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in PPTExtParaProv

Change-Id: I8013b0b6c75eca6426389a3d5ac8e4d7bf31ef4d
Reviewed-on: https://gerrit.libreoffice.org/50697Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst f72b5d4b
......@@ -3202,15 +3202,15 @@ bool PPTExtParaProv::GetGraphic( sal_uInt32 nInstance, Graphic& rGraph ) const
PPTBuGraEntry* pPtr = nullptr;
if ( nInstance < aBuGraList.size() )
{
pPtr = aBuGraList[ nInstance ];
pPtr = aBuGraList[ nInstance ].get();
if ( pPtr->nInstance == nInstance )
bRetValue = true;
}
if ( !bRetValue )
{
for (PPTBuGraEntry* i : aBuGraList)
for (std::unique_ptr<PPTBuGraEntry> const & i : aBuGraList)
{
pPtr = i;
pPtr = i.get();
if ( pPtr->nInstance == nInstance )
{
bRetValue = true;
......@@ -3277,9 +3277,9 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
}
}
if ( n < nBuGraCount ) {
aBuGraList.insert( aBuGraList.begin() + n, pBuGra );
aBuGraList.emplace( aBuGraList.begin() + n, pBuGra );
} else {
aBuGraList.push_back( pBuGra );
aBuGraList.emplace_back( pBuGra );
}
}
#ifdef DBG_UTIL
......@@ -3370,9 +3370,6 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
PPTExtParaProv::~PPTExtParaProv()
{
for (PPTBuGraEntry* i : aBuGraList)
delete i;
aBuGraList.clear();
}
PPTNumberFormatCreator::PPTNumberFormatCreator( PPTExtParaProv* pParaProv )
......
......@@ -720,7 +720,7 @@ struct PPTBuGraEntry
class PPTExtParaProv
{
::std::vector< PPTBuGraEntry* > aBuGraList;
::std::vector< std::unique_ptr<PPTBuGraEntry> > aBuGraList;
public:
bool bStyles;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment