summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/Field.cpp
diff options
context:
space:
mode:
authorJUN FANG <jun_fang@foxitsoftware.com>2015-04-06 12:39:51 -0700
committerJUN FANG <jun_fang@foxitsoftware.com>2015-04-06 12:44:08 -0700
commit33f6f0d9822b729f85a9ff7593ad82240ae22bf6 (patch)
treeba0d637dc9a18766a07b52c66135e58192bfc198 /fpdfsdk/src/javascript/Field.cpp
parente799e01bc6c8ef491154c555687ccaa8f9c87b6c (diff)
downloadpdfium-33f6f0d9822b729f85a9ff7593ad82240ae22bf6.tar.xz
Merge to XFA: Fix a fatal error due to cloning a global document object
BUG=454595 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1053373002
Diffstat (limited to 'fpdfsdk/src/javascript/Field.cpp')
-rw-r--r--fpdfsdk/src/javascript/Field.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index 00a0659743..94c54395f3 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -1500,26 +1500,22 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel
FX_BOOL Field::doc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- ASSERT(m_pJSDoc != NULL);
-
- if (!vp.IsGetting())return FALSE;
-
- vp << (CJS_Object*)(*m_pJSDoc);
-
+ if (!vp.IsGetting()) {
+ return FALSE;
+ }
+ vp << m_pJSDoc->GetCJSDoc();
return TRUE;
}
FX_BOOL Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
-
if (vp.IsSetting())
{
if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
-
}
else
{