summaryrefslogtreecommitdiff
path: root/fxjs
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-11 16:56:00 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-11 16:56:00 +0000
commit073ecf4192469ee4485c826dcee0cb8ece1b94a2 (patch)
treeaa6687acc434a24977b547144aa896168eaccc7b /fxjs
parentc345065e7aff3368198624f303e711a244e2f7ec (diff)
downloadpdfium-073ecf4192469ee4485c826dcee0cb8ece1b94a2.tar.xz
Rename InterForm classes to InteractiveForm.
Shorten some names to try to avoid CPDF_InteractiveForm* pInteractiveForm = GetInteractiveForm(); Change-Id: I77fafd6c4cce20aa46908830afde12f87784680e Reviewed-on: https://pdfium-review.googlesource.com/c/43815 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs')
-rw-r--r--fxjs/cjs_app.cpp3
-rw-r--r--fxjs/cjs_document.cpp40
-rw-r--r--fxjs/cjs_document.h8
-rw-r--r--fxjs/cjs_field.cpp105
-rw-r--r--fxjs/cjs_publicmethods.cpp10
5 files changed, 81 insertions, 85 deletions
diff --git a/fxjs/cjs_app.cpp b/fxjs/cjs_app.cpp
index c51bd9dca2..97ff37872a 100644
--- a/fxjs/cjs_app.cpp
+++ b/fxjs/cjs_app.cpp
@@ -128,7 +128,8 @@ CJS_Result CJS_App::get_calculate(CJS_Runtime* pRuntime) {
CJS_Result CJS_App::set_calculate(CJS_Runtime* pRuntime,
v8::Local<v8::Value> vp) {
m_bCalculate = pRuntime->ToBoolean(vp);
- pRuntime->GetFormFillEnv()->GetInterForm()->EnableCalculate(m_bCalculate);
+ pRuntime->GetFormFillEnv()->GetInteractiveForm()->EnableCalculate(
+ m_bCalculate);
return CJS_Result::Success();
}
diff --git a/fxjs/cjs_document.cpp b/fxjs/cjs_document.cpp
index 483124acf4..6e2f2da6c6 100644
--- a/fxjs/cjs_document.cpp
+++ b/fxjs/cjs_document.cpp
@@ -209,7 +209,7 @@ CJS_Result CJS_Document::get_num_fields(CJS_Runtime* pRuntime) {
if (!m_pFormFillEnv)
return CJS_Result::Failure(JSMessage::kBadObjectError);
- CPDF_InterForm* pPDFForm = GetCoreInterForm();
+ CPDF_InteractiveForm* pPDFForm = GetCoreInteractiveForm();
return CJS_Result::Success(pRuntime->NewNumber(
static_cast<int>(pPDFForm->CountFields(WideString()))));
}
@@ -319,7 +319,7 @@ CJS_Result CJS_Document::getField(
return CJS_Result::Failure(JSMessage::kBadObjectError);
WideString wideName = pRuntime->ToWideString(params[0]);
- CPDF_InterForm* pPDFForm = GetCoreInterForm();
+ CPDF_InteractiveForm* pPDFForm = GetCoreInteractiveForm();
if (pPDFForm->CountFields(wideName) <= 0)
return CJS_Result::Success(pRuntime->NewUndefined());
@@ -350,7 +350,7 @@ CJS_Result CJS_Document::getNthFieldName(
if (nIndex < 0)
return CJS_Result::Failure(JSMessage::kValueError);
- CPDF_InterForm* pPDFForm = GetCoreInterForm();
+ CPDF_InteractiveForm* pPDFForm = GetCoreInteractiveForm();
CPDF_FormField* pField = pPDFForm->GetField(nIndex, WideString());
if (!pField)
return CJS_Result::Failure(JSMessage::kBadObjectError);
@@ -390,8 +390,8 @@ CJS_Result CJS_Document::mailForm(
if (!m_pFormFillEnv->GetPermissions(FPDFPERM_EXTRACT_ACCESS))
return CJS_Result::Failure(JSMessage::kPermissionError);
- CPDFSDK_InterForm* pInterForm = GetSDKInterForm();
- ByteString sTextBuf = pInterForm->ExportFormToFDFTextBuf();
+ CPDFSDK_InteractiveForm* pInteractiveForm = GetSDKInteractiveForm();
+ ByteString sTextBuf = pInteractiveForm->ExportFormToFDFTextBuf();
if (sTextBuf.GetLength() == 0)
return CJS_Result::Failure(L"Bad FDF format.");
@@ -486,9 +486,9 @@ CJS_Result CJS_Document::removeField(
return CJS_Result::Failure(JSMessage::kPermissionError);
WideString sFieldName = pRuntime->ToWideString(params[0]);
- CPDFSDK_InterForm* pInterForm = GetSDKInterForm();
+ CPDFSDK_InteractiveForm* pInteractiveForm = GetSDKInteractiveForm();
std::vector<CPDFSDK_Annot::ObservedPtr> widgets;
- pInterForm->GetWidgets(sFieldName, &widgets);
+ pInteractiveForm->GetWidgets(sFieldName, &widgets);
if (widgets.empty())
return CJS_Result::Success();
@@ -533,7 +533,7 @@ CJS_Result CJS_Document::resetForm(
return CJS_Result::Failure(JSMessage::kPermissionError);
}
- CPDF_InterForm* pPDFForm = GetCoreInterForm();
+ CPDF_InteractiveForm* pPDFForm = GetCoreInteractiveForm();
if (params.empty()) {
pPDFForm->ResetForm(NotificationOption::kNotify);
m_pFormFillEnv->SetChangeMark();
@@ -609,11 +609,11 @@ CJS_Result CJS_Document::submitForm(
aFields = pRuntime->ToArray(pRuntime->GetObjectProperty(pObj, L"aFields"));
}
- CPDF_InterForm* pPDFForm = GetCoreInterForm();
+ CPDF_InteractiveForm* pPDFForm = GetCoreInteractiveForm();
if (pRuntime->GetArrayLength(aFields) == 0 && bEmpty) {
if (pPDFForm->CheckRequiredFields(nullptr, true)) {
pRuntime->BeginBlock();
- GetSDKInterForm()->SubmitForm(strURL, false);
+ GetSDKInteractiveForm()->SubmitForm(strURL, false);
pRuntime->EndBlock();
}
return CJS_Result::Success();
@@ -634,7 +634,7 @@ CJS_Result CJS_Document::submitForm(
if (pPDFForm->CheckRequiredFields(&fieldObjects, true)) {
pRuntime->BeginBlock();
- GetSDKInterForm()->SubmitFields(strURL, fieldObjects, true, !bFDF);
+ GetSDKInteractiveForm()->SubmitFields(strURL, fieldObjects, true, !bFDF);
pRuntime->EndBlock();
}
return CJS_Result::Success();
@@ -970,9 +970,9 @@ CJS_Result CJS_Document::get_calculate(CJS_Runtime* pRuntime) {
if (!m_pFormFillEnv)
return CJS_Result::Failure(JSMessage::kBadObjectError);
- CPDFSDK_InterForm* pInterForm = GetSDKInterForm();
+ CPDFSDK_InteractiveForm* pInteractiveForm = GetSDKInteractiveForm();
return CJS_Result::Success(
- pRuntime->NewBoolean(!!pInterForm->IsCalculateEnabled()));
+ pRuntime->NewBoolean(!!pInteractiveForm->IsCalculateEnabled()));
}
CJS_Result CJS_Document::set_calculate(CJS_Runtime* pRuntime,
@@ -980,8 +980,8 @@ CJS_Result CJS_Document::set_calculate(CJS_Runtime* pRuntime,
if (!m_pFormFillEnv)
return CJS_Result::Failure(JSMessage::kBadObjectError);
- CPDFSDK_InterForm* pInterForm = GetSDKInterForm();
- pInterForm->EnableCalculate(pRuntime->ToBoolean(vp));
+ CPDFSDK_InteractiveForm* pInteractiveForm = GetSDKInteractiveForm();
+ pInteractiveForm->EnableCalculate(pRuntime->ToBoolean(vp));
return CJS_Result::Success();
}
@@ -1262,7 +1262,7 @@ CJS_Result CJS_Document::calculateNow(
return CJS_Result::Failure(JSMessage::kPermissionError);
}
- GetSDKInterForm()->OnCalculate(nullptr);
+ GetSDKInteractiveForm()->OnCalculate(nullptr);
return CJS_Result::Success();
}
@@ -1479,10 +1479,10 @@ void CJS_Document::DoFieldDelay(const WideString& sFieldName,
CJS_Field::DoDelay(m_pFormFillEnv.Get(), pData.get());
}
-CPDF_InterForm* CJS_Document::GetCoreInterForm() {
- return GetSDKInterForm()->GetInterForm();
+CPDF_InteractiveForm* CJS_Document::GetCoreInteractiveForm() {
+ return GetSDKInteractiveForm()->GetInteractiveForm();
}
-CPDFSDK_InterForm* CJS_Document::GetSDKInterForm() {
- return m_pFormFillEnv->GetInterForm();
+CPDFSDK_InteractiveForm* CJS_Document::GetSDKInteractiveForm() {
+ return m_pFormFillEnv->GetInteractiveForm();
}
diff --git a/fxjs/cjs_document.h b/fxjs/cjs_document.h
index b415c82868..5232803989 100644
--- a/fxjs/cjs_document.h
+++ b/fxjs/cjs_document.h
@@ -14,8 +14,8 @@
#include "core/fxcrt/observable.h"
#include "fxjs/js_define.h"
-class CPDFSDK_InterForm;
-class CPDF_InterForm;
+class CPDFSDK_InteractiveForm;
+class CPDF_InteractiveForm;
class CPDF_TextObject;
struct CJS_DelayData;
@@ -306,8 +306,8 @@ class CJS_Document final : public CJS_Object, public Observable<CJS_Document> {
v8::Local<v8::Value> vp,
const ByteString& propName);
- CPDF_InterForm* GetCoreInterForm();
- CPDFSDK_InterForm* GetSDKInterForm();
+ CPDF_InteractiveForm* GetCoreInteractiveForm();
+ CPDFSDK_InteractiveForm* GetSDKInteractiveForm();
WideString m_cwBaseURL;
CPDFSDK_FormFillEnvironment::ObservedPtr m_pFormFillEnv;
diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp
index 628eb440df..ca8c62451c 100644
--- a/fxjs/cjs_field.cpp
+++ b/fxjs/cjs_field.cpp
@@ -45,11 +45,11 @@ void UpdateFormField(CPDFSDK_FormFillEnvironment* pFormFillEnv,
bool bChangeMark,
bool bResetAP,
bool bRefresh) {
- CPDFSDK_InterForm* pInterForm = pFormFillEnv->GetInterForm();
+ CPDFSDK_InteractiveForm* pForm = pFormFillEnv->GetInteractiveForm();
if (bResetAP) {
std::vector<CPDFSDK_Annot::ObservedPtr> widgets;
- pInterForm->GetWidgets(pFormField, &widgets);
+ pForm->GetWidgets(pFormField, &widgets);
if (IsComboBoxOrTextField(pFormField)) {
for (auto& pObserved : widgets) {
@@ -74,16 +74,16 @@ void UpdateFormField(CPDFSDK_FormFillEnvironment* pFormFillEnv,
// to be removed from the list. We need to call |GetWidgets| again to be
// sure none of the widgets have been deleted.
std::vector<CPDFSDK_Annot::ObservedPtr> widgets;
- pInterForm->GetWidgets(pFormField, &widgets);
+ pForm->GetWidgets(pFormField, &widgets);
// TODO(dsinclair): Determine if all widgets share the same
- // CPDFSDK_InterForm. If that's the case, we can move the code to
+ // CPDFSDK_InteractiveForm. If that's the case, we can move the code to
// |GetFormFillEnv| out of the loop.
for (auto& pObserved : widgets) {
if (pObserved) {
CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pObserved.Get());
- pWidget->GetInterForm()->GetFormFillEnv()->UpdateAllViews(nullptr,
- pWidget);
+ pWidget->GetInteractiveForm()->GetFormFillEnv()->UpdateAllViews(
+ nullptr, pWidget);
}
}
}
@@ -99,7 +99,7 @@ void UpdateFormControl(CPDFSDK_FormFillEnvironment* pFormFillEnv,
bool bRefresh) {
ASSERT(pFormControl);
- CPDFSDK_InterForm* pForm = pFormFillEnv->GetInterForm();
+ CPDFSDK_InteractiveForm* pForm = pFormFillEnv->GetInteractiveForm();
CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl);
if (pWidget) {
@@ -120,8 +120,8 @@ void UpdateFormControl(CPDFSDK_FormFillEnvironment* pFormFillEnv,
}
if (bRefresh) {
- CPDFSDK_InterForm* pInterForm = pWidget->GetInterForm();
- pInterForm->GetFormFillEnv()->UpdateAllViews(nullptr, pWidget);
+ CPDFSDK_InteractiveForm* pWidgetForm = pWidget->GetInteractiveForm();
+ pWidgetForm->GetFormFillEnv()->UpdateAllViews(nullptr, pWidget);
}
}
@@ -133,10 +133,10 @@ std::vector<CPDF_FormField*> GetFormFieldsForName(
CPDFSDK_FormFillEnvironment* pFormFillEnv,
const WideString& csFieldName) {
std::vector<CPDF_FormField*> fields;
- CPDFSDK_InterForm* pReaderInterForm = pFormFillEnv->GetInterForm();
- CPDF_InterForm* pInterForm = pReaderInterForm->GetInterForm();
- for (int i = 0, sz = pInterForm->CountFields(csFieldName); i < sz; ++i) {
- if (CPDF_FormField* pFormField = pInterForm->GetField(i, csFieldName))
+ CPDFSDK_InteractiveForm* pReaderForm = pFormFillEnv->GetInteractiveForm();
+ CPDF_InteractiveForm* pForm = pReaderForm->GetInteractiveForm();
+ for (int i = 0, sz = pForm->CountFields(csFieldName); i < sz; ++i) {
+ if (CPDF_FormField* pFormField = pForm->GetField(i, csFieldName))
fields.push_back(pFormField);
}
return fields;
@@ -202,13 +202,12 @@ void SetBorderStyle(CPDFSDK_FormFillEnvironment* pFormFillEnv,
std::vector<CPDF_FormField*> FieldArray =
GetFormFieldsForName(pFormFillEnv, swFieldName);
- auto* pInterForm = pFormFillEnv->GetInterForm();
+ auto* pForm = pFormFillEnv->GetInteractiveForm();
for (CPDF_FormField* pFormField : FieldArray) {
if (nControlIndex < 0) {
bool bSet = false;
for (int i = 0, sz = pFormField->CountControls(); i < sz; ++i) {
- CPDFSDK_Widget* pWidget =
- pInterForm->GetWidget(pFormField->GetControl(i));
+ CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormField->GetControl(i));
if (pWidget) {
if (pWidget->GetBorderStyle() != nBorderStyle) {
pWidget->SetBorderStyle(nBorderStyle);
@@ -223,7 +222,7 @@ void SetBorderStyle(CPDFSDK_FormFillEnvironment* pFormFillEnv,
return;
if (CPDF_FormControl* pFormControl =
pFormField->GetControl(nControlIndex)) {
- CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl);
+ CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl);
if (pWidget) {
if (pWidget->GetBorderStyle() != nBorderStyle) {
pWidget->SetBorderStyle(nBorderStyle);
@@ -266,7 +265,7 @@ void SetDisplay(CPDFSDK_FormFillEnvironment* pFormFillEnv,
const WideString& swFieldName,
int nControlIndex,
int number) {
- CPDFSDK_InterForm* pInterForm = pFormFillEnv->GetInterForm();
+ CPDFSDK_InteractiveForm* pForm = pFormFillEnv->GetInteractiveForm();
std::vector<CPDF_FormField*> FieldArray =
GetFormFieldsForName(pFormFillEnv, swFieldName);
for (CPDF_FormField* pFormField : FieldArray) {
@@ -276,7 +275,7 @@ void SetDisplay(CPDFSDK_FormFillEnvironment* pFormFillEnv,
CPDF_FormControl* pFormControl = pFormField->GetControl(i);
ASSERT(pFormControl);
- CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl);
+ CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl);
if (SetWidgetDisplayStatus(pWidget, number))
bAnySet = true;
}
@@ -291,7 +290,7 @@ void SetDisplay(CPDFSDK_FormFillEnvironment* pFormFillEnv,
if (!pFormControl)
return;
- CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl);
+ CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl);
if (SetWidgetDisplayStatus(pWidget, number))
UpdateFormControl(pFormFillEnv, pFormControl, true, false, true);
}
@@ -310,7 +309,7 @@ void SetLineWidth(CPDFSDK_FormFillEnvironment* pFormFillEnv,
const WideString& swFieldName,
int nControlIndex,
int number) {
- CPDFSDK_InterForm* pInterForm = pFormFillEnv->GetInterForm();
+ CPDFSDK_InteractiveForm* pForm = pFormFillEnv->GetInteractiveForm();
std::vector<CPDF_FormField*> FieldArray =
GetFormFieldsForName(pFormFillEnv, swFieldName);
for (CPDF_FormField* pFormField : FieldArray) {
@@ -320,7 +319,7 @@ void SetLineWidth(CPDFSDK_FormFillEnvironment* pFormFillEnv,
CPDF_FormControl* pFormControl = pFormField->GetControl(i);
ASSERT(pFormControl);
- if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) {
+ if (CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl)) {
if (number != pWidget->GetBorderWidth()) {
pWidget->SetBorderWidth(number);
bSet = true;
@@ -334,7 +333,7 @@ void SetLineWidth(CPDFSDK_FormFillEnvironment* pFormFillEnv,
return;
if (CPDF_FormControl* pFormControl =
pFormField->GetControl(nControlIndex)) {
- if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) {
+ if (CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl)) {
if (number != pWidget->GetBorderWidth()) {
pWidget->SetBorderWidth(number);
UpdateFormControl(pFormFillEnv, pFormControl, true, true, true);
@@ -349,7 +348,7 @@ void SetRect(CPDFSDK_FormFillEnvironment* pFormFillEnv,
const WideString& swFieldName,
int nControlIndex,
const CFX_FloatRect& rect) {
- CPDFSDK_InterForm* pInterForm = pFormFillEnv->GetInterForm();
+ CPDFSDK_InteractiveForm* pForm = pFormFillEnv->GetInteractiveForm();
std::vector<CPDF_FormField*> FieldArray =
GetFormFieldsForName(pFormFillEnv, swFieldName);
for (CPDF_FormField* pFormField : FieldArray) {
@@ -359,7 +358,7 @@ void SetRect(CPDFSDK_FormFillEnvironment* pFormFillEnv,
CPDF_FormControl* pFormControl = pFormField->GetControl(i);
ASSERT(pFormControl);
- if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) {
+ if (CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl)) {
CFX_FloatRect crRect = rect;
CPDF_Page* pPDFPage = pWidget->GetPDFPage();
@@ -386,7 +385,7 @@ void SetRect(CPDFSDK_FormFillEnvironment* pFormFillEnv,
return;
if (CPDF_FormControl* pFormControl =
pFormField->GetControl(nControlIndex)) {
- if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) {
+ if (CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl)) {
CFX_FloatRect crRect = rect;
CPDF_Page* pPDFPage = pWidget->GetPDFPage();
crRect.Intersect(pPDFPage->GetBBox());
@@ -608,12 +607,12 @@ bool CJS_Field::AttachField(CJS_Document* pDocument,
m_pFormFillEnv->GetPermissions(FPDFPERM_ANNOT_FORM) ||
m_pFormFillEnv->GetPermissions(FPDFPERM_MODIFY);
- CPDFSDK_InterForm* pRDInterForm = m_pFormFillEnv->GetInterForm();
- CPDF_InterForm* pInterForm = pRDInterForm->GetInterForm();
+ CPDFSDK_InteractiveForm* pRDForm = m_pFormFillEnv->GetInteractiveForm();
+ CPDF_InteractiveForm* pForm = pRDForm->GetInteractiveForm();
WideString swFieldNameTemp = csFieldName;
swFieldNameTemp.Replace(L"..", L".");
- if (pInterForm->CountFields(swFieldNameTemp) <= 0) {
+ if (pForm->CountFields(swFieldNameTemp) <= 0) {
std::wstring strFieldName;
int iControlNo = -1;
ParseFieldName(swFieldNameTemp.c_str(), strFieldName, iControlNo);
@@ -700,7 +699,7 @@ CJS_Result CJS_Field::get_border_style(CJS_Runtime* pRuntime) {
if (!pFormField)
return CJS_Result::Failure(JSMessage::kBadObjectError);
- CPDFSDK_Widget* pWidget = m_pFormFillEnv->GetInterForm()->GetWidget(
+ CPDFSDK_Widget* pWidget = m_pFormFillEnv->GetInteractiveForm()->GetWidget(
GetSmartFieldControl(pFormField));
if (!pWidget)
return CJS_Result::Failure(JSMessage::kBadObjectError);
@@ -919,10 +918,10 @@ CJS_Result CJS_Field::get_calc_order_index(CJS_Runtime* pRuntime) {
if (!IsComboBoxOrTextField(pFormField))
return CJS_Result::Failure(JSMessage::kObjectTypeError);
- CPDFSDK_InterForm* pRDInterForm = m_pFormFillEnv->GetInterForm();
- CPDF_InterForm* pInterForm = pRDInterForm->GetInterForm();
- return CJS_Result::Success(pRuntime->NewNumber(static_cast<int32_t>(
- pInterForm->FindFieldInCalculationOrder(pFormField))));
+ CPDFSDK_InteractiveForm* pRDForm = m_pFormFillEnv->GetInteractiveForm();
+ CPDF_InteractiveForm* pForm = pRDForm->GetInteractiveForm();
+ return CJS_Result::Success(pRuntime->NewNumber(
+ static_cast<int32_t>(pForm->FindFieldInCalculationOrder(pFormField))));
}
CJS_Result CJS_Field::set_calc_order_index(CJS_Runtime* pRuntime,
@@ -1151,9 +1150,8 @@ CJS_Result CJS_Field::get_display(CJS_Runtime* pRuntime) {
if (!pFormField)
return CJS_Result::Failure(JSMessage::kBadObjectError);
- CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
- CPDFSDK_Widget* pWidget =
- pInterForm->GetWidget(GetSmartFieldControl(pFormField));
+ CPDFSDK_InteractiveForm* pForm = m_pFormFillEnv->GetInteractiveForm();
+ CPDFSDK_Widget* pWidget = pForm->GetWidget(GetSmartFieldControl(pFormField));
if (!pWidget)
return CJS_Result::Failure(JSMessage::kBadObjectError);
@@ -1344,9 +1342,8 @@ CJS_Result CJS_Field::get_hidden(CJS_Runtime* pRuntime) {
if (!pFormField)
return CJS_Result::Failure(JSMessage::kBadObjectError);
- CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
- CPDFSDK_Widget* pWidget =
- pInterForm->GetWidget(GetSmartFieldControl(pFormField));
+ CPDFSDK_InteractiveForm* pForm = m_pFormFillEnv->GetInteractiveForm();
+ CPDFSDK_Widget* pWidget = pForm->GetWidget(GetSmartFieldControl(pFormField));
if (!pWidget)
return CJS_Result::Failure(JSMessage::kBadObjectError);
@@ -1416,11 +1413,11 @@ CJS_Result CJS_Field::get_line_width(CJS_Runtime* pRuntime) {
if (!pFormControl)
return CJS_Result::Failure(JSMessage::kBadObjectError);
- CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
+ CPDFSDK_InteractiveForm* pForm = m_pFormFillEnv->GetInteractiveForm();
if (!pFormField->CountControls())
return CJS_Result::Failure(JSMessage::kBadObjectError);
- CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(0));
+ CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormField->GetControl(0));
if (!pWidget)
return CJS_Result::Failure(JSMessage::kBadObjectError);
@@ -1518,7 +1515,7 @@ CJS_Result CJS_Field::get_page(CJS_Runtime* pRuntime) {
return CJS_Result::Failure(JSMessage::kBadObjectError);
std::vector<CPDFSDK_Annot::ObservedPtr> widgets;
- m_pFormFillEnv->GetInterForm()->GetWidgets(pFormField, &widgets);
+ m_pFormFillEnv->GetInteractiveForm()->GetWidgets(pFormField, &widgets);
if (widgets.empty())
return CJS_Result::Success(pRuntime->NewNumber(-1));
@@ -1568,13 +1565,12 @@ CJS_Result CJS_Field::set_password(CJS_Runtime* pRuntime,
}
CJS_Result CJS_Field::get_print(CJS_Runtime* pRuntime) {
- CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
+ CPDFSDK_InteractiveForm* pForm = m_pFormFillEnv->GetInteractiveForm();
CPDF_FormField* pFormField = GetFirstFormField();
if (!pFormField)
return CJS_Result::Failure(JSMessage::kBadObjectError);
- CPDFSDK_Widget* pWidget =
- pInterForm->GetWidget(GetSmartFieldControl(pFormField));
+ CPDFSDK_Widget* pWidget = pForm->GetWidget(GetSmartFieldControl(pFormField));
if (!pWidget)
return CJS_Result::Failure(JSMessage::kBadObjectError);
@@ -1584,7 +1580,7 @@ CJS_Result CJS_Field::get_print(CJS_Runtime* pRuntime) {
CJS_Result CJS_Field::set_print(CJS_Runtime* pRuntime,
v8::Local<v8::Value> vp) {
- CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
+ CPDFSDK_InteractiveForm* pForm = m_pFormFillEnv->GetInteractiveForm();
std::vector<CPDF_FormField*> FieldArray = GetFormFields();
if (FieldArray.empty())
return CJS_Result::Failure(JSMessage::kBadObjectError);
@@ -1597,7 +1593,7 @@ CJS_Result CJS_Field::set_print(CJS_Runtime* pRuntime,
bool bSet = false;
for (int i = 0, sz = pFormField->CountControls(); i < sz; ++i) {
if (CPDFSDK_Widget* pWidget =
- pInterForm->GetWidget(pFormField->GetControl(i))) {
+ pForm->GetWidget(pFormField->GetControl(i))) {
uint32_t dwFlags = pWidget->GetFlags();
if (pRuntime->ToBoolean(vp))
dwFlags |= ANNOTFLAG_PRINT;
@@ -1622,7 +1618,7 @@ CJS_Result CJS_Field::set_print(CJS_Runtime* pRuntime,
if (CPDF_FormControl* pFormControl =
pFormField->GetControl(m_nFormControlIndex)) {
- if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) {
+ if (CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl)) {
uint32_t dwFlags = pWidget->GetFlags();
if (pRuntime->ToBoolean(vp))
dwFlags |= ANNOTFLAG_PRINT;
@@ -1687,9 +1683,8 @@ CJS_Result CJS_Field::get_rect(CJS_Runtime* pRuntime) {
if (!pFormField)
return CJS_Result::Failure(JSMessage::kBadObjectError);
- CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
- CPDFSDK_Widget* pWidget =
- pInterForm->GetWidget(GetSmartFieldControl(pFormField));
+ CPDFSDK_InteractiveForm* pForm = m_pFormFillEnv->GetInteractiveForm();
+ CPDFSDK_Widget* pWidget = pForm->GetWidget(GetSmartFieldControl(pFormField));
if (!pWidget)
return CJS_Result::Failure(JSMessage::kBadObjectError);
@@ -2494,10 +2489,10 @@ CJS_Result CJS_Field::setFocus(
if (nCount < 1)
return CJS_Result::Failure(JSMessage::kBadObjectError);
- CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
+ CPDFSDK_InteractiveForm* pForm = m_pFormFillEnv->GetInteractiveForm();
CPDFSDK_Widget* pWidget = nullptr;
if (nCount == 1) {
- pWidget = pInterForm->GetWidget(pFormField->GetControl(0));
+ pWidget = pForm->GetWidget(pFormField->GetControl(0));
} else {
IPDF_Page* pPage = IPDFPageFromFPDFPage(m_pFormFillEnv->GetCurrentPage());
if (!pPage)
@@ -2506,7 +2501,7 @@ CJS_Result CJS_Field::setFocus(
m_pFormFillEnv->GetPageView(pPage, true)) {
for (int32_t i = 0; i < nCount; i++) {
if (CPDFSDK_Widget* pTempWidget =
- pInterForm->GetWidget(pFormField->GetControl(i))) {
+ pForm->GetWidget(pFormField->GetControl(i))) {
if (pTempWidget->GetPDFPage() == pCurPageView->GetPDFPage()) {
pWidget = pTempWidget;
break;
diff --git a/fxjs/cjs_publicmethods.cpp b/fxjs/cjs_publicmethods.cpp
index fb2df6a716..2e0603c982 100644
--- a/fxjs/cjs_publicmethods.cpp
+++ b/fxjs/cjs_publicmethods.cpp
@@ -1584,9 +1584,9 @@ CJS_Result CJS_PublicMethods::AFSimple_Calculate(
if ((params[1].IsEmpty() || !params[1]->IsArray()) && !params[1]->IsString())
return CJS_Result::Failure(JSMessage::kParamError);
- CPDFSDK_InterForm* pReaderInterForm =
- pRuntime->GetFormFillEnv()->GetInterForm();
- CPDF_InterForm* pInterForm = pReaderInterForm->GetInterForm();
+ CPDFSDK_InteractiveForm* pReaderForm =
+ pRuntime->GetFormFillEnv()->GetInteractiveForm();
+ CPDF_InteractiveForm* pForm = pReaderForm->GetInteractiveForm();
WideString sFunction = pRuntime->ToWideString(params[0]);
double dValue = wcscmp(sFunction.c_str(), L"PRD") == 0 ? 1.0 : 0.0;
@@ -1598,8 +1598,8 @@ CJS_Result CJS_PublicMethods::AFSimple_Calculate(
WideString wsFieldName =
pRuntime->ToWideString(pRuntime->GetArrayElement(FieldNameArray, i));
- for (size_t j = 0; j < pInterForm->CountFields(wsFieldName); ++j) {
- CPDF_FormField* pFormField = pInterForm->GetField(j, wsFieldName);
+ for (size_t j = 0; j < pForm->CountFields(wsFieldName); ++j) {
+ CPDF_FormField* pFormField = pForm->GetField(j, wsFieldName);
if (!pFormField)
continue;