diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-26 16:16:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-30 08:20:43 +0200 |
commit | aa8182383eaf25e296c4c104c63feb164f90e426 (patch) | |
tree | de6e02e1e6122e1ed98468b2a6b7f4971a21d57c /sw | |
parent | 6645a78104da18e23e476218343161c62dbc6a40 (diff) |
loplugin:useuniqueptr in SwColumnPage
Change-Id: I36cd9ba0c64073ae09d8ab8e2119d1404cbb02f1
Reviewed-on: https://gerrit.libreoffice.org/58236
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/frmdlg/column.cxx | 9 | ||||
-rw-r--r-- | sw/source/uibase/inc/column.hxx | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 16aa1ed8420c..8232edfca584 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -382,7 +382,7 @@ void SwColumnPage::ResetColWidth() { if( m_nCols ) { - const sal_uInt16 nWidth = GetMaxWidth( m_pColMgr, m_nCols ) / m_nCols; + const sal_uInt16 nWidth = GetMaxWidth( m_pColMgr.get(), m_nCols ) / m_nCols; for(sal_uInt16 i = 0; i < m_nCols; ++i) m_nColWidth[i] = static_cast<long>(nWidth); @@ -523,7 +523,7 @@ SwColumnPage::~SwColumnPage() void SwColumnPage::dispose() { - delete m_pColMgr; + m_pColMgr.reset(); m_pCLNrEdt.clear(); m_pDefaultVS.clear(); m_pBalanceColsCB.clear(); @@ -589,8 +589,7 @@ void SwColumnPage::Reset(const SfxItemSet *rSet) m_aDistEd1.SetPrcntValue(50, FUNIT_CM); m_aDistEd2.SetPrcntValue(50, FUNIT_CM); - delete m_pColMgr; - m_pColMgr = new SwColMgr(*rSet); + m_pColMgr.reset(new SwColMgr(*rSet)); m_nCols = m_pColMgr->GetCount() ; m_pCLNrEdt->SetMax(std::max(static_cast<sal_uInt16>(m_pCLNrEdt->GetMax()), m_nCols)); m_pCLNrEdt->SetLast(std::max(m_nCols,static_cast<sal_uInt16>(m_pCLNrEdt->GetMax()))); @@ -1244,7 +1243,7 @@ void SwColumnPage::ActivatePage(const SfxItemSet& rSet) } } m_pFrameExampleWN->Hide(); - m_pPgeExampleWN->UpdateExample( rSet, m_pColMgr ); + m_pPgeExampleWN->UpdateExample( rSet, m_pColMgr.get() ); m_pPgeExampleWN->Show(); } diff --git a/sw/source/uibase/inc/column.hxx b/sw/source/uibase/inc/column.hxx index 2f1b911ac35a..b72bc00180d6 100644 --- a/sw/source/uibase/inc/column.hxx +++ b/sw/source/uibase/inc/column.hxx @@ -121,7 +121,7 @@ class SwColumnPage : public SfxTabPage VclPtr<SwColExample> m_pPgeExampleWN; VclPtr<SwColumnOnlyExample> m_pFrameExampleWN; - SwColMgr* m_pColMgr; + std::unique_ptr<SwColMgr> m_pColMgr; sal_uInt16 m_nFirstVis; sal_uInt16 m_nCols; |