summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-10-11 12:38:01 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-11 12:38:01 -0700
commit82e1767b757d96e6b81d3e42b24048a9bea387a8 (patch)
treeb7d14dfcd42ce6acf7a5552be0ff185cf0a9ed58 /fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
parent9fa95efa11f211a6faf9b2adb27211f784aee89a (diff)
downloadpdfium-82e1767b757d96e6b81d3e42b24048a9bea387a8.tar.xz
Convert IJS_Runtime to CPDFSDK_FormFillEnvironment
This CL changes the use of CPDFSDK_Document to CPDFSDK_FormFillEnvironment. Review-Url: https://codereview.chromium.org/2394313002
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);
}