From b6f0693a4103060f121b229d567127ca88dac752 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 23 May 2018 17:22:54 +0200 Subject: [PATCH] Use wxDCClipper in wxHtmlDCRenderer code Use wxDCClipper instead of manually calling DestroyClippingRegion(). This is simpler and safer and also potentially more correct as wxDCClipper restores the previous clipping region, if any, unlike the old code -- even though this probably doesn't matter here as the printing DC seems unlikely to be clipped. --- src/html/htmprint.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp index c2195cc266..84f77b7df4 100644 --- a/src/html/htmprint.cpp +++ b/src/html/htmprint.cpp @@ -161,12 +161,11 @@ int wxHtmlDCRenderer::Render(int x, int y, wxDefaultHtmlRenderingStyle rstyle; rinfo.SetStyle(&rstyle); m_DC->SetBrush(*wxWHITE_BRUSH); - m_DC->SetClippingRegion(x, y, m_Width, hght); + wxDCClipper clip(*m_DC, x, y, m_Width, hght); m_Cells->Draw(*m_DC, x, (y - from), y, y + hght, rinfo); - m_DC->DestroyClippingRegion(); } if (pbreak < m_Cells->GetHeight()) return pbreak;