summaryrefslogtreecommitdiff
path: root/sc/source/filter/xcl97/XclExpChangeTrack.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-12 16:38:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-13 08:40:16 +0200
commit281f1281edbd0063b1d1d9151bcbfc1299a0082e (patch)
treeb16437888cd2f25de455219b9743760b9097caa8 /sc/source/filter/xcl97/XclExpChangeTrack.cxx
parent1ea64c9d0d73daec926390c87afc543d54e71fb0 (diff)
loplugin:useuniqueptr in XclExpChTrCellContent
Change-Id: I8002f1bbb45a48244b981051abc02c1414a2fa34 Reviewed-on: https://gerrit.libreoffice.org/57361 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/filter/xcl97/XclExpChangeTrack.cxx')
-rw-r--r--sc/source/filter/xcl97/XclExpChangeTrack.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
index 240dfbc6336f..43492b6fb5c1 100644
--- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
@@ -838,21 +838,21 @@ XclExpChTrCellContent::XclExpChTrCellContent(
XclExpChTrCellContent::~XclExpChTrCellContent()
{
- delete pOldData;
- delete pNewData;
+ pOldData.reset();
+ pNewData.reset();
}
-void XclExpChTrCellContent::MakeEmptyChTrData( XclExpChTrData*& rpData )
+void XclExpChTrCellContent::MakeEmptyChTrData( std::unique_ptr<XclExpChTrData>& rpData )
{
if( rpData )
rpData->Clear();
else
- rpData = new XclExpChTrData;
+ rpData.reset( new XclExpChTrData );
}
void XclExpChTrCellContent::GetCellData(
const XclExpRoot& rRoot, const ScCellValue& rScCell,
- XclExpChTrData*& rpData, sal_uInt32& rXclLength1, sal_uInt16& rXclLength2 )
+ std::unique_ptr<XclExpChTrData>& rpData, sal_uInt32& rXclLength1, sal_uInt16& rXclLength2 )
{
MakeEmptyChTrData( rpData );
rXclLength1 = 0x0000003A;
@@ -860,8 +860,7 @@ void XclExpChTrCellContent::GetCellData(
if (rScCell.isEmpty())
{
- delete rpData;
- rpData = nullptr;
+ rpData.reset();
return;
}
@@ -1069,7 +1068,7 @@ void XclExpChTrCellContent::SaveXml( XclExpXmlStream& rRevisionLogStrm )
FSEND );
if( pOldData )
{
- lcl_WriteCell( rRevisionLogStrm, XML_oc, aPosition, pOldData );
+ lcl_WriteCell( rRevisionLogStrm, XML_oc, aPosition, pOldData.get() );
if (!pNewData)
{
pStream->singleElement(XML_nc,
@@ -1079,7 +1078,7 @@ void XclExpChTrCellContent::SaveXml( XclExpXmlStream& rRevisionLogStrm )
}
if( pNewData )
{
- lcl_WriteCell( rRevisionLogStrm, XML_nc, aPosition, pNewData );
+ lcl_WriteCell( rRevisionLogStrm, XML_nc, aPosition, pNewData.get() );
}
// OOXTODO: XML_odxf, XML_ndxf, XML_extLst elements
pStream->endElement( XML_rcc );