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

loplugin:useuniqueptr in FontPrevWin_Impl

Change-Id: I0919b8e2c58dbe26154e4a7c7c77e8e63f665842
Reviewed-on: https://gerrit.libreoffice.org/49933Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 5d9e3beb
......@@ -156,8 +156,8 @@ class FontPrevWin_Impl
SvxFont maCTLFont;
OUString maText;
OUString maScriptText;
Color* mpColor;
Color* mpBackColor;
std::unique_ptr<Color> mpColor;
std::unique_ptr<Color> mpBackColor;
long mnAscent;
sal_Unicode mcStartBracket;
sal_Unicode mcEndBracket;
......@@ -182,8 +182,6 @@ public:
FontPrevWin_Impl() :
mpPrinter(nullptr),
mbDelPrinter(false),
mpColor(nullptr),
mpBackColor(nullptr),
mnAscent(0),
mcStartBracket(0),
mcEndBracket(0),
......@@ -204,8 +202,6 @@ public:
~FontPrevWin_Impl()
{
delete mpColor;
delete mpBackColor;
if (mbDelPrinter)
mpPrinter.disposeAndClear();
}
......@@ -604,22 +600,19 @@ void SvxFontPrevWindow::SetFont( const SvxFont& rNormalOutFont, const SvxFont& r
void SvxFontPrevWindow::SetColor(const Color &rColor)
{
delete pImpl->mpColor;
pImpl->mpColor = new Color(rColor);
pImpl->mpColor.reset(new Color(rColor));
Invalidate();
}
void SvxFontPrevWindow::ResetColor()
{
delete pImpl->mpColor;
pImpl->mpColor = nullptr;
pImpl->mpColor.reset();
Invalidate();
}
void SvxFontPrevWindow::SetBackColor(const Color &rColor)
{
delete pImpl->mpBackColor;
pImpl->mpBackColor = new Color(rColor);
pImpl->mpBackColor.reset(new Color(rColor));
Invalidate();
}
......
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