Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h" | 7 #include "fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/parser/cpdf_array.h" | 9 #include "core/fpdfapi/parser/cpdf_array.h" |
| 10 #include "core/fpdfapi/parser/cpdf_stream_acc.h" | 10 #include "core/fpdfapi/parser/cpdf_stream_acc.h" |
| (...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1005 FX_BOOL CPDFXFA_DocEnvironment::GetGlobalProperty( | 1005 FX_BOOL CPDFXFA_DocEnvironment::GetGlobalProperty( |
| 1006 CXFA_FFDoc* hDoc, | 1006 CXFA_FFDoc* hDoc, |
| 1007 const CFX_ByteStringC& szPropName, | 1007 const CFX_ByteStringC& szPropName, |
| 1008 CFXJSE_Value* pValue) { | 1008 CFXJSE_Value* pValue) { |
| 1009 if (hDoc != m_pDocument->GetXFADoc()) | 1009 if (hDoc != m_pDocument->GetXFADoc()) |
| 1010 return FALSE; | 1010 return FALSE; |
| 1011 if (!m_pDocument->GetSDKDoc() || | 1011 if (!m_pDocument->GetSDKDoc() || |
| 1012 !m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()) | 1012 !m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()) |
| 1013 return FALSE; | 1013 return FALSE; |
| 1014 | 1014 |
| 1015 if (!m_pJSContext) { | 1015 CPDFSDK_FormFillEnvironment* pFormFillEnv = |
| 1016 m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()->SetReaderDocument( | 1016 m_pDocument->GetSDKDoc()->GetEnv(); |
| 1017 m_pDocument->GetSDKDoc()); | 1017 if (!m_pJSContext) |
|
dsinclair
2016/10/11 17:37:45
We get the runtime from the env, which will have t
| |
| 1018 m_pJSContext = | 1018 m_pJSContext = pFormFillEnv->GetJSRuntime()->NewContext(); |
| 1019 m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()->NewContext(); | |
| 1020 } | |
| 1021 | 1019 |
| 1022 return m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()->GetValueByName( | 1020 return pFormFillEnv->GetJSRuntime()->GetValueByName(szPropName, pValue); |
| 1023 szPropName, pValue); | |
| 1024 } | 1021 } |
| OLD | NEW |