Kaydet (Commit) d0526157 authored tarafından Miklos Vajna's avatar Miklos Vajna Kaydeden (comit) Andras Timar

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
(cherry picked from commit 82307b16)
üst 6ee22424
...@@ -1669,17 +1669,23 @@ class RenderContextGuard ...@@ -1669,17 +1669,23 @@ class RenderContextGuard
{ {
VclPtr<vcl::RenderContext>& m_pRef; VclPtr<vcl::RenderContext>& m_pRef;
vcl::RenderContext* m_pOriginalValue; vcl::RenderContext* m_pOriginalValue;
SwViewShell* m_pShell;
public: public:
RenderContextGuard(VclPtr<vcl::RenderContext>& pRef, vcl::RenderContext* pValue) RenderContextGuard(VclPtr<vcl::RenderContext>& pRef, vcl::RenderContext* pValue, SwViewShell* pShell)
: m_pRef(pRef), : m_pRef(pRef),
m_pOriginalValue(m_pRef) m_pOriginalValue(m_pRef),
m_pShell(pShell)
{ {
m_pRef = pValue; m_pRef = pValue;
if (pValue != m_pShell->GetWin() && m_pShell->Imp()->GetDrawView())
m_pShell->Imp()->GetDrawView()->AddWindowToPaintView(pValue);
} }
~RenderContextGuard() ~RenderContextGuard()
{ {
if (m_pRef != m_pShell->GetWin() && m_pShell->Imp()->GetDrawView())
m_pShell->Imp()->GetDrawView()->DeleteWindowFromPaintView(m_pRef);
m_pRef = m_pOriginalValue; m_pRef = m_pOriginalValue;
} }
}; };
...@@ -1687,7 +1693,7 @@ public: ...@@ -1687,7 +1693,7 @@ public:
void SwViewShell::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRect) void SwViewShell::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRect)
{ {
RenderContextGuard aGuard(mpOut, &rRenderContext); RenderContextGuard aGuard(mpOut, &rRenderContext, this);
if ( mnLockPaint ) if ( mnLockPaint )
{ {
if ( Imp()->bSmoothUpdate ) if ( Imp()->bSmoothUpdate )
...@@ -1846,12 +1852,6 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex ...@@ -1846,12 +1852,6 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
aMapMode.SetScaleY(scaleY); aMapMode.SetScaleY(scaleY);
rDevice.SetMapMode(aMapMode); rDevice.SetMapMode(aMapMode);
// Update this device in DrawLayer
if (Imp()->GetDrawView())
{
Imp()->GetDrawView()->AddWindowToPaintView(&rDevice);
}
Rectangle aOutRect = Rectangle(Point(tilePosX, tilePosY), Rectangle aOutRect = Rectangle(Point(tilePosX, tilePosY),
rDevice.PixelToLogic(Size(contextWidth, contextHeight))); rDevice.PixelToLogic(Size(contextWidth, contextHeight)));
...@@ -1870,12 +1870,6 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex ...@@ -1870,12 +1870,6 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
// draw - works in logic coordinates // draw - works in logic coordinates
Paint(rDevice, aOutRect); Paint(rDevice, aOutRect);
// Remove this device in DrawLayer
if (Imp()->GetDrawView())
{
Imp()->GetDrawView()->DeleteWindowFromPaintView(&rDevice);
}
// SwViewShell's output device tear down // SwViewShell's output device tear down
mpOut = pSaveOut; mpOut = pSaveOut;
mbInLibreOfficeKitCallback = false; mbInLibreOfficeKitCallback = false;
......
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