[Libreoffice-commits] core.git: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Jul 19 06:13:54 UTC 2018
sw/source/core/inc/viewimp.hxx | 10 +++++-----
sw/source/core/view/viewimp.cxx | 10 +++++-----
2 files changed, 10 insertions(+), 10 deletions(-)
New commits:
commit 8991efcb3dd76a80ce6b3c2e7aa264355c0ef76e
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Jul 18 11:27:55 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Jul 19 08:13:32 2018 +0200
loplugin:useuniqueptr in SwViewShellImp
Change-Id: Ied98688ca83652d92838f1ad01861068cd438c66
Reviewed-on: https://gerrit.libreoffice.org/57687
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
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()
More information about the Libreoffice-commits
mailing list