summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-09 13:27:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-05-14 11:19:14 +0200
commit3f32388fd4ed343ff1e3036edfc7f97127202949 (patch)
tree27e07484576b16ab8abac50dc04fb31d10083fd5 /filter
parentd0242b11638938c8873643ee3fc768e4a3a52b95 (diff)
loplugin:useuniqueptr in PSWriter
Change-Id: I31b6e216bbd603d551e25e415851b423864148d7 Reviewed-on: https://gerrit.libreoffice.org/54178 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 0eb4e23afb61..3eba386bac82 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -138,7 +138,7 @@ private:
vcl::Font maLastFont;
sal_uInt8 nNextChrSetId; // first unused ChrSet-Id
- PSLZWCTreeNode* pTable; // LZW compression data
+ std::unique_ptr<PSLZWCTreeNode[]> pTable; // LZW compression data
PSLZWCTreeNode* pPrefix; // the compression is as same as the TIFF compression
sal_uInt16 nDataSize;
sal_uInt16 nClearCode;
@@ -2507,7 +2507,7 @@ void PSWriter::StartCompression()
nOffset = 32; // number of free unused in dwShift
dwShift = 0;
- pTable = new PSLZWCTreeNode[ 4096 ];
+ pTable.reset(new PSLZWCTreeNode[ 4096 ]);
for ( i = 0; i < 4096; i++ )
{
@@ -2526,7 +2526,7 @@ void PSWriter::Compress( sal_uInt8 nCompThis )
if( !pPrefix )
{
- pPrefix = pTable + nCompThis;
+ pPrefix = pTable.get() + nCompThis;
}
else
{
@@ -2558,14 +2558,14 @@ void PSWriter::Compress( sal_uInt8 nCompThis )
if( nTableSize == static_cast<sal_uInt16>( ( 1 << nCodeSize ) - 1 ) )
nCodeSize++;
- p = pTable + ( nTableSize++ );
+ p = pTable.get() + ( nTableSize++ );
p->pBrother = pPrefix->pFirstChild;
pPrefix->pFirstChild = p;
p->nValue = nV;
p->pFirstChild = nullptr;
}
- pPrefix = pTable + nV;
+ pPrefix = pTable.get() + nV;
}
}
}
@@ -2576,7 +2576,7 @@ void PSWriter::EndCompression()
WriteBits( pPrefix->nCode, nCodeSize );
WriteBits( nEOICode, nCodeSize );
- delete[] pTable;
+ pTable.reset();
}
sal_uInt8* PSWriter::ImplSearchEntry( sal_uInt8* pSource, sal_uInt8 const * pDest, sal_uLong nComp, sal_uLong nSize )