Index: fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp |
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp |
index 6e8f6711cd22207ea1954e3226f0adc32003e98f..1d4b36efd772ed219a5ee0fe267f92b4667e2431 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()); |
dsinclair
2016/10/11 17:37:45
We get the runtime from the env, which will have t
|
- 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); |
} |