diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-24 13:42:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-29 17:03:46 +0200 |
commit | 979293ca138ccfb22ff1282b9055ae18b775fed8 (patch) | |
tree | e12dee56ff9d432771cfa3c9ac6fba968be8dd16 | |
parent | 89f470752d0ecc2a389aa8f630800a195a341a6d (diff) |
loplugin:useuniqueptr in FontNameBox
Change-Id: Icb362d46b34010dbfc97014d76a364b720c73b02
Reviewed-on: https://gerrit.libreoffice.org/53595
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/svtools/ctrlbox.hxx | 2 | ||||
-rw-r--r-- | svtools/source/control/ctrlbox.cxx | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx index 5e557e24777f..bb080249fa42 100644 --- a/include/svtools/ctrlbox.hxx +++ b/include/svtools/ctrlbox.hxx @@ -283,7 +283,7 @@ inline void LineListBox::SetNone( const OUString& sNone ) class SVT_DLLPUBLIC FontNameBox : public ComboBox { private: - ImplFontList* mpFontList; + std::unique_ptr<ImplFontList> mpFontList; bool mbWYSIWYG; OUString maFontMRUEntriesFile; diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 82cd893e9710..5704f3e9d977 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -669,7 +669,6 @@ void LineListBox::DataChanged( const DataChangedEvent& rDCEvt ) FontNameBox::FontNameBox( vcl::Window* pParent, WinBits nWinStyle ) : ComboBox( pParent, nWinStyle ) { - mpFontList = nullptr; mbWYSIWYG = false; InitFontMRUEntriesFile(); } @@ -759,8 +758,7 @@ void FontNameBox::InitFontMRUEntriesFile() void FontNameBox::ImplDestroyFontList() { - delete mpFontList; - mpFontList = nullptr; + mpFontList.reset(); } void FontNameBox::Fill( const FontList* pList ) @@ -772,7 +770,7 @@ void FontNameBox::Fill( const FontList* pList ) Clear(); ImplDestroyFontList(); - mpFontList = new ImplFontList; + mpFontList.reset(new ImplFontList); // insert fonts sal_uInt16 nFontCount = pList->GetFontNameCount(); |