Kaydet (Commit) ce7cb67a authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in LwpFontNameManager

Change-Id: I900fd3205d8fd451bb587d3da795919a10128ad1
Reviewed-on: https://gerrit.libreoffice.org/50721Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 34bda0fe
......@@ -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:
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment