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

SwViewShell::Paint: restore old render context at the end

The idea is that mpOut is only used for non-drawing purposes outside
Paint(), e.g. to do logic <-> pixel conversion.

Change-Id: Ia83cd32dd0a5152dcfc1644e92af08b4ddf4653c
Reviewed-on: https://gerrit.libreoffice.org/16584Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
(cherry picked from commit 98d2d985)
üst 82645beb
......@@ -1664,9 +1664,32 @@ bool SwViewShell::CheckInvalidForPaint( const SwRect &rRect )
return bRet;
}
namespace
{
/// Similar to comphelper::FlagRestorationGuard, but for vcl::RenderContext.
class RenderContextGuard
{
VclPtr<vcl::RenderContext>& m_pRef;
vcl::RenderContext* m_pOriginalValue;
public:
RenderContextGuard(VclPtr<vcl::RenderContext>& pRef, vcl::RenderContext* pValue)
: m_pRef(pRef),
m_pOriginalValue(m_pRef)
{
m_pRef = pValue;
}
~RenderContextGuard()
{
m_pRef = m_pOriginalValue;
}
};
}
void SwViewShell::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRect)
{
mpOut = &rRenderContext;
RenderContextGuard aGuard(mpOut, &rRenderContext);
if ( mnLockPaint )
{
if ( Imp()->bSmoothUpdate )
......
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