Kaydet (Commit) 29b34d17 authored tarafından Michael Stahl's avatar Michael Stahl

sw: convert DELETEZ to unique_ptr in SwViewShellImp

Change-Id: If5c26f1a7892368c244f4d46aab7d36a22c83504
Reviewed-on: https://gerrit.libreoffice.org/49991Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 76d5b9d0
......@@ -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
......
......@@ -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;
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment