sw/source/ui/config/optload.cxx | 2 +- sw/source/ui/config/optpage.cxx | 18 ++++++++---------- sw/source/uibase/inc/optload.hxx | 2 +- sw/source/uibase/inc/optpage.hxx | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-)
New commits: commit 2d8634d236a1bc528ae5a3838556ff1b51e9deb7 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jul 26 15:12:18 2018 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Jul 30 08:19:25 2018 +0200 loplugin:useuniqueptr in SwStdFontTabPage Change-Id: I9ae756cfbdb1cd1f8a257d34b4e7045143bb92b9 Reviewed-on: https://gerrit.libreoffice.org/58229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index a60459508964..6b9e7f86468e 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -522,7 +522,6 @@ SwStdFontTabPage::SwStdFontTabPage( vcl::Window* pParent, const SfxItemSet& rSet ) : SfxTabPage( pParent, "OptFontTabPage" , "modules/swriter/ui/optfonttabpage.ui" , &rSet), m_pPrt(nullptr), - m_pFontList(nullptr), m_pFontConfig(nullptr), m_pWrtShell(nullptr), m_eLanguage( GetAppLanguage() ), @@ -593,7 +592,7 @@ SwStdFontTabPage::~SwStdFontTabPage() void SwStdFontTabPage::dispose() { - delete m_pFontList; + m_pFontList.reset(); m_pLabelFT.clear(); m_pStandardBox.clear(); m_pStandardHeightLB.clear(); @@ -795,8 +794,7 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet) SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC>{} ); m_pPrt = VclPtr<SfxPrinter>::Create(std::move(pPrinterSet)); } - delete m_pFontList; - m_pFontList = new FontList( m_pPrt ); + m_pFontList.reset(new FontList( m_pPrt )); // #i94536# prevent duplication of font entries when 'reset' button is pressed if( !m_pStandardBox->GetEntryCount() ) { @@ -922,15 +920,15 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet) m_pIdxBox->SetText(sIdxBackup ); FontMetric aFontMetric( m_pFontList->Get(sStdBackup, sStdBackup) ); - m_pStandardHeightLB->Fill( &aFontMetric, m_pFontList ); + m_pStandardHeightLB->Fill( &aFontMetric, m_pFontList.get() ); aFontMetric = m_pFontList->Get(sOutBackup, sOutBackup ); - m_pTitleHeightLB->Fill( &aFontMetric, m_pFontList ); + m_pTitleHeightLB->Fill( &aFontMetric, m_pFontList.get() ); aFontMetric = m_pFontList->Get(sListBackup,sListBackup); - m_pListHeightLB->Fill( &aFontMetric, m_pFontList ); + m_pListHeightLB->Fill( &aFontMetric, m_pFontList.get() ); aFontMetric = m_pFontList->Get(sCapBackup, sCapBackup ); - m_pLabelHeightLB->Fill( &aFontMetric, m_pFontList ); + m_pLabelHeightLB->Fill( &aFontMetric, m_pFontList.get() ); aFontMetric = m_pFontList->Get(sIdxBackup, sIdxBackup ); - m_pIndexHeightLB->Fill( &aFontMetric, m_pFontList ); + m_pIndexHeightLB->Fill( &aFontMetric, m_pFontList.get() ); m_pStandardHeightLB->SetValue( CalcToPoint( nStandardHeight, MapUnit::MapTwip, 10 ) ); m_pTitleHeightLB-> SetValue( CalcToPoint( nTitleHeight , MapUnit::MapTwip, 10 ) ); @@ -1061,7 +1059,7 @@ IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, Control&, rControl, void ) pHeightLB = m_pIndexHeightLB; } FontMetric aFontMetric( m_pFontList->Get(sEntry, sEntry) ); - pHeightLB->Fill( &aFontMetric, m_pFontList ); + pHeightLB->Fill( &aFontMetric, m_pFontList.get() ); } void SwStdFontTabPage::PageCreated( const SfxAllItemSet& aSet) diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx index 05b0efb4d671..6557d6a010ee 100644 --- a/sw/source/uibase/inc/optpage.hxx +++ b/sw/source/uibase/inc/optpage.hxx @@ -144,7 +144,7 @@ class SwStdFontTabPage : public SfxTabPage OUString m_sShellIndex; VclPtr<SfxPrinter> m_pPrt; - FontList* m_pFontList; + std::unique_ptr<FontList> m_pFontList; SwStdFontConfig* m_pFontConfig; SwWrtShell* m_pWrtShell; LanguageType m_eLanguage; commit bf3421c5942639b5dd3c82b35108384ef6b9f392 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jul 26 15:10:43 2018 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Jul 30 08:19:16 2018 +0200 loplugin:useuniqueptr in SwCaptionOptPage Change-Id: I6e3391be26e6442ab13cc3d6d9da6e6909d68707 Reviewed-on: https://gerrit.libreoffice.org/58228 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index dc05b9f35417..faec48efbde8 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -562,7 +562,7 @@ SwCaptionOptPage::~SwCaptionOptPage() void SwCaptionOptPage::dispose() { DelUserData(); - delete pMgr; + pMgr.reset(); m_pCheckLB.clear(); m_pLbCaptionOrder.clear(); m_pPreview.clear(); diff --git a/sw/source/uibase/inc/optload.hxx b/sw/source/uibase/inc/optload.hxx index ef6f828b67e9..e8a8169abe8e 100644 --- a/sw/source/uibase/inc/optload.hxx +++ b/sw/source/uibase/inc/optload.hxx @@ -180,7 +180,7 @@ private: OUString m_sNone; - SwFieldMgr* pMgr; + std::unique_ptr<SwFieldMgr> pMgr; bool bHTMLMode; TextFilterAutoConvert m_aTextFilter; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits