diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-01 10:29:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-05 09:23:03 +0100 |
commit | 37159a6979c7b82ed98f7b972cc7c86a3ff18df1 (patch) | |
tree | f27f9b6f92610d2db4a8a37d6ce803add79ca6f7 /lotuswordpro | |
parent | 46b32a022ee3679721e410e470c57b6a0b91ecb0 (diff) |
loplugin:useuniqueptr in Decompression
Change-Id: I0b224fd8e9f137e24375dd9975087e6a5891f8fc
Reviewed-on: https://gerrit.libreoffice.org/50719
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/explode.cxx | 8 | ||||
-rw-r--r-- | lotuswordpro/source/filter/explode.hxx | 7 |
2 files changed, 5 insertions, 10 deletions
diff --git a/lotuswordpro/source/filter/explode.cxx b/lotuswordpro/source/filter/explode.cxx index 497252d1d67a..207346c55a26 100644 --- a/lotuswordpro/source/filter/explode.cxx +++ b/lotuswordpro/source/filter/explode.cxx @@ -251,7 +251,7 @@ sal_Int32 Decompression::explode() } // if the bit is 1 we have here a length/distance pair: // -decode a number with Hufmman Tree #1; variable bit length, result is 0x00 .. 0x0F -> L1 - sal_uInt32 L1 = Decode(m_Tree1); + sal_uInt32 L1 = Decode(m_Tree1.get()); sal_uInt32 Length; if (L1 <= 7) { @@ -276,7 +276,7 @@ sal_Int32 Decompression::explode() } // - decode another number with Hufmann Tree #2 giving result 0x00..0x3F -> D1 - sal_uInt32 D1 = Decode(m_Tree2); + sal_uInt32 D1 = Decode(m_Tree2.get()); sal_uInt32 D2; if (Length == 2) { @@ -400,7 +400,7 @@ void Decompression::ConstructTree1() // d 0000 01 // e 0000 001 // f 0000 000 - m_Tree1 = new HuffmanTreeNode(); + m_Tree1.reset( new HuffmanTreeNode()); for (sal_uInt32 i=0; i< 16; i++) { m_Tree1->InsertNode(i, Tree1String[i]); @@ -431,7 +431,7 @@ void Decompression::ConstructTree1() void Decompression::ConstructTree2() { - m_Tree2 = new HuffmanTreeNode(); + m_Tree2.reset(new HuffmanTreeNode()); for (sal_uInt32 i=0; i< 64; i++) { m_Tree2->InsertNode(i, Tree2String[i]); diff --git a/lotuswordpro/source/filter/explode.hxx b/lotuswordpro/source/filter/explode.hxx index 1b8cc587811c..01e5ec97b8de 100644 --- a/lotuswordpro/source/filter/explode.hxx +++ b/lotuswordpro/source/filter/explode.hxx @@ -85,11 +85,6 @@ class Decompression { public: Decompression(SvStream * pInStream, SvStream * pOutStream); - ~Decompression() - { - delete m_Tree1; - delete m_Tree2; - }; /** * @brief * decompress from instream to outstream @@ -117,7 +112,7 @@ public: sal_uInt32 m_iArrayOfM[16]; - HuffmanTreeNode *m_Tree1, *m_Tree2; + std::unique_ptr<HuffmanTreeNode> m_Tree1, m_Tree2; void ConstructTree1(); void ConstructTree2(); |