diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-03-12 16:49:29 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-03-12 17:20:16 +0100 |
commit | 867bf5b48eeae3925de2196d38554518938f9c1a (patch) | |
tree | 9496bbdebf03a27de392f41758d568673e238748 /sc/source/filter/xcl97/XclExpChangeTrack.cxx | |
parent | a0ac896fea5613f38a7586e7ce991570437d654d (diff) |
fix memory leak in change tracking export
Change-Id: Idffa7c4a9c9519c150458db3749e7b67fbbb463c
Diffstat (limited to 'sc/source/filter/xcl97/XclExpChangeTrack.cxx')
-rw-r--r-- | sc/source/filter/xcl97/XclExpChangeTrack.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx index 9e9ccc2c49d5..2d2e675ad008 100644 --- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx @@ -476,11 +476,10 @@ void XclExpXmlChTrHeader::SaveXml( XclExpXmlStream& rStrm ) pRevLogStrm->write(">"); - std::vector<XclExpChTrAction*>::iterator it = maActions.begin(), itEnd = maActions.end(); + auto it = maActions.begin(), itEnd = maActions.end(); for (; it != itEnd; ++it) { - XclExpChTrAction* p = *it; - p->SaveXml(rStrm); + (*it)->SaveXml(rStrm); } pRevLogStrm->write("</")->writeId(XML_revisions)->write(">"); @@ -490,7 +489,7 @@ void XclExpXmlChTrHeader::SaveXml( XclExpXmlStream& rStrm ) pHeader->write("</")->writeId(XML_header)->write(">"); } -void XclExpXmlChTrHeader::AppendAction( XclExpChTrAction* pAction ) +void XclExpXmlChTrHeader::AppendAction( std::unique_ptr<XclExpChTrAction> pAction ) { sal_uInt32 nActionNum = pAction->GetActionNumber(); if (!mnMinAction || mnMinAction > nActionNum) @@ -499,7 +498,7 @@ void XclExpXmlChTrHeader::AppendAction( XclExpChTrAction* pAction ) if (!mnMaxAction || mnMaxAction < nActionNum) mnMaxAction = nActionNum; - maActions.push_back(pAction); + maActions.push_back(std::move(pAction)); } XclExpChTrInfo::XclExpChTrInfo( const OUString& rUsername, const DateTime& rDateTime, const sal_uInt8* pGUID ) : @@ -1517,7 +1516,7 @@ XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) : pHeaders->SetGUID(aGUID); } pAction->SetIndex(nIndex); - pCurHeader->AppendAction(pAction); + pCurHeader->AppendAction(std::unique_ptr<XclExpChTrAction>(pAction)); } pHeaders->SetGUID(aGUID); |