| Index: fpdfsdk/javascript/Field.cpp
|
| diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp
|
| index fa2ac70aa515fee47b79a0acfd0b85b241c5f955..435f9bcad59afb36e2daf915059b3f6f0de1c078 100644
|
| --- a/fpdfsdk/javascript/Field.cpp
|
| +++ b/fpdfsdk/javascript/Field.cpp
|
| @@ -217,7 +217,7 @@ FX_BOOL Field::AttachField(Document* pDocument,
|
| m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
|
| m_pDocument->GetPermissions(FPDFPERM_MODIFY);
|
|
|
| - CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetEnv()->GetInterForm();
|
| CPDF_InterForm* pInterForm = pRDInterForm->GetInterForm();
|
| CFX_WideString swFieldNameTemp = csFieldName;
|
| swFieldNameTemp.Replace(L"..", L".");
|
| @@ -244,7 +244,7 @@ std::vector<CPDF_FormField*> Field::GetFormFields(
|
| CPDFSDK_Document* pDocument,
|
| const CFX_WideString& csFieldName) {
|
| std::vector<CPDF_FormField*> fields;
|
| - CPDFSDK_InterForm* pReaderInterForm = pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pReaderInterForm = pDocument->GetEnv()->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))
|
| @@ -263,7 +263,7 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument,
|
| FX_BOOL bChangeMark,
|
| FX_BOOL bResetAP,
|
| FX_BOOL bRefresh) {
|
| - CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm = pDocument->GetEnv()->GetInterForm();
|
|
|
| if (bResetAP) {
|
| std::vector<CPDFSDK_Widget*> widgets;
|
| @@ -296,7 +296,8 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument,
|
| pInterForm->GetWidgets(pFormField, &widgets);
|
|
|
| for (CPDFSDK_Widget* pWidget : widgets) {
|
| - CPDFSDK_Document* pDoc = pWidget->GetInterForm()->GetDocument();
|
| + CPDFSDK_Document* pDoc =
|
| + pWidget->GetInterForm()->GetFormFillEnv()->GetSDKDocument();
|
| pDoc->UpdateAllViews(nullptr, pWidget);
|
| }
|
| }
|
| @@ -312,7 +313,7 @@ void Field::UpdateFormControl(CPDFSDK_Document* pDocument,
|
| FX_BOOL bRefresh) {
|
| ASSERT(pFormControl);
|
|
|
| - CPDFSDK_InterForm* pForm = pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pForm = pDocument->GetEnv()->GetInterForm();
|
| CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl, false);
|
|
|
| if (pWidget) {
|
| @@ -330,7 +331,7 @@ void Field::UpdateFormControl(CPDFSDK_Document* pDocument,
|
|
|
| if (bRefresh) {
|
| CPDFSDK_InterForm* pInterForm = pWidget->GetInterForm();
|
| - CPDFSDK_Document* pDoc = pInterForm->GetDocument();
|
| + CPDFSDK_Document* pDoc = pInterForm->GetFormFillEnv()->GetSDKDocument();
|
| pDoc->UpdateAllViews(nullptr, pWidget);
|
| }
|
| }
|
| @@ -343,7 +344,7 @@ CPDFSDK_Widget* Field::GetWidget(CPDFSDK_Document* pDocument,
|
| CPDF_FormControl* pFormControl,
|
| bool createIfNeeded) {
|
| CPDFSDK_InterForm* pInterForm =
|
| - static_cast<CPDFSDK_InterForm*>(pDocument->GetInterForm());
|
| + static_cast<CPDFSDK_InterForm*>(pDocument->GetEnv()->GetInterForm());
|
| return pInterForm ? pInterForm->GetWidget(pFormControl, createIfNeeded)
|
| : nullptr;
|
| }
|
| @@ -856,7 +857,7 @@ FX_BOOL Field::calcOrderIndex(IJS_Context* cc,
|
| return FALSE;
|
| }
|
|
|
| - CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetEnv()->GetInterForm();
|
| CPDF_InterForm* pInterForm = pRDInterForm->GetInterForm();
|
| vp << (int32_t)pInterForm->FindFieldInCalculationOrder(pFormField);
|
| }
|
| @@ -1259,7 +1260,7 @@ FX_BOOL Field::display(IJS_Context* cc,
|
|
|
| CPDF_FormField* pFormField = FieldArray[0];
|
| ASSERT(pFormField);
|
| - CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm();
|
| CPDFSDK_Widget* pWidget =
|
| pInterForm->GetWidget(GetSmartFieldControl(pFormField), true);
|
| if (!pWidget)
|
| @@ -1289,7 +1290,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| int number) {
|
| - CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm = pDocument->GetEnv()->GetInterForm();
|
| std::vector<CPDF_FormField*> FieldArray =
|
| GetFormFields(pDocument, swFieldName);
|
| for (CPDF_FormField* pFormField : FieldArray) {
|
| @@ -1523,7 +1524,7 @@ FX_BOOL Field::hidden(IJS_Context* cc,
|
|
|
| CPDF_FormField* pFormField = FieldArray[0];
|
| ASSERT(pFormField);
|
| - CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm();
|
| CPDFSDK_Widget* pWidget =
|
| pInterForm->GetWidget(GetSmartFieldControl(pFormField), false);
|
| if (!pWidget)
|
| @@ -1636,7 +1637,7 @@ FX_BOOL Field::lineWidth(IJS_Context* cc,
|
| if (!pFormControl)
|
| return FALSE;
|
|
|
| - CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm();
|
| if (!pFormField->CountControls())
|
| return FALSE;
|
|
|
| @@ -1655,7 +1656,7 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| int number) {
|
| - CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm = pDocument->GetEnv()->GetInterForm();
|
| std::vector<CPDF_FormField*> FieldArray =
|
| GetFormFields(pDocument, swFieldName);
|
| for (CPDF_FormField* pFormField : FieldArray) {
|
| @@ -1828,7 +1829,7 @@ FX_BOOL Field::page(IJS_Context* cc,
|
| return FALSE;
|
|
|
| std::vector<CPDFSDK_Widget*> widgets;
|
| - m_pDocument->GetInterForm()->GetWidgets(pFormField, &widgets);
|
| + m_pDocument->GetEnv()->GetInterForm()->GetWidgets(pFormField, &widgets);
|
|
|
| if (widgets.empty()) {
|
| vp << (int32_t)-1;
|
| @@ -1896,7 +1897,7 @@ void Field::SetPassword(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::print(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm();
|
| std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
|
| if (FieldArray.empty())
|
| return FALSE;
|
| @@ -2062,7 +2063,7 @@ FX_BOOL Field::rect(IJS_Context* cc,
|
| return FALSE;
|
|
|
| CPDF_FormField* pFormField = FieldArray[0];
|
| - CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm();
|
| CPDFSDK_Widget* pWidget =
|
| pInterForm->GetWidget(GetSmartFieldControl(pFormField), true);
|
| if (!pWidget)
|
| @@ -2088,7 +2089,7 @@ void Field::SetRect(CPDFSDK_Document* pDocument,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| const CFX_FloatRect& rect) {
|
| - CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm = pDocument->GetEnv()->GetInterForm();
|
| std::vector<CPDF_FormField*> FieldArray =
|
| GetFormFields(pDocument, swFieldName);
|
| for (CPDF_FormField* pFormField : FieldArray) {
|
| @@ -3197,7 +3198,7 @@ FX_BOOL Field::setFocus(IJS_Context* cc,
|
| if (nCount < 1)
|
| return FALSE;
|
|
|
| - CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm();
|
| CPDFSDK_Widget* pWidget = nullptr;
|
| if (nCount == 1) {
|
| pWidget = pInterForm->GetWidget(pFormField->GetControl(0), false);
|
|
|