Disambiguate CPDFSDK_FormFillEnvironment::GetPageView().
Rename one version to GetPageViewAtIndex().
Change-Id: Ieac296e6cc075f6712f3174d800bb2923faa937b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/67592
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_annotiterator_embeddertest.cpp b/fpdfsdk/cpdfsdk_annotiterator_embeddertest.cpp
index 161ae95..651e46b 100644
--- a/fpdfsdk/cpdfsdk_annotiterator_embeddertest.cpp
+++ b/fpdfsdk/cpdfsdk_annotiterator_embeddertest.cpp
@@ -44,7 +44,7 @@
{
// Page 0 specifies "row order".
- CPDFSDK_AnnotIterator iter(pFormFillEnv->GetPageView(0),
+ CPDFSDK_AnnotIterator iter(pFormFillEnv->GetPageViewAtIndex(0),
CPDF_Annot::Subtype::WIDGET);
CPDFSDK_Annot* pAnnot = iter.GetFirstAnnot();
CheckRect(pAnnot->GetRect(), RightTop);
@@ -70,7 +70,7 @@
}
{
// Page 1 specifies "column order"
- CPDFSDK_AnnotIterator iter(pFormFillEnv->GetPageView(1),
+ CPDFSDK_AnnotIterator iter(pFormFillEnv->GetPageViewAtIndex(1),
CPDF_Annot::Subtype::WIDGET);
CPDFSDK_Annot* pAnnot = iter.GetFirstAnnot();
CheckRect(pAnnot->GetRect(), RightTop);
@@ -96,7 +96,7 @@
}
{
// Page 2 specifies "struct order"
- CPDFSDK_AnnotIterator iter(pFormFillEnv->GetPageView(2),
+ CPDFSDK_AnnotIterator iter(pFormFillEnv->GetPageViewAtIndex(2),
CPDF_Annot::Subtype::WIDGET);
CPDFSDK_Annot* pAnnot = iter.GetFirstAnnot();
CheckRect(pAnnot->GetRect(), LeftBottom);
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
index 73a065d..9ac7f86 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
@@ -583,7 +583,7 @@
return pPageView;
}
-CPDFSDK_PageView* CPDFSDK_FormFillEnvironment::GetPageView(int nIndex) {
+CPDFSDK_PageView* CPDFSDK_FormFillEnvironment::GetPageViewAtIndex(int nIndex) {
IPDF_Page* pTempPage = GetPage(nIndex);
if (!pTempPage)
return nullptr;
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.h b/fpdfsdk/cpdfsdk_formfillenvironment.h
index b3dbdb1..b7da081 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.h
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.h
@@ -9,6 +9,7 @@
#include <map>
#include <memory>
+#include <vector>
#include "core/fpdfapi/page/cpdf_occontext.h"
#include "core/fpdfapi/page/cpdf_page.h"
@@ -65,7 +66,7 @@
void SetCursor(int32_t nCursorType) override;
CPDFSDK_PageView* GetPageView(IPDF_Page* pUnderlyingPage, bool renew);
- CPDFSDK_PageView* GetPageView(int nIndex);
+ CPDFSDK_PageView* GetPageViewAtIndex(int nIndex);
void RemovePageView(IPDF_Page* pUnderlyingPage);
void UpdateAllViews(CPDFSDK_PageView* pSender, CPDFSDK_Annot* pAnnot);
diff --git a/fpdfsdk/cpdfsdk_interactiveform.cpp b/fpdfsdk/cpdfsdk_interactiveform.cpp
index c745238..098a917 100644
--- a/fpdfsdk/cpdfsdk_interactiveform.cpp
+++ b/fpdfsdk/cpdfsdk_interactiveform.cpp
@@ -140,13 +140,13 @@
if (CPDF_Dictionary* pPageDict = pControlDict->GetDictFor("P")) {
int nPageIndex = pDocument->GetPageIndex(pPageDict->GetObjNum());
if (nPageIndex >= 0)
- pPage = m_pFormFillEnv->GetPageView(nPageIndex);
+ pPage = m_pFormFillEnv->GetPageViewAtIndex(nPageIndex);
}
if (!pPage) {
int nPageIndex = GetPageIndexByAnnotDict(pDocument, pControlDict);
if (nPageIndex >= 0)
- pPage = m_pFormFillEnv->GetPageView(nPageIndex);
+ pPage = m_pFormFillEnv->GetPageViewAtIndex(nPageIndex);
}
return pPage ? ToCPDFSDKWidget(pPage->GetAnnotByDict(pControlDict)) : nullptr;
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
index 11d1e49..b7ee561 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
@@ -550,7 +550,8 @@
int pageViewCount = m_pContext->GetFormFillEnv()->GetPageViewCount();
for (int i = 0; i < pageViewCount; i++) {
- CPDFSDK_PageView* pPageView = m_pContext->GetFormFillEnv()->GetPageView(i);
+ CPDFSDK_PageView* pPageView =
+ m_pContext->GetFormFillEnv()->GetPageViewAtIndex(i);
if (!pPageView)
continue;
diff --git a/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp b/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp
index 7d3dd4d..ac50f0c 100644
--- a/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp
+++ b/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp
@@ -33,7 +33,7 @@
m_pFormFillEnv =
CPDFSDKFormFillEnvironmentFromFPDFFormHandle(form_handle());
- CPDFSDK_AnnotIterator iter(m_pFormFillEnv->GetPageView(0),
+ CPDFSDK_AnnotIterator iter(m_pFormFillEnv->GetPageViewAtIndex(0),
CPDF_Annot::Subtype::WIDGET);
// User editable combobox.
@@ -64,8 +64,8 @@
pInteractiveFormFiller->GetFormFillerForTesting(pAnnotCombobox);
ASSERT_TRUE(m_pFormFiller);
- CPWL_Wnd* pWindow =
- m_pFormFiller->GetPWLWindow(m_pFormFillEnv->GetPageView(0), false);
+ CPWL_Wnd* pWindow = m_pFormFiller->GetPWLWindow(
+ m_pFormFillEnv->GetPageViewAtIndex(0), false);
ASSERT_TRUE(pWindow);
m_pComboBox = static_cast<CPWL_ComboBox*>(pWindow);
}
diff --git a/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp b/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp
index 8b68afa..e17ba5d 100644
--- a/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp
@@ -33,7 +33,7 @@
m_pFormFillEnv =
CPDFSDKFormFillEnvironmentFromFPDFFormHandle(form_handle());
- CPDFSDK_AnnotIterator iter(m_pFormFillEnv->GetPageView(0),
+ CPDFSDK_AnnotIterator iter(m_pFormFillEnv->GetPageViewAtIndex(0),
CPDF_Annot::Subtype::WIDGET);
// Normal text field.
m_pAnnot = iter.GetFirstAnnot();
@@ -70,8 +70,8 @@
pInteractiveFormFiller->GetFormFillerForTesting(pAnnotTextField);
ASSERT_TRUE(m_pFormFiller);
- CPWL_Wnd* pWindow =
- m_pFormFiller->GetPWLWindow(m_pFormFillEnv->GetPageView(0), false);
+ CPWL_Wnd* pWindow = m_pFormFiller->GetPWLWindow(
+ m_pFormFillEnv->GetPageViewAtIndex(0), false);
ASSERT_TRUE(pWindow);
m_pEdit = static_cast<CPWL_Edit*>(pWindow);
}
diff --git a/fpdfsdk/pwl/cpwl_special_button_embeddertest.cpp b/fpdfsdk/pwl/cpwl_special_button_embeddertest.cpp
index bd6eea0..c99e488 100644
--- a/fpdfsdk/pwl/cpwl_special_button_embeddertest.cpp
+++ b/fpdfsdk/pwl/cpwl_special_button_embeddertest.cpp
@@ -30,7 +30,7 @@
ASSERT_TRUE(page_);
formfill_env_ = CPDFSDKFormFillEnvironmentFromFPDFFormHandle(form_handle());
- CPDFSDK_AnnotIterator it(formfill_env_->GetPageView(0),
+ CPDFSDK_AnnotIterator it(formfill_env_->GetPageViewAtIndex(0),
CPDF_Annot::Subtype::WIDGET);
// Read only check box.
@@ -74,7 +74,8 @@
form_filler_ = interactive_formfiller->GetFormFillerForTesting(annot);
ASSERT_TRUE(form_filler_);
- window_ = form_filler_->GetPWLWindow(formfill_env_->GetPageView(0), true);
+ window_ =
+ form_filler_->GetPWLWindow(formfill_env_->GetPageViewAtIndex(0), true);
ASSERT_TRUE(window_);
}
diff --git a/fxjs/cjs_document.cpp b/fxjs/cjs_document.cpp
index c432fe6..6782596 100644
--- a/fxjs/cjs_document.cpp
+++ b/fxjs/cjs_document.cpp
@@ -1014,7 +1014,7 @@
int nPageNo = pRuntime->ToInt32(params[0]);
WideString swAnnotName = pRuntime->ToWideString(params[1]);
- CPDFSDK_PageView* pPageView = m_pFormFillEnv->GetPageView(nPageNo);
+ CPDFSDK_PageView* pPageView = m_pFormFillEnv->GetPageViewAtIndex(nPageNo);
if (!pPageView)
return CJS_Result::Failure(JSMessage::kBadObjectError);
@@ -1056,7 +1056,7 @@
int nPageNo = m_pFormFillEnv->GetPageCount();
v8::Local<v8::Array> annots = pRuntime->NewArray();
for (int i = 0; i < nPageNo; ++i) {
- CPDFSDK_PageView* pPageView = m_pFormFillEnv->GetPageView(i);
+ CPDFSDK_PageView* pPageView = m_pFormFillEnv->GetPageViewAtIndex(i);
if (!pPageView)
return CJS_Result::Failure(JSMessage::kBadObjectError);