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 ...@@ -156,8 +156,8 @@ class FontPrevWin_Impl
SvxFont maCTLFont; SvxFont maCTLFont;
OUString maText; OUString maText;
OUString maScriptText; OUString maScriptText;
Color* mpColor; std::unique_ptr<Color> mpColor;
Color* mpBackColor; std::unique_ptr<Color> mpBackColor;
long mnAscent; long mnAscent;
sal_Unicode mcStartBracket; sal_Unicode mcStartBracket;
sal_Unicode mcEndBracket; sal_Unicode mcEndBracket;
...@@ -182,8 +182,6 @@ public: ...@@ -182,8 +182,6 @@ public:
FontPrevWin_Impl() : FontPrevWin_Impl() :
mpPrinter(nullptr), mpPrinter(nullptr),
mbDelPrinter(false), mbDelPrinter(false),
mpColor(nullptr),
mpBackColor(nullptr),
mnAscent(0), mnAscent(0),
mcStartBracket(0), mcStartBracket(0),
mcEndBracket(0), mcEndBracket(0),
...@@ -204,8 +202,6 @@ public: ...@@ -204,8 +202,6 @@ public:
~FontPrevWin_Impl() ~FontPrevWin_Impl()
{ {
delete mpColor;
delete mpBackColor;
if (mbDelPrinter) if (mbDelPrinter)
mpPrinter.disposeAndClear(); mpPrinter.disposeAndClear();
} }
...@@ -604,22 +600,19 @@ void SvxFontPrevWindow::SetFont( const SvxFont& rNormalOutFont, const SvxFont& r ...@@ -604,22 +600,19 @@ void SvxFontPrevWindow::SetFont( const SvxFont& rNormalOutFont, const SvxFont& r
void SvxFontPrevWindow::SetColor(const Color &rColor) void SvxFontPrevWindow::SetColor(const Color &rColor)
{ {
delete pImpl->mpColor; pImpl->mpColor.reset(new Color(rColor));
pImpl->mpColor = new Color(rColor);
Invalidate(); Invalidate();
} }
void SvxFontPrevWindow::ResetColor() void SvxFontPrevWindow::ResetColor()
{ {
delete pImpl->mpColor; pImpl->mpColor.reset();
pImpl->mpColor = nullptr;
Invalidate(); Invalidate();
} }
void SvxFontPrevWindow::SetBackColor(const Color &rColor) void SvxFontPrevWindow::SetBackColor(const Color &rColor)
{ {
delete pImpl->mpBackColor; pImpl->mpBackColor.reset(new Color(rColor));
pImpl->mpBackColor = new Color(rColor);
Invalidate(); 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