From 2592eaaa19304827ba9dbedbe2075b8c81c9e2cf Mon Sep 17 00:00:00 2001 From: Jun Fang Date: Wed, 2 Dec 2015 14:09:28 +0800 Subject: Fix overlapped focus widget BUG=pdfium:294 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1487573002 . --- fpdfsdk/src/fsdk_mgr.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp index 401da497f1..4d2dbc166c 100644 --- a/fpdfsdk/src/fsdk_mgr.cpp +++ b/fpdfsdk/src/fsdk_mgr.cpp @@ -669,7 +669,7 @@ void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, #ifdef PDF_ENABLE_XFA CPDFXFA_Page* pPage = GetPDFXFAPage(); - if (pPage == NULL) + if (!pPage) return; if (pPage->GetDocument()->GetDocType() == DOCTYPE_DYNAMIC_XFA) { @@ -686,11 +686,20 @@ void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, return; CXFA_RenderOptions renderOptions; renderOptions.m_bHighlight = TRUE; - pRenderContext->StartRender(pPage->GetXFAPageView(), &gs, *pUser2Device, - renderOptions); + IXFA_PageView* xfaView = pPage->GetXFAPageView(); + pRenderContext->StartRender(xfaView, &gs, *pUser2Device, renderOptions); pRenderContext->DoRender(); pRenderContext->StopRender(); pRenderContext->Release(); + IXFA_DocView* docView = xfaView->GetDocView(); + if (!docView) + return; + CPDFSDK_Annot* annot = GetFocusAnnot(); + if (!annot) + return; + // Render the focus widget + docView->GetWidgetHandler()->RenderWidget(annot->GetXFAWidget(), &gs, + pUser2Device, FALSE); return; } #endif // PDF_ENABLE_XFA -- cgit v1.2.3