From 1087ebcd9a2b59c540b80f8a1f3275ae1ff6bcc9 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Fri, 16 Feb 2018 19:31:39 +0000 Subject: Fix mouse pointer in XFA forms. This CL changes the XFA code in FPDFPage_HasFormFieldAtPoint() to return the actual form field the mouse is over, and not always FormFieldType::kXFA. Bug: chromium:811331 Change-Id: I4157f58d057972dc2f4e79036493e079c611c9ec Reviewed-on: https://pdfium-review.googlesource.com/26970 Reviewed-by: Ryan Harrison Commit-Queue: Ryan Harrison --- fpdfsdk/fpdfformfill.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp index eba1ac5656..2f219f2f9d 100644 --- a/fpdfsdk/fpdfformfill.cpp +++ b/fpdfsdk/fpdfformfill.cpp @@ -253,7 +253,10 @@ FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, CXFA_FFWidget* pXFAAnnot; while ((pXFAAnnot = pWidgetIterator->MoveToNext()) != nullptr) { - CFX_RectF rcBBox = pXFAAnnot->GetBBox(0); + if (pXFAAnnot->GetFormFieldType() == FormFieldType::kXFA) + continue; + + CFX_RectF rcBBox = pXFAAnnot->GetWidgetRect(); CFX_FloatRect rcWidget(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width, rcBBox.top + rcBBox.height); rcWidget.Inflate(1.0f, 1.0f); -- cgit v1.2.3