diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-06 14:51:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-19 07:12:09 +0100 |
commit | 6e5d8bb2d60c2e44aa1d2bf7810bff09b9ceabb5 (patch) | |
tree | 38392d7552db85e42383b9af8fa0482087bff25f | |
parent | 5d9e3beb3760bcc04afb5d69b0c9ff70d522dd5e (diff) |
loplugin:useuniqueptr in FontPrevWin_Impl
Change-Id: I0919b8e2c58dbe26154e4a7c7c77e8e63f665842
Reviewed-on: https://gerrit.libreoffice.org/49933
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | svx/source/dialog/fntctrl.cxx | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index 63b53beb64ce..df74bc29f474 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -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(); } |