summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-01 10:32:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-05 07:31:22 +0100
commitce7cb67aad5e49cfb59e7ca3927cfef610a6ca43 (patch)
tree259b1f5efefd28417195ad5a49501d5892595dfe /lotuswordpro
parent34bda0fef87bf17440372d5663239c091c92b55b (diff)
loplugin:useuniqueptr in LwpFontNameManager
Change-Id: I900fd3205d8fd451bb587d3da795919a10128ad1 Reviewed-on: https://gerrit.libreoffice.org/50721 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro')
-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 6413f6ea887b..bcaec1233876 100644
--- a/lotuswordpro/inc/lwpfont.hxx
+++ b/lotuswordpro/inc/lwpfont.hxx
@@ -164,7 +164,7 @@ public:
OUString GetNameByIndex(sal_uInt16 index);
private:
sal_uInt16 m_nCount;
- LwpFontNameEntry* m_pFontNames;
+ std::unique_ptr<LwpFontNameEntry[]> m_pFontNames;
LwpFontTable m_FontTbl;
public:
diff --git a/lotuswordpro/source/filter/lwpfont.cxx b/lotuswordpro/source/filter/lwpfont.cxx
index 6b4739577083..fda432add2b4 100644
--- a/lotuswordpro/source/filter/lwpfont.cxx
+++ b/lotuswordpro/source/filter/lwpfont.cxx
@@ -362,11 +362,6 @@ LwpFontNameManager::LwpFontNameManager()
LwpFontNameManager::~LwpFontNameManager()
{
- if(m_pFontNames)
- {
- delete [] m_pFontNames;
- m_pFontNames = nullptr;
- }
}
void LwpFontNameManager::Read(LwpObjectStream *pStrm)
@@ -374,7 +369,7 @@ void LwpFontNameManager::Read(LwpObjectStream *pStrm)
m_nCount = pStrm->QuickReaduInt16();
if(m_nCount>0)
{
- m_pFontNames = new LwpFontNameEntry[m_nCount];
+ m_pFontNames.reset( new LwpFontNameEntry[m_nCount] );
for(sal_uInt16 i=0; i<m_nCount; i++)
{
m_pFontNames[i].Read(pStrm);