Remove page parameter from FORM_SetFocusedAnnot().
It should not be necessary, as the annot parameter, which is backed by a
CPDF_AnnotContext, already has its own page member. To make it work,
change the CPDF_AnnotContext's page member from a CPDF_Page to an
IPDF_Page.
Change-Id: I8eb92c14e691f8f97b8a26f46861b2d1ff45de94
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/68632
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
index 0f7f48c..fc479e6 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
@@ -759,23 +759,21 @@
if (!m_pInfo || m_pInfo->version < 2 || !m_pInfo->FFI_OnFocusChange)
return;
- if ((*pAnnot)->AsXFAWidget()) {
- // TODO(crbug.com/pdfium/1482): Handle XFA case.
+ // TODO(crbug.com/pdfium/1482): Handle XFA case.
+ if ((*pAnnot)->AsXFAWidget())
return;
- }
CPDFSDK_PageView* pPageView = (*pAnnot)->GetPageView();
if (!pPageView->IsValid())
return;
- CPDF_Page* cpdf_page = (*pAnnot)->GetPDFPage();
- if (!cpdf_page)
+ IPDF_Page* page = (*pAnnot)->GetPage();
+ if (!page)
return;
CPDF_Dictionary* annot_dict = (*pAnnot)->GetPDFAnnot()->GetAnnotDict();
- auto focused_annot =
- pdfium::MakeUnique<CPDF_AnnotContext>(annot_dict, cpdf_page);
+ auto focused_annot = pdfium::MakeUnique<CPDF_AnnotContext>(annot_dict, page);
FPDF_ANNOTATION fpdf_annot =
FPDFAnnotationFromCPDFAnnotContext(focused_annot.get());