summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-01 10:30:59 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-05 07:31:11 +0100
commit34bda0fef87bf17440372d5663239c091c92b55b (patch)
tree383dbfe9679f8ea462b60535b490f7ea5e16829b
parent6eab752bdf7c8f9c743d20fed29fd60cb4e241f6 (diff)
loplugin:useuniqueptr in LwpFontTable
Change-Id: I91fd833fe42123845cd958b814112c367d964402 Reviewed-on: https://gerrit.libreoffice.org/50720 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--lotuswordpro/inc/lwpfont.hxx2
-rw-r--r--lotuswordpro/source/filter/lwpfont.cxx7
2 files changed, 2 insertions, 7 deletions
diff --git a/lotuswordpro/inc/lwpfont.hxx b/lotuswordpro/inc/lwpfont.hxx
index 93fdce7fe882..6413f6ea887b 100644
--- a/lotuswordpro/inc/lwpfont.hxx
+++ b/lotuswordpro/inc/lwpfont.hxx
@@ -100,7 +100,7 @@ public:
// void RegisterFontDecls();
private:
sal_uInt16 m_nCount;
- LwpFontTableEntry* m_pFontEntries;
+ std::unique_ptr<LwpFontTableEntry[]> m_pFontEntries;
};
class LwpFontNameEntry
diff --git a/lotuswordpro/source/filter/lwpfont.cxx b/lotuswordpro/source/filter/lwpfont.cxx
index eee1f3eb8807..6b4739577083 100644
--- a/lotuswordpro/source/filter/lwpfont.cxx
+++ b/lotuswordpro/source/filter/lwpfont.cxx
@@ -253,7 +253,7 @@ void LwpFontTable::Read(LwpObjectStream *pStrm)
m_nCount = pStrm->QuickReaduInt16();
if(m_nCount>0)
{
- m_pFontEntries = new LwpFontTableEntry[m_nCount];
+ m_pFontEntries.reset( new LwpFontTableEntry[m_nCount] );
for(sal_uInt16 i=0; i<m_nCount; i++)
{
m_pFontEntries[i].Read(pStrm);
@@ -270,11 +270,6 @@ OUString LwpFontTable::GetFaceName(sal_uInt16 index) //index: start from 1
LwpFontTable::~LwpFontTable()
{
- if(m_pFontEntries)
- {
- delete [] m_pFontEntries;
- m_pFontEntries = nullptr;
- }
}
void LwpFontNameEntry::Read(LwpObjectStream *pStrm)