diff options
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp | 22 | ||||
-rw-r--r-- | fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h | 11 | ||||
-rw-r--r-- | fpdfsdk/javascript/JS_Runtime_Stub.cpp | 4 | ||||
-rw-r--r-- | fpdfsdk/javascript/cjs_runtime.cpp | 18 | ||||
-rw-r--r-- | fpdfsdk/javascript/cjs_runtime.h | 8 | ||||
-rw-r--r-- | fpdfsdk/javascript/ijs_runtime.h | 8 |
6 files changed, 31 insertions, 40 deletions
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp index 701d999908..f207760398 100644 --- a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp +++ b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp @@ -1214,18 +1214,18 @@ FX_BOOL CPDFXFA_Document::_SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) { FX_BOOL CPDFXFA_Document::SetGlobalProperty(CXFA_FFDoc* hDoc, const CFX_ByteStringC& szPropName, - FXJSE_HVALUE hValue) { + CFXJSE_Value* pValue) { if (hDoc != m_pXFADoc) return FALSE; if (m_pSDKDoc && m_pSDKDoc->GetEnv()->GetJSRuntime()) - return m_pSDKDoc->GetEnv()->GetJSRuntime()->SetHValueByName(szPropName, - hValue); + return m_pSDKDoc->GetEnv()->GetJSRuntime()->SetValueByName(szPropName, + pValue); return FALSE; } FX_BOOL CPDFXFA_Document::GetPDFScriptObject(CXFA_FFDoc* hDoc, const CFX_ByteStringC& utf8Name, - FXJSE_HVALUE hValue) { + CFXJSE_Value* pValue) { if (hDoc != m_pXFADoc) return FALSE; @@ -1237,12 +1237,11 @@ FX_BOOL CPDFXFA_Document::GetPDFScriptObject(CXFA_FFDoc* hDoc, m_pJSContext = m_pSDKDoc->GetEnv()->GetJSRuntime()->NewContext(); } - return _GetHValueByName(utf8Name, hValue, - m_pSDKDoc->GetEnv()->GetJSRuntime()); + return m_pSDKDoc->GetEnv()->GetJSRuntime()->GetValueByName(utf8Name, pValue); } FX_BOOL CPDFXFA_Document::GetGlobalProperty(CXFA_FFDoc* hDoc, const CFX_ByteStringC& szPropName, - FXJSE_HVALUE hValue) { + CFXJSE_Value* pValue) { if (hDoc != m_pXFADoc) return FALSE; if (!m_pSDKDoc || !m_pSDKDoc->GetEnv()->GetJSRuntime()) @@ -1253,11 +1252,6 @@ FX_BOOL CPDFXFA_Document::GetGlobalProperty(CXFA_FFDoc* hDoc, m_pJSContext = m_pSDKDoc->GetEnv()->GetJSRuntime()->NewContext(); } - return _GetHValueByName(szPropName, hValue, - m_pSDKDoc->GetEnv()->GetJSRuntime()); -} -FX_BOOL CPDFXFA_Document::_GetHValueByName(const CFX_ByteStringC& utf8Name, - FXJSE_HVALUE hValue, - IJS_Runtime* runTime) { - return runTime->GetHValueByName(utf8Name, hValue); + return m_pSDKDoc->GetEnv()->GetJSRuntime()->GetValueByName(szPropName, + pValue); } diff --git a/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h b/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h index d54b77abea..9cab4d941b 100644 --- a/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h +++ b/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h @@ -163,17 +163,17 @@ class CPDFXFA_Document : public IXFA_DocProvider { return FALSE; } - // Get PDF javascript object, set the object to hValue. + // Get PDF javascript object, set the object to pValue. virtual FX_BOOL GetPDFScriptObject(CXFA_FFDoc* hDoc, const CFX_ByteStringC& utf8Name, - FXJSE_HVALUE hValue); + CFXJSE_Value* pValue); virtual FX_BOOL GetGlobalProperty(CXFA_FFDoc* hDoc, const CFX_ByteStringC& szPropName, - FXJSE_HVALUE hValue); + CFXJSE_Value* pValue); virtual FX_BOOL SetGlobalProperty(CXFA_FFDoc* hDoc, const CFX_ByteStringC& szPropName, - FXJSE_HVALUE hValue); + CFXJSE_Value* pValue); virtual CPDF_Document* OpenPDF(CXFA_FFDoc* hDoc, IFX_FileRead* pFile, FX_BOOL bTakeOverFile) { @@ -183,9 +183,6 @@ class CPDFXFA_Document : public IXFA_DocProvider { virtual IFX_FileRead* OpenLinkedFile(CXFA_FFDoc* hDoc, const CFX_WideString& wsLink); - FX_BOOL _GetHValueByName(const CFX_ByteStringC& utf8Name, - FXJSE_HVALUE hValue, - IJS_Runtime* runTime); FX_BOOL _OnBeforeNotifySumbit(); void _OnAfterNotifySumbit(); FX_BOOL _NotifySubmit(FX_BOOL bPrevOrPost); diff --git a/fpdfsdk/javascript/JS_Runtime_Stub.cpp b/fpdfsdk/javascript/JS_Runtime_Stub.cpp index 7d201d1b56..e94f8c7780 100644 --- a/fpdfsdk/javascript/JS_Runtime_Stub.cpp +++ b/fpdfsdk/javascript/JS_Runtime_Stub.cpp @@ -139,11 +139,11 @@ class CJS_RuntimeStub final : public IJS_Runtime { CPDFSDK_Document* GetReaderDocument() override { return m_pDoc; } #ifdef PDF_ENABLE_XFA - FX_BOOL GetHValueByName(const CFX_ByteStringC&, FXJSE_HVALUE) override { + FX_BOOL GetValueByName(const CFX_ByteStringC&, CFXJSE_Value*) override { return FALSE; } - FX_BOOL SetHValueByName(const CFX_ByteStringC&, FXJSE_HVALUE) override { + FX_BOOL SetValueByName(const CFX_ByteStringC&, CFXJSE_Value*) override { return FALSE; } #endif // PDF_ENABLE_XFA diff --git a/fpdfsdk/javascript/cjs_runtime.cpp b/fpdfsdk/javascript/cjs_runtime.cpp index 8fd7cf1a0e..bcdc17c386 100644 --- a/fpdfsdk/javascript/cjs_runtime.cpp +++ b/fpdfsdk/javascript/cjs_runtime.cpp @@ -260,8 +260,8 @@ CFX_WideString ChangeObjName(const CFX_WideString& str) { sRet.Replace(L"_", L"."); return sRet; } -FX_BOOL CJS_Runtime::GetHValueByName(const CFX_ByteStringC& utf8Name, - FXJSE_HVALUE hValue) { +FX_BOOL CJS_Runtime::GetValueByName(const CFX_ByteStringC& utf8Name, + CFXJSE_Value* pValue) { #ifdef PDF_ENABLE_XFA const FX_CHAR* name = utf8Name.c_str(); @@ -287,18 +287,18 @@ FX_BOOL CJS_Runtime::GetHValueByName(const CFX_ByteStringC& utf8Name, GetIsolate(), name, v8::String::kNormalString, utf8Name.GetLength())); if (propvalue.IsEmpty()) { - FXJSE_Value_SetUndefined(hValue); + FXJSE_Value_SetUndefined(pValue); return FALSE; } - ((CFXJSE_Value*)hValue)->ForceSetValue(propvalue); + pValue->ForceSetValue(propvalue); #endif return TRUE; } -FX_BOOL CJS_Runtime::SetHValueByName(const CFX_ByteStringC& utf8Name, - FXJSE_HVALUE hValue) { +FX_BOOL CJS_Runtime::SetValueByName(const CFX_ByteStringC& utf8Name, + CFXJSE_Value* pValue) { #ifdef PDF_ENABLE_XFA - if (utf8Name.IsEmpty() || hValue == NULL) + if (utf8Name.IsEmpty() || !pValue) return FALSE; const FX_CHAR* name = utf8Name.c_str(); v8::Isolate* pIsolate = GetIsolate(); @@ -311,8 +311,8 @@ FX_BOOL CJS_Runtime::SetHValueByName(const CFX_ByteStringC& utf8Name, // v8::Local<v8::Context> tmpCotext = // v8::Local<v8::Context>::New(GetIsolate(), m_context); - v8::Local<v8::Value> propvalue = v8::Local<v8::Value>::New( - GetIsolate(), ((CFXJSE_Value*)hValue)->DirectGetValue()); + v8::Local<v8::Value> propvalue = + v8::Local<v8::Value>::New(GetIsolate(), pValue->DirectGetValue()); context->Global()->Set( v8::String::NewFromUtf8(pIsolate, name, v8::String::kNormalString, utf8Name.GetLength()), diff --git a/fpdfsdk/javascript/cjs_runtime.h b/fpdfsdk/javascript/cjs_runtime.h index e2091fdcfd..cc0f6545ac 100644 --- a/fpdfsdk/javascript/cjs_runtime.h +++ b/fpdfsdk/javascript/cjs_runtime.h @@ -64,10 +64,10 @@ class CJS_Runtime : public IJS_Runtime { v8::Local<v8::Array> GetConstArray(const CFX_WideString& name); #ifdef PDF_ENABLE_XFA - FX_BOOL GetHValueByName(const CFX_ByteStringC& utf8Name, - FXJSE_HVALUE hValue) override; - FX_BOOL SetHValueByName(const CFX_ByteStringC& utf8Name, - FXJSE_HVALUE hValue) override; + FX_BOOL GetValueByName(const CFX_ByteStringC& utf8Name, + CFXJSE_Value* pValue) override; + FX_BOOL SetValueByName(const CFX_ByteStringC& utf8Name, + CFXJSE_Value* pValue) override; #endif // PDF_ENABLE_XFA void AddObserver(Observer* observer); diff --git a/fpdfsdk/javascript/ijs_runtime.h b/fpdfsdk/javascript/ijs_runtime.h index d4e9000cfd..ef80feb820 100644 --- a/fpdfsdk/javascript/ijs_runtime.h +++ b/fpdfsdk/javascript/ijs_runtime.h @@ -35,10 +35,10 @@ class IJS_Runtime { CFX_WideString* info) = 0; #ifdef PDF_ENABLE_XFA - virtual FX_BOOL GetHValueByName(const CFX_ByteStringC& utf8Name, - FXJSE_HVALUE hValue) = 0; - virtual FX_BOOL SetHValueByName(const CFX_ByteStringC& utf8Name, - FXJSE_HVALUE hValue) = 0; + virtual FX_BOOL GetValueByName(const CFX_ByteStringC& utf8Name, + CFXJSE_Value* pValue) = 0; + virtual FX_BOOL SetValueByName(const CFX_ByteStringC& utf8Name, + CFXJSE_Value* pValue) = 0; #endif // PDF_ENABLE_XFA protected: |