summaryrefslogtreecommitdiff
path: root/sdext/source/pdfimport/test/pdfunzip.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-03-28 10:32:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-03-29 07:29:25 +0100
commit77192c1bcbae89ddc8e293cc06bd54e0315f1f08 (patch)
tree1cb7886648aa4a8aac6db68a4857f482a880e92f /sdext/source/pdfimport/test/pdfunzip.cxx
parentbf1114a84176ff0683d72a541dfbf574e1344732 (diff)
loplugin:useuniqueptr in PDFReader
Change-Id: I22a96bbf9266cc8dfbe223b985d0ba005a6367e9 Reviewed-on: https://gerrit.libreoffice.org/69881 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext/source/pdfimport/test/pdfunzip.cxx')
-rw-r--r--sdext/source/pdfimport/test/pdfunzip.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/sdext/source/pdfimport/test/pdfunzip.cxx b/sdext/source/pdfimport/test/pdfunzip.cxx
index ca7e5afa0b1a..7db906bb255e 100644
--- a/sdext/source/pdfimport/test/pdfunzip.cxx
+++ b/sdext/source/pdfimport/test/pdfunzip.cxx
@@ -217,10 +217,10 @@ static int handleFile( const char* pInFile, const char* pOutFile, const char* pP
PDFReader aParser;
int nRet = 0;
- PDFEntry* pEntry = pdfparse::PDFReader::read( pInFile );
+ std::unique_ptr<PDFEntry> pEntry = pdfparse::PDFReader::read( pInFile );
if( pEntry )
{
- PDFFile* pPDFFile = dynamic_cast<PDFFile*>(pEntry);
+ PDFFile* pPDFFile = dynamic_cast<PDFFile*>(pEntry.get());
if( pPDFFile )
{
fprintf( stdout, "have a %s PDF file\n", pPDFFile->isEncrypted() ? "encrypted" : "unencrypted" );
@@ -231,7 +231,6 @@ static int handleFile( const char* pInFile, const char* pOutFile, const char* pP
}
else
nRet = 20;
- delete pEntry;
}
return nRet;
}