sw/source/core/inc/viewimp.hxx | 5 +++-- sw/source/core/view/viewimp.cxx | 5 ++--- sw/source/core/view/viewsh.cxx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
New commits: commit 29b34d1700ae8752f9698c3c49875cedb951e9e2 Author: Michael Stahl <mst...@redhat.com> Date: Fri Feb 16 23:51:56 2018 +0100 sw: convert DELETEZ to unique_ptr in SwViewShellImp Change-Id: If5c26f1a7892368c244f4d46aab7d36a22c83504 Reviewed-on: https://gerrit.libreoffice.org/49991 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Michael Stahl <mst...@redhat.com> 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(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits