summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp')
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
index 6e8f6711cd..1d4b36efd7 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
@@ -1012,13 +1012,10 @@ FX_BOOL CPDFXFA_DocEnvironment::GetGlobalProperty(
!m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime())
return FALSE;
- if (!m_pJSContext) {
- m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()->SetReaderDocument(
- m_pDocument->GetSDKDoc());
- m_pJSContext =
- m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()->NewContext();
- }
+ CPDFSDK_FormFillEnvironment* pFormFillEnv =
+ m_pDocument->GetSDKDoc()->GetEnv();
+ if (!m_pJSContext)
+ m_pJSContext = pFormFillEnv->GetJSRuntime()->NewContext();
- return m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()->GetValueByName(
- szPropName, pValue);
+ return pFormFillEnv->GetJSRuntime()->GetValueByName(szPropName, pValue);
}