Kaydet (Commit) 979293ca authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in FontNameBox

Change-Id: Icb362d46b34010dbfc97014d76a364b720c73b02
Reviewed-on: https://gerrit.libreoffice.org/53595Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 89f47075
...@@ -283,7 +283,7 @@ inline void LineListBox::SetNone( const OUString& sNone ) ...@@ -283,7 +283,7 @@ inline void LineListBox::SetNone( const OUString& sNone )
class SVT_DLLPUBLIC FontNameBox : public ComboBox class SVT_DLLPUBLIC FontNameBox : public ComboBox
{ {
private: private:
ImplFontList* mpFontList; std::unique_ptr<ImplFontList> mpFontList;
bool mbWYSIWYG; bool mbWYSIWYG;
OUString maFontMRUEntriesFile; OUString maFontMRUEntriesFile;
......
...@@ -669,7 +669,6 @@ void LineListBox::DataChanged( const DataChangedEvent& rDCEvt ) ...@@ -669,7 +669,6 @@ void LineListBox::DataChanged( const DataChangedEvent& rDCEvt )
FontNameBox::FontNameBox( vcl::Window* pParent, WinBits nWinStyle ) : FontNameBox::FontNameBox( vcl::Window* pParent, WinBits nWinStyle ) :
ComboBox( pParent, nWinStyle ) ComboBox( pParent, nWinStyle )
{ {
mpFontList = nullptr;
mbWYSIWYG = false; mbWYSIWYG = false;
InitFontMRUEntriesFile(); InitFontMRUEntriesFile();
} }
...@@ -759,8 +758,7 @@ void FontNameBox::InitFontMRUEntriesFile() ...@@ -759,8 +758,7 @@ void FontNameBox::InitFontMRUEntriesFile()
void FontNameBox::ImplDestroyFontList() void FontNameBox::ImplDestroyFontList()
{ {
delete mpFontList; mpFontList.reset();
mpFontList = nullptr;
} }
void FontNameBox::Fill( const FontList* pList ) void FontNameBox::Fill( const FontList* pList )
...@@ -772,7 +770,7 @@ void FontNameBox::Fill( const FontList* pList ) ...@@ -772,7 +770,7 @@ void FontNameBox::Fill( const FontList* pList )
Clear(); Clear();
ImplDestroyFontList(); ImplDestroyFontList();
mpFontList = new ImplFontList; mpFontList.reset(new ImplFontList);
// insert fonts // insert fonts
sal_uInt16 nFontCount = pList->GetFontNameCount(); sal_uInt16 nFontCount = pList->GetFontNameCount();
......
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