diff options
author | Michael Stahl <mstahl@redhat.com> | 2018-02-16 23:51:56 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2018-02-20 10:24:11 +0100 |
commit | 29b34d1700ae8752f9698c3c49875cedb951e9e2 (patch) | |
tree | ba894d836507321d45dec6dbdb78e6d4dd6023a9 | |
parent | 76d5b9d0cf0b0f1f15205b06a26399425e2a345e (diff) |
sw: convert DELETEZ to unique_ptr in SwViewShellImp
Change-Id: If5c26f1a7892368c244f4d46aab7d36a22c83504
Reviewed-on: https://gerrit.libreoffice.org/49991
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | sw/source/core/inc/viewimp.hxx | 5 | ||||
-rw-r--r-- | sw/source/core/view/viewimp.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx index 196d345f8603..e7abd74baf0a 100644 --- a/sw/source/core/inc/viewimp.hxx +++ b/sw/source/core/inc/viewimp.hxx @@ -26,6 +26,7 @@ #include <swrect.hxx> #include <swtypes.hxx> #include <vector> +#include <memory> class SwViewShell; class SwFlyFrame; @@ -68,7 +69,7 @@ class SwViewShellImp SdrPageView *m_pSdrPageView; // Exactly one Page for our DrawView SwPageFrame *m_pFirstVisiblePage; // Always points to the first visible Page - SwRegionRects *m_pRegion; // Collector of Paintrects from the LayAction + std::unique_ptr<SwRegionRects> m_pRegion; // Collector of Paintrects from the LayAction SwLayAction *m_pLayAction; // Is set if an Action object exists // Is registered by the SwLayAction ctor and deregistered by the dtor @@ -150,7 +151,7 @@ public: void SetFirstVisPageInvalid() { m_bFirstPageInvalid = true; } bool AddPaintRect( const SwRect &rRect ); - SwRegionRects *GetRegion() { return m_pRegion; } + SwRegionRects *GetRegion() { return m_pRegion.get(); } void DelRegion(); /// New Interface for StarView Drawing diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index 464b96e1fa5a..8cc6d4e8797b 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -91,7 +91,6 @@ SwViewShellImp::SwViewShellImp( SwViewShell *pParent ) : m_pDrawView( nullptr ), m_pSdrPageView( nullptr ), m_pFirstVisiblePage( nullptr ), - m_pRegion( nullptr ), m_pLayAction( nullptr ), m_pIdleAct( nullptr ), m_pAccessibleMap( nullptr ), @@ -124,7 +123,7 @@ SwViewShellImp::~SwViewShellImp() void SwViewShellImp::DelRegion() { - DELETEZ(m_pRegion); + m_pRegion.reset(); } bool SwViewShellImp::AddPaintRect( const SwRect &rRect ) @@ -137,7 +136,7 @@ bool SwViewShellImp::AddPaintRect( const SwRect &rRect ) // In case of normal rendering, this makes sure only visible rectangles are painted. // Otherwise get the rectangle of the full document, so all paint rectangles are invalidated. const SwRect& rArea = comphelper::LibreOfficeKit::isActive() ? m_pShell->GetLayout()->getFrameArea() : m_pShell->VisArea(); - m_pRegion = new SwRegionRects( rArea ); + m_pRegion.reset(new SwRegionRects(rArea)); } (*m_pRegion) -= rRect; return true; diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 8afd0f6d60a2..7617bb42a996 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -320,7 +320,7 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd ) { SwRootFrame* pCurrentLayout = GetLayout(); - Imp()->m_pRegion = nullptr; + (void) Imp()->m_pRegion.release(); // pRegion owns it now //First Invert then Compress, never the other way round! pRegion->Invert(); |