diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-18 11:27:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-19 08:13:32 +0200 |
commit | 8991efcb3dd76a80ce6b3c2e7aa264355c0ef76e (patch) | |
tree | dbe7d13fe4cf197f31dcd2d3701decd3d55cd1f7 /sw/source | |
parent | 42d11d8dabe42fb090466915adde399ba43aaed8 (diff) |
loplugin:useuniqueptr in SwViewShellImp
Change-Id: Ied98688ca83652d92838f1ad01861068cd438c66
Reviewed-on: https://gerrit.libreoffice.org/57687
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/inc/viewimp.hxx | 10 | ||||
-rw-r--r-- | sw/source/core/view/viewimp.cxx | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx index e7abd74baf0a..3ec09cc16118 100644 --- a/sw/source/core/inc/viewimp.hxx +++ b/sw/source/core/inc/viewimp.hxx @@ -65,7 +65,7 @@ class SwViewShellImp SwViewShell *m_pShell; // If someone passes an Imp, but needs a SwViewShell, we // keep a backlink here - SwDrawView *m_pDrawView; // Our DrawView + std::unique_ptr<SwDrawView> m_pDrawView; // Our DrawView SdrPageView *m_pSdrPageView; // Exactly one Page for our DrawView SwPageFrame *m_pFirstVisiblePage; // Always points to the first visible Page @@ -87,7 +87,7 @@ class SwViewShellImp sal_uInt16 m_nRestoreActions ; // Count for the Action that need to be restored (UNO) SwRect m_aSmoothRect; - SwPagePreviewLayout* m_pPagePreviewLayout; + std::unique_ptr<SwPagePreviewLayout> m_pPagePreviewLayout; void SetFirstVisPage(OutputDevice const * pRenderContext); // Recalculate the first visible Page @@ -156,8 +156,8 @@ public: /// New Interface for StarView Drawing bool HasDrawView() const { return nullptr != m_pDrawView; } - SwDrawView* GetDrawView() { return m_pDrawView; } - const SwDrawView* GetDrawView() const { return m_pDrawView; } + SwDrawView* GetDrawView() { return m_pDrawView.get(); } + const SwDrawView* GetDrawView() const { return m_pDrawView.get(); } SdrPageView*GetPageView() { return m_pSdrPageView; } const SdrPageView*GetPageView() const { return m_pSdrPageView; } void MakeDrawView(); @@ -216,7 +216,7 @@ public: SwPagePreviewLayout* PagePreviewLayout() { - return m_pPagePreviewLayout; + return m_pPagePreviewLayout.get(); } /// Is this view accessible? diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index 9de73cfbdf4c..1475a5edac3a 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -106,13 +106,13 @@ SwViewShellImp::~SwViewShellImp() { m_pAccessibleMap.reset(); - delete m_pPagePreviewLayout; + m_pPagePreviewLayout.reset(); // Make sure HideSdrPage is also executed after ShowSdrPage. if( m_pDrawView ) m_pDrawView->HideSdrPage(); - delete m_pDrawView; + m_pDrawView.reset(); DelRegion(); @@ -227,10 +227,10 @@ void SwViewShellImp::MakeDrawView() pOutDevForDrawView = GetShell()->GetOut(); } - m_pDrawView = new SwDrawView( + m_pDrawView.reset( new SwDrawView( *this, *rIDDMA.GetOrCreateDrawModel(), - pOutDevForDrawView); + pOutDevForDrawView) ); } GetDrawView()->SetActiveLayer("Heaven"); @@ -286,7 +286,7 @@ void SwViewShellImp::InitPagePreviewLayout() { OSL_ENSURE( m_pShell->GetLayout(), "no layout - page preview layout can not be created."); if ( m_pShell->GetLayout() ) - m_pPagePreviewLayout = new SwPagePreviewLayout( *m_pShell, *(m_pShell->GetLayout()) ); + m_pPagePreviewLayout.reset( new SwPagePreviewLayout( *m_pShell, *(m_pShell->GetLayout()) ) ); } void SwViewShellImp::UpdateAccessible() |