Always pass NULL |hWidget| in FFI_PopupMenu().

This is an API object of type FPDF_WIDGET, and there aren't any
public interfaces for the caller to do anything with that kind
of an object. About all an embedder could do would be to check
if it is the same as in a previous call, but the underlying
object is deep in XFA and Observable, and may come and go at will.

Handing out a pointer to such an XFA object feels dangerous. So
make it NULL despite the public API change.

Change-Id: I6a97b40b4d58b025d0b7c1928d67be4f22be6e40
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/59311
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_helpers.h b/fpdfsdk/cpdfsdk_helpers.h
index 0f7947a..6171969 100644
--- a/fpdfsdk/cpdfsdk_helpers.h
+++ b/fpdfsdk/cpdfsdk_helpers.h
@@ -44,11 +44,6 @@
 class FX_PATHPOINT;
 struct CPDF_JavaScript;
 
-#ifdef PDF_ENABLE_XFA
-class CPDFXFA_Page;
-class CXFA_FFWidget;
-#endif  // PDF_ENABLE_XFA
-
 // Conversions to/from underlying types.
 IPDF_Page* IPDFPageFromFPDFPage(FPDF_PAGE page);
 FPDF_PAGE FPDFPageFromIPDFPage(IPDF_Page* page);
@@ -220,17 +215,9 @@
 CPDFSDK_InteractiveForm* FormHandleToInteractiveForm(FPDF_FORMHANDLE hHandle);
 
 ByteString ByteStringFromFPDFWideString(FPDF_WIDESTRING wide_string);
-
 WideString WideStringFromFPDFWideString(FPDF_WIDESTRING wide_string);
 
 #ifdef PDF_ENABLE_XFA
-inline FPDF_WIDGET FPDFWidgetFromCXFAFFWidget(CXFA_FFWidget* widget) {
-  return reinterpret_cast<FPDF_WIDGET>(widget);
-}
-inline CXFA_FFWidget* CXFAFFWidgetFromFPDFWidget(FPDF_WIDGET widget) {
-  return reinterpret_cast<CXFA_FFWidget*>(widget);
-}
-
 // Layering prevents fxcrt from knowing about FPDF_FILEHANDLER, so this can't
 // be a static method of IFX_SeekableStream.
 RetainPtr<IFX_SeekableStream> MakeSeekableStream(
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
index fe51b80..16fd3e1 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
@@ -268,8 +268,7 @@
   if (hWidget->CanSelectAll())
     menuFlag |= FXFA_MENU_SELECTALL;
 
-  return pFormFillEnv->PopupMenu(
-      pPage.Get(), FPDFWidgetFromCXFAFFWidget(hWidget), menuFlag, ptPopup);
+  return pFormFillEnv->PopupMenu(pPage.Get(), nullptr, menuFlag, ptPopup);
 }
 
 void CPDFXFA_DocEnvironment::PageViewEvent(CXFA_FFPageView* pPageView,
diff --git a/public/fpdf_formfill.h b/public/fpdf_formfill.h
index bf5005c..abb72bb 100644
--- a/public/fpdf_formfill.h
+++ b/public/fpdf_formfill.h
@@ -889,7 +889,7 @@
    * Parameters:
    *     pThis           -   Pointer to the interface structure itself.
    *     page            -   Handle to page. Returned by FPDF_LoadPage().
-   *     hWidget         -   Handle to XFA fields.
+   *     hWidget         -   Always null, exists for compatibility.
    *     menuFlag        -   The menu flags. Please refer to macro definition
    *                         of FXFA_MENU_XXX and this can be one or a
    *                         combination of these macros.