Index: fpdfsdk/javascript/Document.cpp |
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp |
index f5779aa438813fe05d8349c2afe1a427663f993c..38f957cc4ad80abfe22516c43872c5762d1f9d52 100644 |
--- a/fpdfsdk/javascript/Document.cpp |
+++ b/fpdfsdk/javascript/Document.cpp |
@@ -173,7 +173,7 @@ FX_BOOL Document::numFields(IJS_Context* cc, |
sError = JSGetStringFromID(IDS_STRING_JSBADOBJECT); |
return FALSE; |
} |
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); |
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm(); |
CPDF_InterForm* pPDFForm = pInterForm->GetInterForm(); |
vp << static_cast<int>(pPDFForm->CountFields(CFX_WideString())); |
return TRUE; |
@@ -298,7 +298,7 @@ FX_BOOL Document::getField(IJS_Context* cc, |
CJS_Context* pContext = static_cast<CJS_Context*>(cc); |
CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
CFX_WideString wideName = params[0].ToCFXWideString(pRuntime); |
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); |
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm(); |
CPDF_InterForm* pPDFForm = pInterForm->GetInterForm(); |
if (pPDFForm->CountFields(wideName) <= 0) { |
vRet.SetNull(pRuntime); |
@@ -336,7 +336,7 @@ FX_BOOL Document::getNthFieldName(IJS_Context* cc, |
sError = JSGetStringFromID(IDS_STRING_JSVALUEERROR); |
return FALSE; |
} |
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); |
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm(); |
CPDF_InterForm* pPDFForm = pInterForm->GetInterForm(); |
CPDF_FormField* pField = pPDFForm->GetField(nIndex, CFX_WideString()); |
if (!pField) |
@@ -402,7 +402,7 @@ FX_BOOL Document::mailForm(IJS_Context* cc, |
iLength > 4 ? params[4].ToCFXWideString(pRuntime) : L""; |
CFX_WideString cMsg = iLength > 5 ? params[5].ToCFXWideString(pRuntime) : L""; |
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); |
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm(); |
CFX_ByteTextBuf textBuf; |
if (!pInterForm->ExportFormToFDFTextBuf(textBuf)) |
return FALSE; |
@@ -509,7 +509,7 @@ FX_BOOL Document::removeField(IJS_Context* cc, |
CJS_Context* pContext = static_cast<CJS_Context*>(cc); |
CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
CFX_WideString sFieldName = params[0].ToCFXWideString(pRuntime); |
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); |
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm(); |
std::vector<CPDFSDK_Widget*> widgets; |
pInterForm->GetWidgets(sFieldName, &widgets); |
if (widgets.empty()) |
@@ -561,7 +561,7 @@ FX_BOOL Document::resetForm(IJS_Context* cc, |
return FALSE; |
} |
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); |
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm(); |
CPDF_InterForm* pPDFForm = pInterForm->GetInterForm(); |
CJS_Array aName; |
@@ -659,7 +659,7 @@ FX_BOOL Document::submitForm(IJS_Context* cc, |
aFields.Attach(CJS_Value(pRuntime, pValue).ToV8Array(pRuntime)); |
} |
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); |
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm(); |
CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm(); |
if (aFields.GetLength(pRuntime) == 0 && bEmpty) { |
if (pPDFInterForm->CheckRequiredFields(nullptr, true)) { |
@@ -1009,7 +1009,7 @@ FX_BOOL Document::calculate(IJS_Context* cc, |
sError = JSGetStringFromID(IDS_STRING_JSBADOBJECT); |
return FALSE; |
} |
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); |
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm(); |
if (vp.IsGetting()) { |
vp << !!pInterForm->IsCalculateEnabled(); |
} else { |
@@ -1387,7 +1387,7 @@ FX_BOOL Document::calculateNow(IJS_Context* cc, |
sError = JSGetStringFromID(IDS_STRING_JSNOPERMISSION); |
return FALSE; |
} |
- m_pDocument->GetInterForm()->OnCalculate(); |
+ m_pDocument->GetEnv()->GetInterForm()->OnCalculate(); |
return TRUE; |
} |