diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-06-30 10:33:50 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-06-30 11:08:54 +0200 |
commit | 82307b16f89250d5fd724806f51823a38f7e202f (patch) | |
tree | 9edb0bb236b3a9cf8d6c941680523ef170562bde /sw | |
parent | af9d02a24bc61c9a531157ed6a49b25c47668277 (diff) |
sw rendercontext: update drawlayer in SwViewShell::Paint
Fixes warnings on startup like:
warn:legacy.osl:13026:1:svx/source/svdraw/svdpntv.cxx:813: SdrPaintView::UpdateDrawLayersRegion: No SdrPaintWindow (!)
when double buffering is enabled for SwEditWin.
Change-Id: I3dd8019a158b7d50c5e460abf504da31aabe72c3
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 33e85d1a1c8a..d65d2135d49a 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -1669,17 +1669,23 @@ class RenderContextGuard { VclPtr<vcl::RenderContext>& m_pRef; vcl::RenderContext* m_pOriginalValue; + SwViewShell* m_pShell; public: - RenderContextGuard(VclPtr<vcl::RenderContext>& pRef, vcl::RenderContext* pValue) + RenderContextGuard(VclPtr<vcl::RenderContext>& pRef, vcl::RenderContext* pValue, SwViewShell* pShell) : m_pRef(pRef), - m_pOriginalValue(m_pRef) + m_pOriginalValue(m_pRef), + m_pShell(pShell) { m_pRef = pValue; + if (pValue != m_pShell->GetWin() && m_pShell->Imp()->GetDrawView()) + m_pShell->Imp()->GetDrawView()->AddWindowToPaintView(pValue); } ~RenderContextGuard() { + if (m_pRef != m_pShell->GetWin() && m_pShell->Imp()->GetDrawView()) + m_pShell->Imp()->GetDrawView()->DeleteWindowFromPaintView(m_pRef); m_pRef = m_pOriginalValue; } }; @@ -1687,7 +1693,7 @@ public: void SwViewShell::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRect) { - RenderContextGuard aGuard(mpOut, &rRenderContext); + RenderContextGuard aGuard(mpOut, &rRenderContext, this); if ( mnLockPaint ) { if ( Imp()->bSmoothUpdate ) @@ -1846,12 +1852,6 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex aMapMode.SetScaleY(scaleY); rDevice.SetMapMode(aMapMode); - // Update this device in DrawLayer - if (Imp()->GetDrawView()) - { - Imp()->GetDrawView()->AddWindowToPaintView(&rDevice); - } - Rectangle aOutRect = Rectangle(Point(tilePosX, tilePosY), rDevice.PixelToLogic(Size(contextWidth, contextHeight))); @@ -1870,12 +1870,6 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex // draw - works in logic coordinates Paint(rDevice, aOutRect); - // Remove this device in DrawLayer - if (Imp()->GetDrawView()) - { - Imp()->GetDrawView()->DeleteWindowFromPaintView(&rDevice); - } - // SwViewShell's output device tear down mpOut = pSaveOut; mbInLibreOfficeKitCallback = false; |