diff options
author | JUN FANG <jun_fang@foxitsoftware.com> | 2015-04-06 12:39:51 -0700 |
---|---|---|
committer | JUN FANG <jun_fang@foxitsoftware.com> | 2015-04-06 12:39:51 -0700 |
commit | f15807369f2fc3c346cfe06b1d9d847de0feee1d (patch) | |
tree | 266821bacd0a2ce316e8ee41dbaf89b471234de6 /fpdfsdk/src/javascript/Field.cpp | |
parent | 6fcecb529007b65596f0ce30efde571f820df56b (diff) | |
download | pdfium-f15807369f2fc3c346cfe06b1d9d847de0feee1d.tar.xz |
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.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp index 771b3660ec..85b7d12c3f 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 { |