summaryrefslogtreecommitdiff
path: root/vcl/qt5/Qt5Graphics_Text.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-08 09:43:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-08 09:43:42 +0200
commit93dae42fd4e5c7425cd0dfa945acd2fa0512d27f (patch)
treefa21f16fbe03a6501689ffe4122a30f60c9f9d4f /vcl/qt5/Qt5Graphics_Text.cxx
parent4f3c5db4dfacfad32ef207193a21c96e1d39da85 (diff)
loplugin:useuniqueptr in qt5
Change-Id: Ic7135e6ca3be7848fa39cd442d6dd716ea090713
Diffstat (limited to 'vcl/qt5/Qt5Graphics_Text.cxx')
-rw-r--r--vcl/qt5/Qt5Graphics_Text.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/vcl/qt5/Qt5Graphics_Text.cxx b/vcl/qt5/Qt5Graphics_Text.cxx
index ec07d50e4af6..8d25e97df786 100644
--- a/vcl/qt5/Qt5Graphics_Text.cxx
+++ b/vcl/qt5/Qt5Graphics_Text.cxx
@@ -39,8 +39,7 @@ void Qt5Graphics::SetFont(const FontSelectPattern* pReqFont, int nFallbackLevel)
{
if (!m_pTextStyle[i])
break;
- delete m_pTextStyle[i];
- m_pTextStyle[i] = nullptr;
+ m_pTextStyle[i].reset();
}
if (!pReqFont)
@@ -49,7 +48,7 @@ void Qt5Graphics::SetFont(const FontSelectPattern* pReqFont, int nFallbackLevel)
else
{
m_pFontData[nFallbackLevel] = static_cast<const Qt5FontFace*>(pReqFont->mpFontData);
- m_pTextStyle[nFallbackLevel] = new Qt5Font(*pReqFont);
+ m_pTextStyle[nFallbackLevel].reset(new Qt5Font(*pReqFont));
}
}