summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-05-26 11:14:08 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-26 11:14:08 -0700
commit12a6b0c1bb3ab86a03a84464bed168995ae0d82a (patch)
tree03c381e1eb6afd47f14c76cc3f9b91641a603dff
parentd3e354a43531eaed87e43d9ff2df4525186ea28d (diff)
downloadpdfium-12a6b0c1bb3ab86a03a84464bed168995ae0d82a.tar.xz
Remove FXJSE_HOBJECT and FXJSE_HVALUE for CFXJSE_Value*
This CL replaces FXJSE_HOBJECT and FXJSE_HVALUE with the concrete CFXJSE_Value* type. All variables are renamed to match. Review-Url: https://codereview.chromium.org/2012253002
-rw-r--r--fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp22
-rw-r--r--fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h11
-rw-r--r--fpdfsdk/javascript/JS_Runtime_Stub.cpp4
-rw-r--r--fpdfsdk/javascript/cjs_runtime.cpp18
-rw-r--r--fpdfsdk/javascript/cjs_runtime.h8
-rw-r--r--fpdfsdk/javascript/ijs_runtime.h8
-rw-r--r--xfa/fxfa/app/xfa_ffdochandler.cpp10
-rw-r--r--xfa/fxfa/app/xfa_ffnotify.cpp2
-rw-r--r--xfa/fxfa/app/xfa_ffwidgetacc.cpp20
-rw-r--r--xfa/fxfa/fm2js/xfa_fm2jsapi.cpp4
-rw-r--r--xfa/fxfa/fm2js/xfa_fm2jsapi.h2
-rw-r--r--xfa/fxfa/fm2js/xfa_fm2jscontext.cpp1782
-rw-r--r--xfa/fxfa/fm2js/xfa_fm2jscontext.h257
-rw-r--r--xfa/fxfa/include/fxfa.h6
-rw-r--r--xfa/fxfa/include/fxfa_basic.h2
-rw-r--r--xfa/fxfa/include/fxfa_widget.h4
-rw-r--r--xfa/fxfa/include/xfa_ffdochandler.h6
-rw-r--r--xfa/fxfa/parser/xfa_object.h132
-rw-r--r--xfa/fxfa/parser/xfa_object_imp.cpp400
-rw-r--r--xfa/fxfa/parser/xfa_script.h23
-rw-r--r--xfa/fxfa/parser/xfa_script_datawindow.cpp8
-rw-r--r--xfa/fxfa/parser/xfa_script_datawindow.h8
-rw-r--r--xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp116
-rw-r--r--xfa/fxfa/parser/xfa_script_eventpseudomodel.h34
-rw-r--r--xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp146
-rw-r--r--xfa/fxfa/parser/xfa_script_hostpseudomodel.h30
-rw-r--r--xfa/fxfa/parser/xfa_script_imp.cpp229
-rw-r--r--xfa/fxfa/parser/xfa_script_imp.h42
-rw-r--r--xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp62
-rw-r--r--xfa/fxfa/parser/xfa_script_layoutpseudomodel.h2
-rw-r--r--xfa/fxfa/parser/xfa_script_resolveprocessor.cpp2
-rw-r--r--xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp18
-rw-r--r--xfa/fxjse/cfxjse_arguments.h6
-rw-r--r--xfa/fxjse/class.cpp22
-rw-r--r--xfa/fxjse/context.cpp12
-rw-r--r--xfa/fxjse/dynprop.cpp55
-rw-r--r--xfa/fxjse/include/fxjse.h108
-rw-r--r--xfa/fxjse/value.cpp207
-rw-r--r--xfa/fxjse/value.h2
39 files changed, 1890 insertions, 1940 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:
diff --git a/xfa/fxfa/app/xfa_ffdochandler.cpp b/xfa/fxfa/app/xfa_ffdochandler.cpp
index 389e5ac6da..53ce9c0e26 100644
--- a/xfa/fxfa/app/xfa_ffdochandler.cpp
+++ b/xfa/fxfa/app/xfa_ffdochandler.cpp
@@ -15,7 +15,7 @@ CXFA_FFDocHandler::CXFA_FFDocHandler() {}
CXFA_FFDocHandler::~CXFA_FFDocHandler() {}
-FXJSE_HVALUE CXFA_FFDocHandler::GetXFAScriptObject(CXFA_FFDoc* hDoc) {
+CFXJSE_Value* CXFA_FFDocHandler::GetXFAScriptObject(CXFA_FFDoc* hDoc) {
CXFA_Document* pXFADoc = hDoc->GetXFADoc();
if (!pXFADoc)
return nullptr;
@@ -44,8 +44,8 @@ XFA_ATTRIBUTEENUM CXFA_FFDocHandler::GetRestoreState(CXFA_FFDoc* hDoc) {
FX_BOOL CXFA_FFDocHandler::RunDocScript(CXFA_FFDoc* hDoc,
XFA_SCRIPTTYPE eScriptType,
const CFX_WideStringC& wsScript,
- FXJSE_HVALUE hRetValue,
- FXJSE_HVALUE hThisObject) {
+ CFXJSE_Value* pRetValue,
+ CFXJSE_Value* pThisObject) {
CXFA_Document* pXFADoc = hDoc->GetXFADoc();
if (!pXFADoc)
return FALSE;
@@ -55,7 +55,7 @@ FX_BOOL CXFA_FFDocHandler::RunDocScript(CXFA_FFDoc* hDoc,
return FALSE;
return pScriptContext->RunScript(
- (XFA_SCRIPTLANGTYPE)eScriptType, wsScript, hRetValue,
- hThisObject ? (CXFA_Object*)FXJSE_Value_ToObject(hThisObject, nullptr)
+ (XFA_SCRIPTLANGTYPE)eScriptType, wsScript, pRetValue,
+ pThisObject ? (CXFA_Object*)FXJSE_Value_ToObject(pThisObject, nullptr)
: nullptr);
}
diff --git a/xfa/fxfa/app/xfa_ffnotify.cpp b/xfa/fxfa/app/xfa_ffnotify.cpp
index e8fb4dd1dc..29da4860b3 100644
--- a/xfa/fxfa/app/xfa_ffnotify.cpp
+++ b/xfa/fxfa/app/xfa_ffnotify.cpp
@@ -201,7 +201,7 @@ FX_BOOL CXFA_FFNotify::RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) {
}
CXFA_EventParam EventParam;
EventParam.m_eType = XFA_EVENT_Unknown;
- FXJSE_HVALUE pRetValue = NULL;
+ CFXJSE_Value* pRetValue = nullptr;
int32_t iRet =
pWidgetAcc->ExecuteScript(CXFA_Script(pScript), &EventParam, &pRetValue);
if (iRet == XFA_EVENTERROR_Success && pRetValue) {
diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
index 2c84a7f9b7..1ba6c85804 100644
--- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
@@ -366,7 +366,7 @@ int32_t CXFA_WidgetAcc::ProcessCalculate() {
void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate,
int32_t iRet,
- FXJSE_HVALUE pRetValue,
+ CFXJSE_Value* pRetValue,
FX_BOOL bVersionFlag) {
if (iRet == XFA_EVENTERROR_Success && pRetValue) {
if (FXJSE_Value_IsBoolean(pRetValue) && !FXJSE_Value_ToBoolean(pRetValue)) {
@@ -580,7 +580,7 @@ int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags) {
FX_BOOL bStatus =
m_pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End;
int32_t iFormat = 0;
- FXJSE_HVALUE pRetValue = NULL;
+ CFXJSE_Value* pRetValue = nullptr;
int32_t iRet = XFA_EVENTERROR_NotExist;
CXFA_Script script = validate.GetScript();
if (script) {
@@ -616,7 +616,7 @@ int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags) {
}
int32_t CXFA_WidgetAcc::ExecuteScript(CXFA_Script script,
CXFA_EventParam* pEventParam,
- FXJSE_HVALUE* pRetValue) {
+ CFXJSE_Value** pRetValue) {
static const uint32_t MAX_RECURSION_DEPTH = 2;
if (m_nRecursionDepth > MAX_RECURSION_DEPTH)
return XFA_EVENTERROR_Success;
@@ -645,21 +645,21 @@ int32_t CXFA_WidgetAcc::ExecuteScript(CXFA_Script script,
pEventParam->m_eType == XFA_EVENT_Calculate) {
pContext->SetNodesOfRunScript(&refNodes);
}
- FXJSE_HVALUE hRetValue = FXJSE_Value_Create(pContext->GetRuntime());
+ CFXJSE_Value* pTmpRetValue = FXJSE_Value_Create(pContext->GetRuntime());
++m_nRecursionDepth;
FX_BOOL bRet =
pContext->RunScript((XFA_SCRIPTLANGTYPE)eScriptType,
- wsExpression.AsStringC(), hRetValue, m_pNode);
+ wsExpression.AsStringC(), pTmpRetValue, m_pNode);
--m_nRecursionDepth;
int32_t iRet = XFA_EVENTERROR_Error;
if (bRet) {
iRet = XFA_EVENTERROR_Success;
if (pEventParam->m_eType == XFA_EVENT_Calculate ||
pEventParam->m_eType == XFA_EVENT_InitCalculate) {
- if (!FXJSE_Value_IsUndefined(hRetValue)) {
- if (!FXJSE_Value_IsNull(hRetValue)) {
+ if (!FXJSE_Value_IsUndefined(pTmpRetValue)) {
+ if (!FXJSE_Value_IsNull(pTmpRetValue)) {
CFX_ByteString bsString;
- FXJSE_Value_ToUTF8String(hRetValue, bsString);
+ FXJSE_Value_ToUTF8String(pTmpRetValue, bsString);
pEventParam->m_wsResult =
CFX_WideString::FromUTF8(bsString.AsStringC());
}
@@ -695,9 +695,9 @@ int32_t CXFA_WidgetAcc::ExecuteScript(CXFA_Script script,
}
}
if (pRetValue) {
- *pRetValue = hRetValue;
+ *pRetValue = pTmpRetValue;
} else {
- FXJSE_Value_Release(hRetValue);
+ FXJSE_Value_Release(pTmpRetValue);
}
pContext->SetNodesOfRunScript(NULL);
return iRet;
diff --git a/xfa/fxfa/fm2js/xfa_fm2jsapi.cpp b/xfa/fxfa/fm2js/xfa_fm2jsapi.cpp
index df817606e2..00c4edf447 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jsapi.cpp
+++ b/xfa/fxfa/fm2js/xfa_fm2jsapi.cpp
@@ -53,10 +53,10 @@ void XFA_FM2JS_ContextInitialize(XFA_HFM2JSCONTEXT hFM2JSContext,
}
void XFA_FM2JS_GlobalPropertyGetter(XFA_HFM2JSCONTEXT hFM2JSContext,
- FXJSE_HVALUE hValue) {
+ CFXJSE_Value* pValue) {
CXFA_FM2JSContext* pContext =
reinterpret_cast<CXFA_FM2JSContext*>(hFM2JSContext);
- pContext->GlobalPropertyGetter(hValue);
+ pContext->GlobalPropertyGetter(pValue);
}
void XFA_FM2JS_ContextRelease(XFA_HFM2JSCONTEXT hFM2JSContext) {
diff --git a/xfa/fxfa/fm2js/xfa_fm2jsapi.h b/xfa/fxfa/fm2js/xfa_fm2jsapi.h
index 011ae76ac6..49fda993d4 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jsapi.h
+++ b/xfa/fxfa/fm2js/xfa_fm2jsapi.h
@@ -27,7 +27,7 @@ void XFA_FM2JS_ContextInitialize(XFA_HFM2JSCONTEXT hFM2JSContext,
CFXJSE_Context* pScriptContext,
CXFA_Document* pDocument);
void XFA_FM2JS_GlobalPropertyGetter(XFA_HFM2JSCONTEXT hFM2JSContext,
- FXJSE_HVALUE hValue);
+ CFXJSE_Value* pValue);
void XFA_FM2JS_ContextRelease(XFA_HFM2JSCONTEXT hFM2JSContext);
#ifdef __cplusplus
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
index add3e8ab3f..7e5ddb9aec 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
@@ -298,15 +298,15 @@ void AlternateDateTimeSymbols(CFX_WideString& wsPattern,
} // namespace
-void CXFA_FM2JSContext::Abs(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Abs(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 1) {
- FXJSE_HVALUE argOne = args.GetValue(0);
- if (HValueIsNull(hThis, argOne)) {
+ CFXJSE_Value* argOne = args.GetValue(0);
+ if (ValueIsNull(pThis, argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- FX_DOUBLE dValue = HValueToDouble(hThis, argOne);
+ FX_DOUBLE dValue = ValueToDouble(pThis, argOne);
if (dValue < 0) {
dValue = -dValue;
}
@@ -315,43 +315,43 @@ void CXFA_FM2JSContext::Abs(FXJSE_HOBJECT hThis,
FXJSE_Value_Release(argOne);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Abs");
}
}
-void CXFA_FM2JSContext::Avg(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Avg(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
int32_t argc = args.GetLength();
uint32_t uCount = 0;
FX_DOUBLE dSum = 0.0;
if (argc >= 1) {
- FXJSE_HVALUE argValue = 0;
+ CFXJSE_Value* argValue = nullptr;
for (int32_t i = 0; i < argc; i++) {
argValue = args.GetValue(i);
if (FXJSE_Value_IsNull(argValue)) {
FXJSE_Value_Release(argValue);
continue;
} else if (FXJSE_Value_IsArray(argValue)) {
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argValue, "length", lengthValue);
int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if (iLength > 2) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argValue, 1, propertyValue);
- FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsObjectValue = FXJSE_Value_Create(pIsolate);
if (FXJSE_Value_IsNull(propertyValue)) {
for (int32_t j = 2; j < iLength; j++) {
FXJSE_Value_GetObjectPropByIdx(argValue, j, jsObjectValue);
- FXJSE_HVALUE defaultPropValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* defaultPropValue = FXJSE_Value_Create(pIsolate);
GetObjectDefaultValue(jsObjectValue, defaultPropValue);
if (!FXJSE_Value_IsNull(defaultPropValue)) {
- dSum += HValueToDouble(hThis, defaultPropValue);
+ dSum += ValueToDouble(pThis, defaultPropValue);
uCount++;
}
FXJSE_Value_Release(defaultPropValue);
@@ -359,13 +359,13 @@ void CXFA_FM2JSContext::Avg(FXJSE_HOBJECT hThis,
} else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newPropertyValue = FXJSE_Value_Create(pIsolate);
for (int32_t j = 2; j < iLength; j++) {
FXJSE_Value_GetObjectPropByIdx(argValue, j, jsObjectValue);
FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(),
newPropertyValue);
if (!FXJSE_Value_IsNull(newPropertyValue)) {
- dSum += HValueToDouble(hThis, newPropertyValue);
+ dSum += ValueToDouble(pThis, newPropertyValue);
uCount++;
}
}
@@ -375,12 +375,12 @@ void CXFA_FM2JSContext::Avg(FXJSE_HOBJECT hThis,
FXJSE_Value_Release(propertyValue);
}
} else {
- dSum += HValueToDouble(hThis, argValue);
+ dSum += ValueToDouble(pThis, argValue);
uCount++;
}
FXJSE_Value_Release(argValue);
}
- argValue = 0;
+ argValue = nullptr;
}
if (0 == uCount) {
FXJSE_Value_SetNull(args.GetReturnValue());
@@ -388,18 +388,18 @@ void CXFA_FM2JSContext::Avg(FXJSE_HOBJECT hThis,
FXJSE_Value_SetDouble(args.GetReturnValue(), dSum / uCount);
}
}
-void CXFA_FM2JSContext::Ceil(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Ceil(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 1) {
- FXJSE_HVALUE argValue = GetSimpleHValue(hThis, args, 0);
- if (HValueIsNull(hThis, argValue)) {
+ CFXJSE_Value* argValue = GetSimpleValue(pThis, args, 0);
+ if (ValueIsNull(pThis, argValue)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
FXJSE_Value_SetFloat(args.GetReturnValue(),
- FXSYS_ceil(HValueToFloat(hThis, argValue)));
+ FXSYS_ceil(ValueToFloat(pThis, argValue)));
}
FXJSE_Value_Release(argValue);
} else {
@@ -407,29 +407,29 @@ void CXFA_FM2JSContext::Ceil(FXJSE_HOBJECT hThis,
L"Ceil");
}
}
-void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Count(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
int32_t argc = args.GetLength();
uint32_t uCount = 0;
- FXJSE_HVALUE argValue = 0;
+ CFXJSE_Value* argValue = nullptr;
for (int32_t i = 0; i < argc; i++) {
argValue = args.GetValue(i);
if (FXJSE_Value_IsNull(argValue)) {
FXJSE_Value_Release(argValue);
continue;
} else if (FXJSE_Value_IsArray(argValue)) {
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argValue, "length", lengthValue);
int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if (iLength > 2) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsObjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newPropertyValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argValue, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(argValue, 2, jsObjectValue);
if (FXJSE_Value_IsNull(propertyValue)) {
@@ -457,7 +457,7 @@ void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis,
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
}
} else if (FXJSE_Value_IsObject(argValue)) {
- FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newPropertyValue = FXJSE_Value_Create(pIsolate);
GetObjectDefaultValue(argValue, newPropertyValue);
if (!FXJSE_Value_IsNull(newPropertyValue)) {
uCount++;
@@ -468,21 +468,21 @@ void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis,
}
FXJSE_Value_Release(argValue);
}
- argValue = 0;
+ argValue = nullptr;
FXJSE_Value_SetInteger(args.GetReturnValue(), (int32_t)uCount);
}
-void CXFA_FM2JSContext::Floor(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Floor(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 1) {
- FXJSE_HVALUE argValue = GetSimpleHValue(hThis, args, 0);
- if (HValueIsNull(hThis, argValue)) {
+ CFXJSE_Value* argValue = GetSimpleValue(pThis, args, 0);
+ if (ValueIsNull(pThis, argValue)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
FXJSE_Value_SetFloat(args.GetReturnValue(),
- FXSYS_floor(HValueToFloat(hThis, argValue)));
+ FXSYS_floor(ValueToFloat(pThis, argValue)));
}
FXJSE_Value_Release(argValue);
} else {
@@ -490,30 +490,30 @@ void CXFA_FM2JSContext::Floor(FXJSE_HOBJECT hThis,
L"Floor");
}
}
-void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Max(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
int32_t argc = args.GetLength();
uint32_t uCount = 0;
FX_DOUBLE dMaxValue = 0.0;
- FXJSE_HVALUE argValue = 0;
+ CFXJSE_Value* argValue = nullptr;
for (int32_t i = 0; i < argc; i++) {
argValue = args.GetValue(i);
if (FXJSE_Value_IsNull(argValue)) {
FXJSE_Value_Release(argValue);
continue;
} else if (FXJSE_Value_IsArray(argValue)) {
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argValue, "length", lengthValue);
int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if (iLength > 2) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsObjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newPropertyValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argValue, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(argValue, 2, jsObjectValue);
if (FXJSE_Value_IsNull(propertyValue)) {
@@ -523,9 +523,9 @@ void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis,
if (!FXJSE_Value_IsNull(newPropertyValue)) {
uCount++;
if (uCount == 1) {
- dMaxValue = HValueToDouble(hThis, newPropertyValue);
+ dMaxValue = ValueToDouble(pThis, newPropertyValue);
} else {
- FX_DOUBLE dValue = HValueToDouble(hThis, newPropertyValue);
+ FX_DOUBLE dValue = ValueToDouble(pThis, newPropertyValue);
if (dMaxValue < dValue) {
dMaxValue = dValue;
}
@@ -542,9 +542,9 @@ void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis,
if (!FXJSE_Value_IsNull(newPropertyValue)) {
uCount++;
if (uCount == 1) {
- dMaxValue = HValueToDouble(hThis, newPropertyValue);
+ dMaxValue = ValueToDouble(pThis, newPropertyValue);
} else {
- FX_DOUBLE dValue = HValueToDouble(hThis, newPropertyValue);
+ FX_DOUBLE dValue = ValueToDouble(pThis, newPropertyValue);
if (dMaxValue < dValue) {
dMaxValue = dValue;
}
@@ -559,14 +559,14 @@ void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis,
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
}
} else if (FXJSE_Value_IsObject(argValue)) {
- FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newPropertyValue = FXJSE_Value_Create(pIsolate);
GetObjectDefaultValue(argValue, newPropertyValue);
if (!FXJSE_Value_IsNull(newPropertyValue)) {
uCount++;
if (uCount == 1) {
- dMaxValue = HValueToDouble(hThis, newPropertyValue);
+ dMaxValue = ValueToDouble(pThis, newPropertyValue);
} else {
- FX_DOUBLE dValue = HValueToDouble(hThis, newPropertyValue);
+ FX_DOUBLE dValue = ValueToDouble(pThis, newPropertyValue);
if (dMaxValue < dValue) {
dMaxValue = dValue;
}
@@ -576,9 +576,9 @@ void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis,
} else {
uCount++;
if (uCount == 1) {
- dMaxValue = HValueToDouble(hThis, argValue);
+ dMaxValue = ValueToDouble(pThis, argValue);
} else {
- FX_DOUBLE dValue = HValueToDouble(hThis, argValue);
+ FX_DOUBLE dValue = ValueToDouble(pThis, argValue);
if (dMaxValue < dValue) {
dMaxValue = dValue;
}
@@ -586,37 +586,37 @@ void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis,
}
FXJSE_Value_Release(argValue);
}
- argValue = 0;
+ argValue = nullptr;
if (uCount) {
FXJSE_Value_SetDouble(args.GetReturnValue(), dMaxValue);
} else {
FXJSE_Value_SetNull(args.GetReturnValue());
}
}
-void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Min(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
int32_t argc = args.GetLength();
uint32_t uCount = 0;
FX_DOUBLE dMinValue = 0.0;
- FXJSE_HVALUE argValue = 0;
+ CFXJSE_Value* argValue = nullptr;
for (int32_t i = 0; i < argc; i++) {
argValue = args.GetValue(i);
if (FXJSE_Value_IsNull(argValue)) {
FXJSE_Value_Release(argValue);
continue;
} else if (FXJSE_Value_IsArray(argValue)) {
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argValue, "length", lengthValue);
int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if (iLength > 2) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsObjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newPropertyValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argValue, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(argValue, 2, jsObjectValue);
if (FXJSE_Value_IsNull(propertyValue)) {
@@ -626,9 +626,9 @@ void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis,
if (!FXJSE_Value_IsNull(newPropertyValue)) {
uCount++;
if (uCount == 1) {
- dMinValue = HValueToDouble(hThis, newPropertyValue);
+ dMinValue = ValueToDouble(pThis, newPropertyValue);
} else {
- FX_DOUBLE dValue = HValueToDouble(hThis, newPropertyValue);
+ FX_DOUBLE dValue = ValueToDouble(pThis, newPropertyValue);
if (dMinValue > dValue) {
dMinValue = dValue;
}
@@ -645,9 +645,9 @@ void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis,
if (!FXJSE_Value_IsNull(newPropertyValue)) {
uCount++;
if (uCount == 1) {
- dMinValue = HValueToDouble(hThis, newPropertyValue);
+ dMinValue = ValueToDouble(pThis, newPropertyValue);
} else {
- FX_DOUBLE dValue = HValueToDouble(hThis, newPropertyValue);
+ FX_DOUBLE dValue = ValueToDouble(pThis, newPropertyValue);
if (dMinValue > dValue) {
dMinValue = dValue;
}
@@ -662,14 +662,14 @@ void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis,
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
}
} else if (FXJSE_Value_IsObject(argValue)) {
- FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newPropertyValue = FXJSE_Value_Create(pIsolate);
GetObjectDefaultValue(argValue, newPropertyValue);
if (!FXJSE_Value_IsNull(newPropertyValue)) {
uCount++;
if (uCount == 1) {
- dMinValue = HValueToDouble(hThis, newPropertyValue);
+ dMinValue = ValueToDouble(pThis, newPropertyValue);
} else {
- FX_DOUBLE dValue = HValueToDouble(hThis, newPropertyValue);
+ FX_DOUBLE dValue = ValueToDouble(pThis, newPropertyValue);
if (dMinValue > dValue) {
dMinValue = dValue;
}
@@ -679,9 +679,9 @@ void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis,
} else {
uCount++;
if (uCount == 1) {
- dMinValue = HValueToDouble(hThis, argValue);
+ dMinValue = ValueToDouble(pThis, argValue);
} else {
- FX_DOUBLE dValue = HValueToDouble(hThis, argValue);
+ FX_DOUBLE dValue = ValueToDouble(pThis, argValue);
if (dMinValue > dValue) {
dMinValue = dValue;
}
@@ -689,46 +689,46 @@ void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis,
}
FXJSE_Value_Release(argValue);
}
- argValue = 0;
+ argValue = nullptr;
if (uCount) {
FXJSE_Value_SetDouble(args.GetReturnValue(), dMinValue);
} else {
FXJSE_Value_SetNull(args.GetReturnValue());
}
}
-void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Mod(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
if (args.GetLength() == 2) {
- FXJSE_HVALUE argOne = args.GetValue(0);
- FXJSE_HVALUE argTwo = args.GetValue(1);
+ CFXJSE_Value* argOne = args.GetValue(0);
+ CFXJSE_Value* argTwo = args.GetValue(1);
if (FXJSE_Value_IsNull(argOne) || FXJSE_Value_IsNull(argTwo)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
FX_DOUBLE dDividend = 0.0;
FX_DOUBLE dDividor = 0.0;
if (FXJSE_Value_IsArray(argOne)) {
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argOne, "length", lengthValue);
int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if (iLength > 2) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsObjectValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argOne, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(argOne, 2, jsObjectValue);
if (FXJSE_Value_IsNull(propertyValue)) {
- dDividend = HValueToDouble(hThis, jsObjectValue);
+ dDividend = ValueToDouble(pThis, jsObjectValue);
} else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newPropertyValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(),
newPropertyValue);
- dDividend = HValueToDouble(hThis, newPropertyValue);
+ dDividend = ValueToDouble(pThis, newPropertyValue);
FXJSE_Value_Release(newPropertyValue);
}
FXJSE_Value_Release(propertyValue);
@@ -737,27 +737,27 @@ void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis,
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
}
} else {
- dDividend = HValueToDouble(hThis, argOne);
+ dDividend = ValueToDouble(pThis, argOne);
}
if (FXJSE_Value_IsArray(argTwo)) {
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argTwo, "length", lengthValue);
int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if (iLength > 2) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsObjectValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argTwo, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(argTwo, 2, jsObjectValue);
if (FXJSE_Value_IsNull(propertyValue)) {
- dDividor = HValueToDouble(hThis, jsObjectValue);
+ dDividor = ValueToDouble(pThis, jsObjectValue);
} else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newPropertyValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(),
newPropertyValue);
- dDividor = HValueToDouble(hThis, newPropertyValue);
+ dDividor = ValueToDouble(pThis, newPropertyValue);
FXJSE_Value_Release(newPropertyValue);
}
FXJSE_Value_Release(propertyValue);
@@ -766,7 +766,7 @@ void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis,
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
}
} else {
- dDividor = HValueToDouble(hThis, argTwo);
+ dDividor = ValueToDouble(pThis, argTwo);
}
if (dDividor) {
FXJSE_Value_SetDouble(
@@ -783,40 +783,40 @@ void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis,
L"Mod");
}
}
-void CXFA_FM2JSContext::Round(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Round(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
int32_t argc = args.GetLength();
uint8_t uPrecision = 0;
if (argc == 1) {
- FXJSE_HVALUE argOne = args.GetValue(0);
+ CFXJSE_Value* argOne = args.GetValue(0);
if (FXJSE_Value_IsNull(argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
FX_DOUBLE dValue = 0.0;
if (FXJSE_Value_IsArray(argOne)) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsObjectValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argOne, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(argOne, 2, jsObjectValue);
if (FXJSE_Value_IsNull(propertyValue)) {
- dValue = HValueToDouble(hThis, jsObjectValue);
+ dValue = ValueToDouble(pThis, jsObjectValue);
} else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newPropertyValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(),
newPropertyValue);
- dValue = HValueToDouble(hThis, newPropertyValue);
+ dValue = ValueToDouble(pThis, newPropertyValue);
FXJSE_Value_Release(newPropertyValue);
}
FXJSE_Value_Release(propertyValue);
FXJSE_Value_Release(jsObjectValue);
} else {
- dValue = HValueToDouble(hThis, argOne);
+ dValue = ValueToDouble(pThis, argOne);
}
CFX_Decimal decimalValue((FX_FLOAT)dValue, uPrecision);
CFX_WideString wsValue = decimalValue;
@@ -825,54 +825,54 @@ void CXFA_FM2JSContext::Round(FXJSE_HOBJECT hThis,
}
FXJSE_Value_Release(argOne);
} else if (argc == 2) {
- FXJSE_HVALUE argOne = args.GetValue(0);
- FXJSE_HVALUE argTwo = args.GetValue(1);
+ CFXJSE_Value* argOne = args.GetValue(0);
+ CFXJSE_Value* argTwo = args.GetValue(1);
if (FXJSE_Value_IsNull(argOne) || FXJSE_Value_IsNull(argTwo)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
FX_DOUBLE dValue = 0.0;
if (FXJSE_Value_IsArray(argOne)) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsObjectValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argOne, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(argOne, 2, jsObjectValue);
if (FXJSE_Value_IsNull(propertyValue)) {
- dValue = HValueToDouble(hThis, jsObjectValue);
+ dValue = ValueToDouble(pThis, jsObjectValue);
} else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newPropertyValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(),
newPropertyValue);
- dValue = HValueToDouble(hThis, newPropertyValue);
+ dValue = ValueToDouble(pThis, newPropertyValue);
FXJSE_Value_Release(newPropertyValue);
}
FXJSE_Value_Release(propertyValue);
FXJSE_Value_Release(jsObjectValue);
} else {
- dValue = HValueToDouble(hThis, argOne);
+ dValue = ValueToDouble(pThis, argOne);
}
FX_DOUBLE dPrecision = 0.0;
if (FXJSE_Value_IsArray(argTwo)) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsObjectValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argTwo, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(argTwo, 2, jsObjectValue);
if (FXJSE_Value_IsNull(propertyValue)) {
- dPrecision = HValueToDouble(hThis, jsObjectValue);
+ dPrecision = ValueToDouble(pThis, jsObjectValue);
} else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newPropertyValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(),
newPropertyValue);
- dPrecision = HValueToDouble(hThis, newPropertyValue);
+ dPrecision = ValueToDouble(pThis, newPropertyValue);
FXJSE_Value_Release(newPropertyValue);
}
FXJSE_Value_Release(propertyValue);
FXJSE_Value_Release(jsObjectValue);
} else {
- dPrecision = HValueToDouble(hThis, argTwo);
+ dPrecision = ValueToDouble(pThis, argTwo);
}
if (dPrecision < 0) {
uPrecision = 0;
@@ -893,38 +893,38 @@ void CXFA_FM2JSContext::Round(FXJSE_HOBJECT hThis,
L"Round");
}
}
-void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Sum(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
int32_t argc = args.GetLength();
uint32_t uCount = 0;
FX_DOUBLE dSum = 0.0;
if (argc) {
- FXJSE_HVALUE argValue = 0;
+ CFXJSE_Value* argValue = nullptr;
for (int32_t i = 0; i < argc; i++) {
argValue = args.GetValue(i);
if (FXJSE_Value_IsNull(argValue)) {
FXJSE_Value_Release(argValue);
continue;
} else if (FXJSE_Value_IsArray(argValue)) {
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argValue, "length", lengthValue);
int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if (iLength > 2) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argValue, 1, propertyValue);
- FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsObjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newPropertyValue = FXJSE_Value_Create(pIsolate);
if (FXJSE_Value_IsNull(propertyValue)) {
for (int32_t j = 2; j < iLength; j++) {
FXJSE_Value_GetObjectPropByIdx(argValue, j, jsObjectValue);
GetObjectDefaultValue(jsObjectValue, newPropertyValue);
if (!FXJSE_Value_IsNull(newPropertyValue)) {
- dSum += HValueToDouble(hThis, jsObjectValue);
+ dSum += ValueToDouble(pThis, jsObjectValue);
uCount++;
}
}
@@ -936,7 +936,7 @@ void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis,
FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(),
newPropertyValue);
if (!FXJSE_Value_IsNull(newPropertyValue)) {
- dSum += HValueToDouble(hThis, newPropertyValue);
+ dSum += ValueToDouble(pThis, newPropertyValue);
uCount++;
}
}
@@ -948,20 +948,20 @@ void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis,
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
}
} else if (FXJSE_Value_IsObject(argValue)) {
- FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newPropertyValue = FXJSE_Value_Create(pIsolate);
GetObjectDefaultValue(argValue, newPropertyValue);
if (!FXJSE_Value_IsNull(newPropertyValue)) {
- dSum += HValueToDouble(hThis, argValue);
+ dSum += ValueToDouble(pThis, argValue);
uCount++;
}
FXJSE_Value_Release(newPropertyValue);
} else {
- dSum += HValueToDouble(hThis, argValue);
+ dSum += ValueToDouble(pThis, argValue);
uCount++;
}
FXJSE_Value_Release(argValue);
}
- argValue = 0;
+ argValue = nullptr;
}
if (uCount < 1) {
FXJSE_Value_SetNull(args.GetReturnValue());
@@ -969,7 +969,7 @@ void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis,
FXJSE_Value_SetDouble(args.GetReturnValue(), dSum);
}
}
-void CXFA_FM2JSContext::Date(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Date(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 0) {
@@ -988,12 +988,12 @@ void CXFA_FM2JSContext::Date(FXJSE_HOBJECT hThis,
FXJSE_Value_SetInteger(args.GetReturnValue(), dDays);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Date");
}
}
-void CXFA_FM2JSContext::Date2Num(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Date2Num(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
@@ -1002,34 +1002,34 @@ void CXFA_FM2JSContext::Date2Num(FXJSE_HOBJECT hThis,
CFX_ByteString dateString;
CFX_ByteString formatString;
CFX_ByteString localString;
- FXJSE_HVALUE dateValue = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE formatValue = 0;
- FXJSE_HVALUE localValue = 0;
- if (HValueIsNull(hThis, dateValue)) {
+ CFXJSE_Value* dateValue = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* formatValue = nullptr;
+ CFXJSE_Value* localValue = nullptr;
+ if (ValueIsNull(pThis, dateValue)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(dateValue, dateString);
+ ValueToUTF8String(dateValue, dateString);
}
if (argc > 1) {
- formatValue = GetSimpleHValue(hThis, args, 1);
- if (HValueIsNull(hThis, formatValue)) {
+ formatValue = GetSimpleValue(pThis, args, 1);
+ if (ValueIsNull(pThis, formatValue)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(formatValue, formatString);
+ ValueToUTF8String(formatValue, formatString);
}
}
if (argc == 3) {
- localValue = GetSimpleHValue(hThis, args, 2);
- if (HValueIsNull(hThis, localValue)) {
+ localValue = GetSimpleValue(pThis, args, 2);
+ if (ValueIsNull(pThis, localValue)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(localValue, localString);
+ ValueToUTF8String(localValue, localString);
}
}
if (!bFlags) {
CFX_ByteString szIsoDateString;
FX_BOOL bRet =
- Local2IsoDate(hThis, dateString.AsStringC(), formatString.AsStringC(),
+ Local2IsoDate(pThis, dateString.AsStringC(), formatString.AsStringC(),
localString.AsStringC(), szIsoDateString);
if (bRet) {
FXJSE_Value_SetInteger(args.GetReturnValue(),
@@ -1049,12 +1049,12 @@ void CXFA_FM2JSContext::Date2Num(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Date2Num");
}
}
-void CXFA_FM2JSContext::DateFmt(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::DateFmt(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
@@ -1062,29 +1062,29 @@ void CXFA_FM2JSContext::DateFmt(FXJSE_HOBJECT hThis,
FX_BOOL bFlags = FALSE;
int32_t iStyle = 0;
CFX_ByteString szLocal;
- FXJSE_HVALUE argStyle = 0;
- FXJSE_HVALUE argLocal = 0;
+ CFXJSE_Value* argStyle = nullptr;
+ CFXJSE_Value* argLocal = nullptr;
if (argc > 0) {
- argStyle = GetSimpleHValue(hThis, args, 0);
+ argStyle = GetSimpleValue(pThis, args, 0);
if (FXJSE_Value_IsNull(argStyle)) {
bFlags = TRUE;
}
- iStyle = (int32_t)HValueToFloat(hThis, argStyle);
+ iStyle = (int32_t)ValueToFloat(pThis, argStyle);
if (iStyle > 4 || iStyle < 0) {
iStyle = 0;
}
}
if (argc == 2) {
- argLocal = GetSimpleHValue(hThis, args, 1);
+ argLocal = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(argLocal)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(argLocal, szLocal);
+ ValueToUTF8String(argLocal, szLocal);
}
}
if (!bFlags) {
CFX_ByteString formatStr;
- GetStandardDateFormat(hThis, iStyle, szLocal.AsStringC(), formatStr);
+ GetStandardDateFormat(pThis, iStyle, szLocal.AsStringC(), formatStr);
if (formatStr.IsEmpty()) {
formatStr = "";
}
@@ -1100,47 +1100,47 @@ void CXFA_FM2JSContext::DateFmt(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Date2Num");
}
}
-void CXFA_FM2JSContext::IsoDate2Num(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::IsoDate2Num(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 1) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
if (FXJSE_Value_IsNull(argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CFX_ByteString szArgString;
- HValueToUTF8String(argOne, szArgString);
+ ValueToUTF8String(argOne, szArgString);
int32_t dDays = DateString2Num(szArgString.AsStringC());
FXJSE_Value_SetInteger(args.GetReturnValue(), (int32_t)dDays);
}
FXJSE_Value_Release(argOne);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"IsoDate2Num");
}
}
-void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::IsoTime2Num(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 1) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- if (HValueIsNull(hThis, argOne)) {
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ if (ValueIsNull(pThis, argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CXFA_Document* pDoc = pContext->GetDocument();
ASSERT(pDoc);
IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr();
CFX_ByteString szArgString;
- HValueToUTF8String(argOne, szArgString);
+ ValueToUTF8String(argOne, szArgString);
szArgString = szArgString.Mid(szArgString.Find('T', 0) + 1);
if (szArgString.IsEmpty()) {
FXJSE_Value_SetInteger(args.GetReturnValue(), 0);
@@ -1183,7 +1183,7 @@ void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis,
L"IsoTime2Num");
}
}
-void CXFA_FM2JSContext::LocalDateFmt(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::LocalDateFmt(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
@@ -1191,29 +1191,29 @@ void CXFA_FM2JSContext::LocalDateFmt(FXJSE_HOBJECT hThis,
FX_BOOL bFlags = FALSE;
int32_t iStyle = 0;
CFX_ByteString szLocal;
- FXJSE_HVALUE argStyle = 0;
- FXJSE_HVALUE argLocal = 0;
+ CFXJSE_Value* argStyle = nullptr;
+ CFXJSE_Value* argLocal = nullptr;
if (argc > 0) {
- argStyle = GetSimpleHValue(hThis, args, 0);
+ argStyle = GetSimpleValue(pThis, args, 0);
if (FXJSE_Value_IsNull(argStyle)) {
bFlags = TRUE;
}
- iStyle = (int32_t)HValueToFloat(hThis, argStyle);
+ iStyle = (int32_t)ValueToFloat(pThis, argStyle);
if (iStyle > 4 || iStyle < 0) {
iStyle = 0;
}
}
if (argc == 2) {
- argLocal = GetSimpleHValue(hThis, args, 1);
+ argLocal = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(argLocal)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(argLocal, szLocal);
+ ValueToUTF8String(argLocal, szLocal);
}
}
if (!bFlags) {
CFX_ByteString formatStr;
- GetLocalDateFormat(hThis, iStyle, szLocal.AsStringC(), formatStr, FALSE);
+ GetLocalDateFormat(pThis, iStyle, szLocal.AsStringC(), formatStr, FALSE);
if (formatStr.IsEmpty()) {
formatStr = "";
}
@@ -1229,12 +1229,12 @@ void CXFA_FM2JSContext::LocalDateFmt(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"LocalDateFmt");
}
}
-void CXFA_FM2JSContext::LocalTimeFmt(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::LocalTimeFmt(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
@@ -1242,29 +1242,29 @@ void CXFA_FM2JSContext::LocalTimeFmt(FXJSE_HOBJECT hThis,
FX_BOOL bFlags = FALSE;
int32_t iStyle = 0;
CFX_ByteString szLocal;
- FXJSE_HVALUE argStyle = 0;
- FXJSE_HVALUE argLocal = 0;
+ CFXJSE_Value* argStyle = nullptr;
+ CFXJSE_Value* argLocal = nullptr;
if (argc > 0) {
- argStyle = GetSimpleHValue(hThis, args, 0);
+ argStyle = GetSimpleValue(pThis, args, 0);
if (FXJSE_Value_IsNull(argStyle)) {
bFlags = TRUE;
}
- iStyle = (int32_t)HValueToFloat(hThis, argStyle);
+ iStyle = (int32_t)ValueToFloat(pThis, argStyle);
if (iStyle > 4 || iStyle < 0) {
iStyle = 0;
}
}
if (argc == 2) {
- argLocal = GetSimpleHValue(hThis, args, 1);
+ argLocal = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(argLocal)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(argLocal, szLocal);
+ ValueToUTF8String(argLocal, szLocal);
}
}
if (!bFlags) {
CFX_ByteString formatStr;
- GetLocalTimeFormat(hThis, iStyle, szLocal.AsStringC(), formatStr, FALSE);
+ GetLocalTimeFormat(pThis, iStyle, szLocal.AsStringC(), formatStr, FALSE);
if (formatStr.IsEmpty()) {
formatStr = "";
}
@@ -1280,12 +1280,12 @@ void CXFA_FM2JSContext::LocalTimeFmt(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"LocalTimeFmt");
}
}
-void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Num2Date(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
@@ -1294,29 +1294,29 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis,
int32_t dDate = 0;
CFX_ByteString formatString;
CFX_ByteString localString;
- FXJSE_HVALUE dateValue = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE formatValue = 0;
- FXJSE_HVALUE localValue = 0;
- if (HValueIsNull(hThis, dateValue)) {
+ CFXJSE_Value* dateValue = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* formatValue = nullptr;
+ CFXJSE_Value* localValue = nullptr;
+ if (ValueIsNull(pThis, dateValue)) {
bFlags = TRUE;
} else {
- dDate = (int32_t)HValueToFloat(hThis, dateValue);
+ dDate = (int32_t)ValueToFloat(pThis, dateValue);
bFlags = dDate < 1;
}
if (argc > 1) {
- formatValue = GetSimpleHValue(hThis, args, 1);
- if (HValueIsNull(hThis, formatValue)) {
+ formatValue = GetSimpleValue(pThis, args, 1);
+ if (ValueIsNull(pThis, formatValue)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(formatValue, formatString);
+ ValueToUTF8String(formatValue, formatString);
}
}
if (argc == 3) {
- localValue = GetSimpleHValue(hThis, args, 2);
- if (HValueIsNull(hThis, localValue)) {
+ localValue = GetSimpleValue(pThis, args, 2);
+ if (ValueIsNull(pThis, localValue)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(localValue, localString);
+ ValueToUTF8String(localValue, localString);
}
}
if (!bFlags) {
@@ -1415,7 +1415,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis,
CFX_ByteString szIsoDateString;
szIsoDateString.Format("%d%02d%02d", iYear + i, iMonth, iDay);
CFX_ByteString szLocalDateString;
- IsoDate2Local(hThis, szIsoDateString.AsStringC(),
+ IsoDate2Local(pThis, szIsoDateString.AsStringC(),
formatString.AsStringC(), localString.AsStringC(),
szLocalDateString);
if (szLocalDateString.IsEmpty()) {
@@ -1435,12 +1435,12 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Num2Date");
}
}
-void CXFA_FM2JSContext::Num2GMTime(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Num2GMTime(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
@@ -1449,36 +1449,36 @@ void CXFA_FM2JSContext::Num2GMTime(FXJSE_HOBJECT hThis,
int32_t iTime = 0;
CFX_ByteString formatString;
CFX_ByteString localString;
- FXJSE_HVALUE timeValue = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE formatValue = 0;
- FXJSE_HVALUE localValue = 0;
+ CFXJSE_Value* timeValue = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* formatValue = nullptr;
+ CFXJSE_Value* localValue = nullptr;
if (FXJSE_Value_IsNull(timeValue)) {
bFlags = TRUE;
} else {
- iTime = (int32_t)HValueToFloat(hThis, timeValue);
+ iTime = (int32_t)ValueToFloat(pThis, timeValue);
if (FXSYS_abs(iTime) < 1.0) {
bFlags = TRUE;
}
}
if (argc > 1) {
- formatValue = GetSimpleHValue(hThis, args, 1);
+ formatValue = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(formatValue)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(formatValue, formatString);
+ ValueToUTF8String(formatValue, formatString);
}
}
if (argc == 3) {
- localValue = GetSimpleHValue(hThis, args, 2);
+ localValue = GetSimpleValue(pThis, args, 2);
if (FXJSE_Value_IsNull(localValue)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(localValue, localString);
+ ValueToUTF8String(localValue, localString);
}
}
if (!bFlags) {
CFX_ByteString szGMTTimeString;
- Num2AllTime(hThis, iTime, formatString.AsStringC(),
+ Num2AllTime(pThis, iTime, formatString.AsStringC(),
localString.AsStringC(), TRUE, szGMTTimeString);
if (szGMTTimeString.IsEmpty()) {
szGMTTimeString = "";
@@ -1497,12 +1497,12 @@ void CXFA_FM2JSContext::Num2GMTime(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Num2GMTime");
}
}
-void CXFA_FM2JSContext::Num2Time(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Num2Time(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
@@ -1511,36 +1511,36 @@ void CXFA_FM2JSContext::Num2Time(FXJSE_HOBJECT hThis,
FX_FLOAT fTime = 0.0f;
CFX_ByteString formatString;
CFX_ByteString localString;
- FXJSE_HVALUE timeValue = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE formatValue = 0;
- FXJSE_HVALUE localValue = 0;
+ CFXJSE_Value* timeValue = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* formatValue = nullptr;
+ CFXJSE_Value* localValue = nullptr;
if (FXJSE_Value_IsNull(timeValue)) {
bFlags = TRUE;
} else {
- fTime = HValueToFloat(hThis, timeValue);
+ fTime = ValueToFloat(pThis, timeValue);
if (FXSYS_fabs(fTime) < 1.0) {
bFlags = TRUE;
}
}
if (argc > 1) {
- formatValue = GetSimpleHValue(hThis, args, 1);
+ formatValue = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(formatValue)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(formatValue, formatString);
+ ValueToUTF8String(formatValue, formatString);
}
}
if (argc == 3) {
- localValue = GetSimpleHValue(hThis, args, 2);
+ localValue = GetSimpleValue(pThis, args, 2);
if (FXJSE_Value_IsNull(localValue)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(localValue, localString);
+ ValueToUTF8String(localValue, localString);
}
}
if (!bFlags) {
CFX_ByteString szLocalTimeString;
- Num2AllTime(hThis, (int32_t)fTime, formatString.AsStringC(),
+ Num2AllTime(pThis, (int32_t)fTime, formatString.AsStringC(),
localString.AsStringC(), FALSE, szLocalTimeString);
if (szLocalTimeString.IsEmpty()) {
szLocalTimeString = "";
@@ -1559,12 +1559,12 @@ void CXFA_FM2JSContext::Num2Time(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Num2Time");
}
}
-void CXFA_FM2JSContext::Time(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Time(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 0) {
@@ -1578,12 +1578,12 @@ void CXFA_FM2JSContext::Time(FXJSE_HOBJECT hThis,
((iGMHour * 3600 + iGMMin * 60 + iGMSec) * 1000));
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Time");
}
}
-void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Time2Num(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
@@ -1592,33 +1592,33 @@ void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis,
CFX_ByteString timeString;
CFX_ByteString formatString;
CFX_ByteString localString;
- FXJSE_HVALUE timeValue = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE formatValue = 0;
- FXJSE_HVALUE localValue = 0;
- if (HValueIsNull(hThis, timeValue)) {
+ CFXJSE_Value* timeValue = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* formatValue = nullptr;
+ CFXJSE_Value* localValue = nullptr;
+ if (ValueIsNull(pThis, timeValue)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(timeValue, timeString);
+ ValueToUTF8String(timeValue, timeString);
}
if (argc > 1) {
- formatValue = GetSimpleHValue(hThis, args, 1);
- if (HValueIsNull(hThis, formatValue)) {
+ formatValue = GetSimpleValue(pThis, args, 1);
+ if (ValueIsNull(pThis, formatValue)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(formatValue, formatString);
+ ValueToUTF8String(formatValue, formatString);
}
}
if (argc == 3) {
- localValue = GetSimpleHValue(hThis, args, 2);
- if (HValueIsNull(hThis, localValue)) {
+ localValue = GetSimpleValue(pThis, args, 2);
+ if (ValueIsNull(pThis, localValue)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(localValue, localString);
+ ValueToUTF8String(localValue, localString);
}
}
if (!bFlags) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
CXFA_Document* pDoc = pContext->GetDocument();
IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr();
IFX_Locale* pLocale = NULL;
@@ -1682,12 +1682,12 @@ void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Time2Num");
}
}
-void CXFA_FM2JSContext::TimeFmt(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::TimeFmt(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
@@ -1695,29 +1695,29 @@ void CXFA_FM2JSContext::TimeFmt(FXJSE_HOBJECT hThis,
FX_BOOL bFlags = FALSE;
int32_t iStyle = 0;
CFX_ByteString szLocal;
- FXJSE_HVALUE argStyle = 0;
- FXJSE_HVALUE argLocal = 0;
+ CFXJSE_Value* argStyle = nullptr;
+ CFXJSE_Value* argLocal = nullptr;
if (argc > 0) {
- argStyle = GetSimpleHValue(hThis, args, 0);
+ argStyle = GetSimpleValue(pThis, args, 0);
if (FXJSE_Value_IsNull(argStyle)) {
bFlags = TRUE;
}
- iStyle = (int32_t)HValueToFloat(hThis, argStyle);
+ iStyle = (int32_t)ValueToFloat(pThis, argStyle);
if (iStyle > 4 || iStyle < 0) {
iStyle = 0;
}
}
if (argc == 2) {
- argLocal = GetSimpleHValue(hThis, args, 1);
+ argLocal = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(argLocal)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(argLocal, szLocal);
+ ValueToUTF8String(argLocal, szLocal);
}
}
if (!bFlags) {
CFX_ByteString formatStr;
- GetStandardTimeFormat(hThis, iStyle, szLocal.AsStringC(), formatStr);
+ GetStandardTimeFormat(pThis, iStyle, szLocal.AsStringC(), formatStr);
if (formatStr.IsEmpty()) {
formatStr = "";
}
@@ -1733,7 +1733,7 @@ void CXFA_FM2JSContext::TimeFmt(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"TimeFmt");
}
@@ -2057,13 +2057,13 @@ FX_BOOL CXFA_FM2JSContext::IsIsoDateTimeFormat(const FX_CHAR* pData,
iRet = TRUE;
return iRet;
}
-FX_BOOL CXFA_FM2JSContext::Local2IsoDate(FXJSE_HOBJECT hThis,
+FX_BOOL CXFA_FM2JSContext::Local2IsoDate(CFXJSE_Value* pThis,
const CFX_ByteStringC& szDate,
const CFX_ByteStringC& szFormat,
const CFX_ByteStringC& szLocale,
CFX_ByteString& strIsoDate) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
CXFA_Document* pDoc = pContext->GetDocument();
if (!pDoc) {
return FALSE;
@@ -2093,13 +2093,13 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoDate(FXJSE_HOBJECT hThis,
strIsoDate.Format("%4d-%02d-%02d", dt.GetYear(), dt.GetMonth(), dt.GetDay());
return TRUE;
}
-FX_BOOL CXFA_FM2JSContext::Local2IsoTime(FXJSE_HOBJECT hThis,
+FX_BOOL CXFA_FM2JSContext::Local2IsoTime(CFXJSE_Value* pThis,
const CFX_ByteStringC& szTime,
const CFX_ByteStringC& szFormat,
const CFX_ByteStringC& szLocale,
CFX_ByteString& strIsoTime) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
CXFA_Document* pDoc = pContext->GetDocument();
if (!pDoc) {
return FALSE;
@@ -2132,13 +2132,13 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoTime(FXJSE_HOBJECT hThis,
utime.GetSecond(), utime.GetMillisecond());
return TRUE;
}
-FX_BOOL CXFA_FM2JSContext::IsoDate2Local(FXJSE_HOBJECT hThis,
+FX_BOOL CXFA_FM2JSContext::IsoDate2Local(CFXJSE_Value* pThis,
const CFX_ByteStringC& szDate,
const CFX_ByteStringC& szFormat,
const CFX_ByteStringC& szLocale,
CFX_ByteString& strLocalDate) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
CXFA_Document* pDoc = pContext->GetDocument();
if (!pDoc) {
return FALSE;
@@ -2170,13 +2170,13 @@ FX_BOOL CXFA_FM2JSContext::IsoDate2Local(FXJSE_HOBJECT hThis,
strLocalDate = FX_UTF8Encode(wsRet.c_str(), wsRet.GetLength());
return TRUE;
}
-FX_BOOL CXFA_FM2JSContext::IsoTime2Local(FXJSE_HOBJECT hThis,
+FX_BOOL CXFA_FM2JSContext::IsoTime2Local(CFXJSE_Value* pThis,
const CFX_ByteStringC& szTime,
const CFX_ByteStringC& szFormat,
const CFX_ByteStringC& szLocale,
CFX_ByteString& strLocalTime) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
CXFA_Document* pDoc = pContext->GetDocument();
if (!pDoc) {
return FALSE;
@@ -2210,13 +2210,13 @@ FX_BOOL CXFA_FM2JSContext::IsoTime2Local(FXJSE_HOBJECT hThis,
strLocalTime = FX_UTF8Encode(wsRet.c_str(), wsRet.GetLength());
return TRUE;
}
-FX_BOOL CXFA_FM2JSContext::GetGMTTime(FXJSE_HOBJECT hThis,
+FX_BOOL CXFA_FM2JSContext::GetGMTTime(CFXJSE_Value* pThis,
const CFX_ByteStringC& szTime,
const CFX_ByteStringC& szFormat,
const CFX_ByteStringC& szLocale,
CFX_ByteString& strGMTTime) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
CXFA_Document* pDoc = pContext->GetDocument();
if (!pDoc) {
return FALSE;
@@ -2323,7 +2323,7 @@ int32_t CXFA_FM2JSContext::DateString2Num(const CFX_ByteStringC& szDateString) {
return (int32_t)dDays;
}
-void CXFA_FM2JSContext::GetLocalDateFormat(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::GetLocalDateFormat(CFXJSE_Value* pThis,
int32_t iStyle,
const CFX_ByteStringC& szLocalStr,
CFX_ByteString& strFormat,
@@ -2350,7 +2350,7 @@ void CXFA_FM2JSContext::GetLocalDateFormat(FXJSE_HOBJECT hThis,
break;
}
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
CXFA_Document* pDoc = pContext->GetDocument();
if (!pDoc) {
return;
@@ -2377,7 +2377,7 @@ void CXFA_FM2JSContext::GetLocalDateFormat(FXJSE_HOBJECT hThis,
}
strFormat = FX_UTF8Encode(strRet.c_str(), strRet.GetLength());
}
-void CXFA_FM2JSContext::GetLocalTimeFormat(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::GetLocalTimeFormat(CFXJSE_Value* pThis,
int32_t iStyle,
const CFX_ByteStringC& szLocalStr,
CFX_ByteString& strFormat,
@@ -2404,7 +2404,7 @@ void CXFA_FM2JSContext::GetLocalTimeFormat(FXJSE_HOBJECT hThis,
break;
}
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
CXFA_Document* pDoc = pContext->GetDocument();
if (!pDoc) {
return;
@@ -2431,19 +2431,19 @@ void CXFA_FM2JSContext::GetLocalTimeFormat(FXJSE_HOBJECT hThis,
}
strFormat = FX_UTF8Encode(strRet.c_str(), strRet.GetLength());
}
-void CXFA_FM2JSContext::GetStandardDateFormat(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::GetStandardDateFormat(CFXJSE_Value* pThis,
int32_t iStyle,
const CFX_ByteStringC& szLocalStr,
CFX_ByteString& strFormat) {
- GetLocalDateFormat(hThis, iStyle, szLocalStr, strFormat, TRUE);
+ GetLocalDateFormat(pThis, iStyle, szLocalStr, strFormat, TRUE);
}
-void CXFA_FM2JSContext::GetStandardTimeFormat(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::GetStandardTimeFormat(CFXJSE_Value* pThis,
int32_t iStyle,
const CFX_ByteStringC& szLocalStr,
CFX_ByteString& strFormat) {
- GetLocalTimeFormat(hThis, iStyle, szLocalStr, strFormat, TRUE);
+ GetLocalTimeFormat(pThis, iStyle, szLocalStr, strFormat, TRUE);
}
-void CXFA_FM2JSContext::Num2AllTime(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Num2AllTime(CFXJSE_Value* pThis,
int32_t iTime,
const CFX_ByteStringC& szFormat,
const CFX_ByteStringC& szLocale,
@@ -2469,9 +2469,9 @@ void CXFA_FM2JSContext::Num2AllTime(FXJSE_HOBJECT hThis,
strIsoTime.Format("%02d:%02d:%02d", iHour, iMin, iSec);
if (bGM) {
iRet =
- GetGMTTime(hThis, strIsoTime.AsStringC(), szFormat, szLocale, strTime);
+ GetGMTTime(pThis, strIsoTime.AsStringC(), szFormat, szLocale, strTime);
} else {
- iRet = IsoTime2Local(hThis, strIsoTime.AsStringC(), szFormat, szLocale,
+ iRet = IsoTime2Local(pThis, strIsoTime.AsStringC(), szFormat, szLocale,
strTime);
}
if (!iRet) {
@@ -2496,27 +2496,27 @@ void CXFA_FM2JSContext::GetLocalTimeZone(int32_t& iHour,
iMin = iLocalMin - iGMMin;
iSec = iLocalSec - iGMSec;
}
-void CXFA_FM2JSContext::Apr(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Apr(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 3) {
FX_BOOL bFlags = FALSE;
FX_DOUBLE nPrincipal = 0;
FX_DOUBLE nPayment = 0;
FX_DOUBLE nPeriods = 0;
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2);
- bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) ||
- HValueIsNull(hThis, argThree));
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ CFXJSE_Value* argThree = GetSimpleValue(pThis, args, 2);
+ bFlags = (ValueIsNull(pThis, argOne) || ValueIsNull(pThis, argTwo) ||
+ ValueIsNull(pThis, argThree));
if (bFlags) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- nPrincipal = HValueToDouble(hThis, argOne);
- nPayment = HValueToDouble(hThis, argTwo);
- nPeriods = HValueToDouble(hThis, argThree);
+ nPrincipal = ValueToDouble(pThis, argOne);
+ nPayment = ValueToDouble(pThis, argTwo);
+ nPeriods = ValueToDouble(pThis, argThree);
bFlags = ((nPrincipal <= 0) || (nPayment <= 0) || (nPeriods <= 0));
if (bFlags) {
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
@@ -2562,27 +2562,27 @@ void CXFA_FM2JSContext::Apr(FXJSE_HOBJECT hThis,
L"Apr");
}
}
-void CXFA_FM2JSContext::CTerm(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::CTerm(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 3) {
FX_BOOL bFlags = FALSE;
FX_FLOAT nRate = 0;
FX_FLOAT nFutureValue = 0;
FX_FLOAT nInitAmount = 0;
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2);
- bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) ||
- HValueIsNull(hThis, argThree));
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ CFXJSE_Value* argThree = GetSimpleValue(pThis, args, 2);
+ bFlags = (ValueIsNull(pThis, argOne) || ValueIsNull(pThis, argTwo) ||
+ ValueIsNull(pThis, argThree));
if (bFlags) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- nRate = HValueToFloat(hThis, argOne);
- nFutureValue = HValueToFloat(hThis, argTwo);
- nInitAmount = HValueToFloat(hThis, argThree);
+ nRate = ValueToFloat(pThis, argOne);
+ nFutureValue = ValueToFloat(pThis, argTwo);
+ nInitAmount = ValueToFloat(pThis, argThree);
bFlags = ((nRate <= 0) || (nFutureValue <= 0) || (nInitAmount <= 0));
if (bFlags) {
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
@@ -2600,27 +2600,27 @@ void CXFA_FM2JSContext::CTerm(FXJSE_HOBJECT hThis,
L"CTerm");
}
}
-void CXFA_FM2JSContext::FV(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::FV(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 3) {
FX_BOOL bFlags = FALSE;
FX_DOUBLE nAmount = 0;
FX_DOUBLE nRate = 0;
FX_DOUBLE nPeriod = 0;
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2);
- bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) ||
- HValueIsNull(hThis, argThree));
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ CFXJSE_Value* argThree = GetSimpleValue(pThis, args, 2);
+ bFlags = (ValueIsNull(pThis, argOne) || ValueIsNull(pThis, argTwo) ||
+ ValueIsNull(pThis, argThree));
if (bFlags) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- nAmount = HValueToDouble(hThis, argOne);
- nRate = HValueToDouble(hThis, argTwo);
- nPeriod = HValueToDouble(hThis, argThree);
+ nAmount = ValueToDouble(pThis, argOne);
+ nRate = ValueToDouble(pThis, argTwo);
+ nPeriod = ValueToDouble(pThis, argThree);
bFlags = ((nRate < 0) || (nPeriod <= 0) || (nAmount <= 0));
if (bFlags) {
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
@@ -2646,11 +2646,11 @@ void CXFA_FM2JSContext::FV(FXJSE_HOBJECT hThis,
L"FV");
}
}
-void CXFA_FM2JSContext::IPmt(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::IPmt(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 5) {
FX_BOOL bFlags = FALSE;
FX_FLOAT nPrincpalAmount = 0;
@@ -2658,22 +2658,22 @@ void CXFA_FM2JSContext::IPmt(FXJSE_HOBJECT hThis,
FX_FLOAT nPayment = 0;
FX_FLOAT nFirstMonth = 0;
FX_FLOAT nNumberOfMonths = 0;
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2);
- FXJSE_HVALUE argFour = GetSimpleHValue(hThis, args, 3);
- FXJSE_HVALUE argFive = GetSimpleHValue(hThis, args, 4);
- bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) ||
- HValueIsNull(hThis, argThree) || HValueIsNull(hThis, argFour) ||
- HValueIsNull(hThis, argFive));
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ CFXJSE_Value* argThree = GetSimpleValue(pThis, args, 2);
+ CFXJSE_Value* argFour = GetSimpleValue(pThis, args, 3);
+ CFXJSE_Value* argFive = GetSimpleValue(pThis, args, 4);
+ bFlags = (ValueIsNull(pThis, argOne) || ValueIsNull(pThis, argTwo) ||
+ ValueIsNull(pThis, argThree) || ValueIsNull(pThis, argFour) ||
+ ValueIsNull(pThis, argFive));
if (bFlags) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- nPrincpalAmount = HValueToFloat(hThis, argOne);
- nRate = HValueToFloat(hThis, argTwo);
- nPayment = HValueToFloat(hThis, argThree);
- nFirstMonth = HValueToFloat(hThis, argFour);
- nNumberOfMonths = HValueToFloat(hThis, argFive);
+ nPrincpalAmount = ValueToFloat(pThis, argOne);
+ nRate = ValueToFloat(pThis, argTwo);
+ nPayment = ValueToFloat(pThis, argThree);
+ nFirstMonth = ValueToFloat(pThis, argFour);
+ nNumberOfMonths = ValueToFloat(pThis, argFive);
bFlags = ((nPrincpalAmount <= 0) || (nRate <= 0) || (nPayment <= 0) ||
(nFirstMonth < 0) || (nNumberOfMonths < 0));
if (bFlags) {
@@ -2719,30 +2719,30 @@ void CXFA_FM2JSContext::IPmt(FXJSE_HOBJECT hThis,
L"IPmt");
}
}
-void CXFA_FM2JSContext::NPV(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::NPV(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
int32_t argc = args.GetLength();
if (argc > 2) {
FX_BOOL bFlags = FALSE;
- FXJSE_HVALUE* argValues = FX_Alloc(FXJSE_HVALUE, argc);
+ CFXJSE_Value** argValues = FX_Alloc(CFXJSE_Value*, argc);
for (int32_t i = 0; i < argc; i++) {
- argValues[i] = GetSimpleHValue(hThis, args, i);
- if (HValueIsNull(hThis, argValues[i])) {
+ argValues[i] = GetSimpleValue(pThis, args, i);
+ if (ValueIsNull(pThis, argValues[i])) {
bFlags = TRUE;
}
}
if (!bFlags) {
FX_DOUBLE nRate = 0;
- nRate = HValueToDouble(hThis, argValues[0]);
+ nRate = ValueToDouble(pThis, argValues[0]);
if (nRate <= 0) {
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
} else {
FX_DOUBLE* pData = FX_Alloc(FX_DOUBLE, argc - 1);
for (int32_t i = 1; i < argc; i++) {
- pData[i - 1] = HValueToDouble(hThis, argValues[i]);
+ pData[i - 1] = ValueToDouble(pThis, argValues[i]);
}
FX_DOUBLE nSum = 0;
int32_t iIndex = 0;
@@ -2770,27 +2770,27 @@ void CXFA_FM2JSContext::NPV(FXJSE_HOBJECT hThis,
L"NPV");
}
}
-void CXFA_FM2JSContext::Pmt(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Pmt(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 3) {
FX_BOOL bFlags = FALSE;
FX_FLOAT nPrincipal = 0;
FX_FLOAT nRate = 0;
FX_FLOAT nPeriods = 0;
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2);
- bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) ||
- HValueIsNull(hThis, argThree));
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ CFXJSE_Value* argThree = GetSimpleValue(pThis, args, 2);
+ bFlags = (ValueIsNull(pThis, argOne) || ValueIsNull(pThis, argTwo) ||
+ ValueIsNull(pThis, argThree));
if (bFlags) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- nPrincipal = HValueToFloat(hThis, argOne);
- nRate = HValueToFloat(hThis, argTwo);
- nPeriods = HValueToFloat(hThis, argThree);
+ nPrincipal = ValueToFloat(pThis, argOne);
+ nRate = ValueToFloat(pThis, argTwo);
+ nPeriods = ValueToFloat(pThis, argThree);
bFlags = ((nPrincipal <= 0) || (nRate <= 0) || (nPeriods <= 0));
if (bFlags) {
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
@@ -2813,11 +2813,11 @@ void CXFA_FM2JSContext::Pmt(FXJSE_HOBJECT hThis,
L"Pmt");
}
}
-void CXFA_FM2JSContext::PPmt(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::PPmt(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 5) {
FX_BOOL bFlags = FALSE;
FX_FLOAT nPrincpalAmount = 0;
@@ -2825,22 +2825,22 @@ void CXFA_FM2JSContext::PPmt(FXJSE_HOBJECT hThis,
FX_FLOAT nPayment = 0;
FX_FLOAT nFirstMonth = 0;
FX_FLOAT nNumberOfMonths = 0;
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2);
- FXJSE_HVALUE argFour = GetSimpleHValue(hThis, args, 3);
- FXJSE_HVALUE argFive = GetSimpleHValue(hThis, args, 4);
- bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) ||
- HValueIsNull(hThis, argThree) || HValueIsNull(hThis, argFour) ||
- HValueIsNull(hThis, argFive));
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ CFXJSE_Value* argThree = GetSimpleValue(pThis, args, 2);
+ CFXJSE_Value* argFour = GetSimpleValue(pThis, args, 3);
+ CFXJSE_Value* argFive = GetSimpleValue(pThis, args, 4);
+ bFlags = (ValueIsNull(pThis, argOne) || ValueIsNull(pThis, argTwo) ||
+ ValueIsNull(pThis, argThree) || ValueIsNull(pThis, argFour) ||
+ ValueIsNull(pThis, argFive));
if (bFlags) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- nPrincpalAmount = HValueToFloat(hThis, argOne);
- nRate = HValueToFloat(hThis, argTwo);
- nPayment = HValueToFloat(hThis, argThree);
- nFirstMonth = HValueToFloat(hThis, argFour);
- nNumberOfMonths = HValueToFloat(hThis, argFive);
+ nPrincpalAmount = ValueToFloat(pThis, argOne);
+ nRate = ValueToFloat(pThis, argTwo);
+ nPayment = ValueToFloat(pThis, argThree);
+ nFirstMonth = ValueToFloat(pThis, argFour);
+ nNumberOfMonths = ValueToFloat(pThis, argFive);
bFlags = ((nPrincpalAmount <= 0) || (nRate <= 0) || (nPayment <= 0) ||
(nFirstMonth < 0) || (nNumberOfMonths < 0));
if (bFlags) {
@@ -2887,27 +2887,27 @@ void CXFA_FM2JSContext::PPmt(FXJSE_HOBJECT hThis,
L"PPmt");
}
}
-void CXFA_FM2JSContext::PV(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::PV(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 3) {
FX_BOOL bFlags = FALSE;
FX_DOUBLE nAmount = 0;
FX_DOUBLE nRate = 0;
FX_DOUBLE nPeriod = 0;
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2);
- bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) ||
- HValueIsNull(hThis, argThree));
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ CFXJSE_Value* argThree = GetSimpleValue(pThis, args, 2);
+ bFlags = (ValueIsNull(pThis, argOne) || ValueIsNull(pThis, argTwo) ||
+ ValueIsNull(pThis, argThree));
if (bFlags) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- nAmount = HValueToDouble(hThis, argOne);
- nRate = HValueToDouble(hThis, argTwo);
- nPeriod = HValueToDouble(hThis, argThree);
+ nAmount = ValueToDouble(pThis, argOne);
+ nRate = ValueToDouble(pThis, argTwo);
+ nPeriod = ValueToDouble(pThis, argThree);
bFlags = ((nAmount <= 0) || (nRate < 0) || (nPeriod <= 0));
if (bFlags) {
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
@@ -2929,27 +2929,27 @@ void CXFA_FM2JSContext::PV(FXJSE_HOBJECT hThis,
L"PV");
}
}
-void CXFA_FM2JSContext::Rate(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Rate(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 3) {
FX_BOOL bFlags = FALSE;
FX_FLOAT nFuture = 0;
FX_FLOAT nPresent = 0;
FX_FLOAT nTotalNumber = 0;
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2);
- bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) ||
- HValueIsNull(hThis, argThree));
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ CFXJSE_Value* argThree = GetSimpleValue(pThis, args, 2);
+ bFlags = (ValueIsNull(pThis, argOne) || ValueIsNull(pThis, argTwo) ||
+ ValueIsNull(pThis, argThree));
if (bFlags) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- nFuture = HValueToFloat(hThis, argOne);
- nPresent = HValueToFloat(hThis, argTwo);
- nTotalNumber = HValueToFloat(hThis, argThree);
+ nFuture = ValueToFloat(pThis, argOne);
+ nPresent = ValueToFloat(pThis, argTwo);
+ nTotalNumber = ValueToFloat(pThis, argThree);
bFlags = ((nFuture <= 0) || (nPresent < 0) || (nTotalNumber <= 0));
if (bFlags) {
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
@@ -2968,27 +2968,27 @@ void CXFA_FM2JSContext::Rate(FXJSE_HOBJECT hThis,
L"Rate");
}
}
-void CXFA_FM2JSContext::Term(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Term(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 3) {
FX_BOOL bFlags = FALSE;
FX_FLOAT nMount = 0;
FX_FLOAT nRate = 0;
FX_FLOAT nFuture = 0;
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2);
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ CFXJSE_Value* argThree = GetSimpleValue(pThis, args, 2);
bFlags = (FXJSE_Value_IsNull(argOne) || FXJSE_Value_IsNull(argTwo) ||
FXJSE_Value_IsNull(argThree));
if (bFlags) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- nMount = HValueToFloat(hThis, argOne);
- nRate = HValueToFloat(hThis, argTwo);
- nFuture = HValueToFloat(hThis, argThree);
+ nMount = ValueToFloat(pThis, argOne);
+ nRate = ValueToFloat(pThis, argTwo);
+ nFuture = ValueToFloat(pThis, argThree);
bFlags = ((nMount <= 0) || (nRate <= 0) || (nFuture <= 0));
if (bFlags) {
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
@@ -3007,20 +3007,20 @@ void CXFA_FM2JSContext::Term(FXJSE_HOBJECT hThis,
L"Term");
}
}
-void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Choose(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
int32_t argc = args.GetLength();
if (argc > 1) {
- FXJSE_HVALUE argOne = args.GetValue(0);
+ CFXJSE_Value* argOne = args.GetValue(0);
FX_BOOL argOneIsNull = FALSE;
int32_t iIndex = 0;
- argOneIsNull = HValueIsNull(hThis, argOne);
+ argOneIsNull = ValueIsNull(pThis, argOne);
if (!argOneIsNull) {
- iIndex = (int32_t)HValueToFloat(hThis, argOne);
+ iIndex = (int32_t)ValueToFloat(pThis, argOne);
}
FXJSE_Value_Release(argOne);
if (argOneIsNull) {
@@ -3033,9 +3033,9 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis,
int32_t iArgIndex = 1;
int32_t iValueIndex = 0;
while (!bFound && !bStopCounterFlags && (iArgIndex < argc)) {
- FXJSE_HVALUE argIndexValue = args.GetValue(iArgIndex);
+ CFXJSE_Value* argIndexValue = args.GetValue(iArgIndex);
if (FXJSE_Value_IsArray(argIndexValue)) {
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argIndexValue, "length", lengthValue);
int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
@@ -3044,9 +3044,9 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis,
}
iValueIndex += (iLength - 2);
if (iValueIndex >= iIndex) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE newProperty = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsobjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newProperty = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argIndexValue, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(
argIndexValue, ((iLength - 1) - (iValueIndex - iIndex)),
@@ -3060,7 +3060,7 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis,
newProperty);
}
CFX_ByteString bsChoosed;
- HValueToUTF8String(newProperty, bsChoosed);
+ ValueToUTF8String(newProperty, bsChoosed);
FXJSE_Value_SetUTF8String(args.GetReturnValue(),
bsChoosed.AsStringC());
FXJSE_Value_Release(newProperty);
@@ -3072,7 +3072,7 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis,
iValueIndex++;
if (iValueIndex == iIndex) {
CFX_ByteString bsChoosed;
- HValueToUTF8String(argIndexValue, bsChoosed);
+ ValueToUTF8String(argIndexValue, bsChoosed);
FXJSE_Value_SetUTF8String(args.GetReturnValue(),
bsChoosed.AsStringC());
bFound = TRUE;
@@ -3087,30 +3087,30 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Choose");
}
}
-void CXFA_FM2JSContext::Exists(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Exists(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 1) {
- FXJSE_HVALUE argOne = args.GetValue(0);
+ CFXJSE_Value* argOne = args.GetValue(0);
FXJSE_Value_SetInteger(args.GetReturnValue(), FXJSE_Value_IsObject(argOne));
FXJSE_Value_Release(argOne);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Exists");
}
}
-void CXFA_FM2JSContext::HasValue(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::HasValue(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 1) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
if (FXJSE_Value_IsUTF8String(argOne)) {
CFX_ByteString valueStr;
FXJSE_Value_ToUTF8String(argOne, valueStr);
@@ -3124,23 +3124,23 @@ void CXFA_FM2JSContext::HasValue(FXJSE_HOBJECT hThis,
FXJSE_Value_Release(argOne);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"HasValue");
}
}
-void CXFA_FM2JSContext::Oneof(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Oneof(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
if (argc > 1) {
FX_BOOL bFlags = FALSE;
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE* parametersValue = 0;
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value** parametersValue = nullptr;
int32_t iCount = 0;
- unfoldArgs(hThis, args, parametersValue, iCount, 1);
+ unfoldArgs(pThis, args, parametersValue, iCount, 1);
for (int32_t i = 0; i < iCount; i++) {
- if (simpleValueCompare(hThis, argOne, parametersValue[i])) {
+ if (simpleValueCompare(pThis, argOne, parametersValue[i])) {
bFlags = TRUE;
break;
}
@@ -3154,26 +3154,26 @@ void CXFA_FM2JSContext::Oneof(FXJSE_HOBJECT hThis,
parametersValue = 0;
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Oneof");
}
}
-void CXFA_FM2JSContext::Within(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Within(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
if (argc == 3) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
if (FXJSE_Value_IsNull(argOne)) {
FXJSE_Value_SetUndefined(args.GetReturnValue());
} else {
- FXJSE_HVALUE argLow = GetSimpleHValue(hThis, args, 1);
- FXJSE_HVALUE argHeight = GetSimpleHValue(hThis, args, 2);
+ CFXJSE_Value* argLow = GetSimpleValue(pThis, args, 1);
+ CFXJSE_Value* argHeight = GetSimpleValue(pThis, args, 2);
if (FXJSE_Value_IsNumber(argOne)) {
- FX_FLOAT oneNumber = HValueToFloat(hThis, argOne);
- FX_FLOAT lowNumber = HValueToFloat(hThis, argLow);
- FX_FLOAT heightNumber = HValueToFloat(hThis, argHeight);
+ FX_FLOAT oneNumber = ValueToFloat(pThis, argOne);
+ FX_FLOAT lowNumber = ValueToFloat(pThis, argLow);
+ FX_FLOAT heightNumber = ValueToFloat(pThis, argHeight);
FXJSE_Value_SetInteger(
args.GetReturnValue(),
((oneNumber >= lowNumber) && (oneNumber <= heightNumber)));
@@ -3181,9 +3181,9 @@ void CXFA_FM2JSContext::Within(FXJSE_HOBJECT hThis,
CFX_ByteString oneString;
CFX_ByteString lowString;
CFX_ByteString heightString;
- HValueToUTF8String(argOne, oneString);
- HValueToUTF8String(argLow, lowString);
- HValueToUTF8String(argHeight, heightString);
+ ValueToUTF8String(argOne, oneString);
+ ValueToUTF8String(argLow, lowString);
+ ValueToUTF8String(argHeight, heightString);
FXJSE_Value_SetInteger(
args.GetReturnValue(),
((oneString.Compare(lowString.AsStringC()) >= 0) &&
@@ -3195,18 +3195,18 @@ void CXFA_FM2JSContext::Within(FXJSE_HOBJECT hThis,
FXJSE_Value_Release(argOne);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Within");
}
}
-void CXFA_FM2JSContext::If(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::If(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 3) {
- FXJSE_HVALUE argCondition = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argFirstValue = GetSimpleHValue(hThis, args, 1);
- FXJSE_HVALUE argSecondValue = GetSimpleHValue(hThis, args, 2);
+ CFXJSE_Value* argCondition = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argFirstValue = GetSimpleValue(pThis, args, 1);
+ CFXJSE_Value* argSecondValue = GetSimpleValue(pThis, args, 2);
FX_BOOL bCondition = FXJSE_Value_ToBoolean(argCondition);
FXJSE_Value_Set(args.GetReturnValue(),
bCondition ? argFirstValue : argSecondValue);
@@ -3215,21 +3215,21 @@ void CXFA_FM2JSContext::If(FXJSE_HOBJECT hThis,
FXJSE_Value_Release(argCondition);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"If");
}
}
-void CXFA_FM2JSContext::Eval(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Eval(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
if (args.GetLength() == 1) {
- FXJSE_HVALUE scriptValue = GetSimpleHValue(hThis, args, 0);
+ CFXJSE_Value* scriptValue = GetSimpleValue(pThis, args, 0);
CFX_ByteString utf8ScriptString;
- HValueToUTF8String(scriptValue, utf8ScriptString);
+ ValueToUTF8String(scriptValue, utf8ScriptString);
if (utf8ScriptString.IsEmpty()) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
@@ -3240,7 +3240,7 @@ void CXFA_FM2JSContext::Eval(FXJSE_HOBJECT hThis,
CFX_WideString::FromUTF8(utf8ScriptString.AsStringC()).AsStringC(),
wsJavaScriptBuf, wsError);
CFXJSE_Context* pContext = FXJSE_Context_Create(pIsolate);
- FXJSE_HVALUE returnValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* returnValue = FXJSE_Value_Create(pIsolate);
javaScript = wsJavaScriptBuf.AsStringC();
FXJSE_ExecuteScript(
pContext,
@@ -3256,16 +3256,16 @@ void CXFA_FM2JSContext::Eval(FXJSE_HOBJECT hThis,
L"Eval");
}
}
-void CXFA_FM2JSContext::Ref(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Ref(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
if (args.GetLength() == 1) {
- FXJSE_HVALUE argOne = args.GetValue(0);
+ CFXJSE_Value* argOne = args.GetValue(0);
if (FXJSE_Value_IsNull(argOne)) {
- FXJSE_HVALUE rgValues[3];
+ CFXJSE_Value* rgValues[3];
for (int32_t i = 0; i < 3; i++) {
rgValues[i] = FXJSE_Value_Create(pIsolate);
}
@@ -3278,20 +3278,20 @@ void CXFA_FM2JSContext::Ref(FXJSE_HOBJECT hThis,
}
} else if (FXJSE_Value_IsArray(argOne)) {
#ifndef NDEBUG
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argOne, "length", lengthValue);
ASSERT(FXJSE_Value_ToInteger(lengthValue) >= 3);
FXJSE_Value_Release(lengthValue);
#endif
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsObjectValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argOne, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(argOne, 2, jsObjectValue);
if (FXJSE_Value_IsNull(jsObjectValue)) {
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
} else if (FXJSE_Value_IsNull(propertyValue) &&
(!FXJSE_Value_IsNull(jsObjectValue))) {
- FXJSE_HVALUE rgValues[3];
+ CFXJSE_Value* rgValues[3];
for (int32_t i = 0; i < 3; i++) {
rgValues[i] = FXJSE_Value_Create(pIsolate);
}
@@ -3308,7 +3308,7 @@ void CXFA_FM2JSContext::Ref(FXJSE_HOBJECT hThis,
FXJSE_Value_Release(jsObjectValue);
FXJSE_Value_Release(propertyValue);
} else if (FXJSE_Value_IsObject(argOne)) {
- FXJSE_HVALUE rgValues[3];
+ CFXJSE_Value* rgValues[3];
for (int32_t i = 0; i < 3; i++) {
rgValues[i] = FXJSE_Value_Create(pIsolate);
}
@@ -3332,18 +3332,18 @@ void CXFA_FM2JSContext::Ref(FXJSE_HOBJECT hThis,
L"Ref");
}
}
-void CXFA_FM2JSContext::UnitType(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::UnitType(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 1) {
- FXJSE_HVALUE unitspanValue = GetSimpleHValue(hThis, args, 0);
+ CFXJSE_Value* unitspanValue = GetSimpleValue(pThis, args, 0);
if (FXJSE_Value_IsNull(unitspanValue)) {
FXJSE_Value_SetNull(args.GetReturnValue());
FXJSE_Value_Release(unitspanValue);
return;
}
CFX_ByteString unitspanString;
- HValueToUTF8String(unitspanValue, unitspanString);
+ ValueToUTF8String(unitspanValue, unitspanString);
if (unitspanString.IsEmpty()) {
FXJSE_Value_SetUTF8String(args.GetReturnValue(), "in");
} else {
@@ -3444,18 +3444,18 @@ void CXFA_FM2JSContext::UnitType(FXJSE_HOBJECT hThis,
FXJSE_Value_Release(unitspanValue);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"UnitType");
}
}
-void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::UnitValue(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
if ((argc == 1) || (argc == 2)) {
- FXJSE_HVALUE unitspanValue = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE unitValue = 0;
+ CFXJSE_Value* unitspanValue = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* unitValue = nullptr;
CFX_ByteString unitspanString;
FX_DOUBLE dFirstNumber = 0;
CFX_ByteString strFirstUnit;
@@ -3463,7 +3463,7 @@ void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis,
if (FXJSE_Value_IsNull(unitspanValue)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- HValueToUTF8String(unitspanValue, unitspanString);
+ ValueToUTF8String(unitspanValue, unitspanString);
const FX_CHAR* pData = unitspanString.c_str();
if (pData) {
int32_t u = 0;
@@ -3496,9 +3496,9 @@ void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis,
}
strFirstUnit.MakeLower();
if (argc == 2) {
- unitValue = GetSimpleHValue(hThis, args, 1);
+ unitValue = GetSimpleValue(pThis, args, 1);
CFX_ByteString unitTempString;
- HValueToUTF8String(unitValue, unitTempString);
+ ValueToUTF8String(unitValue, unitTempString);
const FX_CHAR* pData = unitTempString.c_str();
int32_t u = 0;
while (*(pData + u) == ' ' || *(pData + u) == 0x09 ||
@@ -3603,29 +3603,29 @@ void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"UnitValue");
}
}
-void CXFA_FM2JSContext::At(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::At(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 2) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- if (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo)) {
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ if (ValueIsNull(pThis, argOne) || ValueIsNull(pThis, argTwo)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CFX_ByteString stringTwo;
- HValueToUTF8String(argTwo, stringTwo);
+ ValueToUTF8String(argTwo, stringTwo);
if (stringTwo.IsEmpty()) {
FXJSE_Value_SetInteger(args.GetReturnValue(), 1);
} else {
CFX_ByteString stringOne;
- HValueToUTF8String(argOne, stringOne);
+ ValueToUTF8String(argOne, stringOne);
FX_STRSIZE iPosition = stringOne.Find(stringTwo.AsStringC());
FXJSE_Value_SetInteger(args.GetReturnValue(), iPosition + 1);
}
@@ -3637,21 +3637,21 @@ void CXFA_FM2JSContext::At(FXJSE_HOBJECT hThis,
L"At");
}
}
-void CXFA_FM2JSContext::Concat(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Concat(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
int32_t argc = args.GetLength();
if (argc >= 1) {
CFX_ByteString resultString;
FX_BOOL bAllNull = TRUE;
- FXJSE_HVALUE* argValues = FX_Alloc(FXJSE_HVALUE, argc);
+ CFXJSE_Value** argValues = FX_Alloc(CFXJSE_Value*, argc);
for (int32_t i = 0; i < argc; i++) {
- argValues[i] = GetSimpleHValue(hThis, args, i);
- if (!HValueIsNull(hThis, argValues[i])) {
+ argValues[i] = GetSimpleValue(pThis, args, i);
+ if (!ValueIsNull(pThis, argValues[i])) {
CFX_ByteString valueStr;
- HValueToUTF8String(argValues[i], valueStr);
+ ValueToUTF8String(argValues[i], valueStr);
resultString += valueStr;
bAllNull = FALSE;
}
@@ -3671,34 +3671,34 @@ void CXFA_FM2JSContext::Concat(FXJSE_HOBJECT hThis,
L"Concat");
}
}
-void CXFA_FM2JSContext::Decode(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Decode(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
int32_t argc = args.GetLength();
if (argc == 1) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- if (HValueIsNull(hThis, argOne)) {
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ if (ValueIsNull(pThis, argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CFX_ByteString toDecodeString;
- HValueToUTF8String(argOne, toDecodeString);
+ ValueToUTF8String(argOne, toDecodeString);
CFX_ByteTextBuf resultBuf;
DecodeURL(toDecodeString.AsStringC(), resultBuf);
FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultBuf.AsStringC());
}
FXJSE_Value_Release(argOne);
} else if (argc == 2) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- if (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo)) {
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ if (ValueIsNull(pThis, argOne) || ValueIsNull(pThis, argTwo)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CFX_ByteString toDecodeString;
- HValueToUTF8String(argOne, toDecodeString);
+ ValueToUTF8String(argOne, toDecodeString);
CFX_ByteString identifyString;
- HValueToUTF8String(argTwo, identifyString);
+ ValueToUTF8String(argTwo, identifyString);
CFX_ByteTextBuf resultBuf;
if (identifyString.EqualNoCase("html")) {
DecodeHTML(toDecodeString.AsStringC(), resultBuf);
@@ -3942,34 +3942,34 @@ void CXFA_FM2JSContext::DecodeXML(const CFX_ByteStringC& szXMLString,
szResultString << FX_UTF8Encode(wsXMLBuf.GetBuffer(), wsXMLBuf.GetLength())
.AsStringC();
}
-void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Encode(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
int32_t argc = args.GetLength();
if (argc == 1) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- if (HValueIsNull(hThis, argOne)) {
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ if (ValueIsNull(pThis, argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CFX_ByteString toEncodeString;
- HValueToUTF8String(argOne, toEncodeString);
+ ValueToUTF8String(argOne, toEncodeString);
CFX_ByteTextBuf resultBuf;
EncodeURL(toEncodeString.AsStringC(), resultBuf);
FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultBuf.AsStringC());
}
FXJSE_Value_Release(argOne);
} else if (argc == 2) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- if (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo)) {
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ if (ValueIsNull(pThis, argOne) || ValueIsNull(pThis, argTwo)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CFX_ByteString toEncodeString;
- HValueToUTF8String(argOne, toEncodeString);
+ ValueToUTF8String(argOne, toEncodeString);
CFX_ByteString identifyString;
- HValueToUTF8String(argTwo, identifyString);
+ ValueToUTF8String(argTwo, identifyString);
CFX_ByteTextBuf resultBuf;
if (identifyString.EqualNoCase("html")) {
EncodeHTML(toEncodeString.AsStringC(), resultBuf);
@@ -4353,19 +4353,19 @@ static FX_BOOL XFA_PATTERN_STRING_Type(const CFX_ByteStringC& szPattern,
}
return FALSE;
}
-void CXFA_FM2JSContext::Format(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Format(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
int32_t argc = args.GetLength();
if (argc >= 2) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
CFX_ByteString szPattern;
- HValueToUTF8String(argOne, szPattern);
+ ValueToUTF8String(argOne, szPattern);
CFX_ByteString szValue;
- HValueToUTF8String(argTwo, szValue);
+ ValueToUTF8String(argTwo, szValue);
CXFA_Document* pDoc = pContext->GetDocument();
IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr();
CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject());
@@ -4441,24 +4441,24 @@ void CXFA_FM2JSContext::Format(FXJSE_HOBJECT hThis,
L"Format");
}
}
-void CXFA_FM2JSContext::Left(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Left(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 2) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
FX_BOOL argIsNull = FALSE;
- if ((HValueIsNull(hThis, argOne)) || (HValueIsNull(hThis, argTwo))) {
+ if ((ValueIsNull(pThis, argOne)) || (ValueIsNull(pThis, argTwo))) {
argIsNull = TRUE;
}
if (argIsNull) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CFX_ByteString sourceString;
- HValueToUTF8String(argOne, sourceString);
- int32_t count = HValueToInteger(hThis, argTwo);
+ ValueToUTF8String(argOne, sourceString);
+ int32_t count = ValueToInteger(pThis, argTwo);
if (count < 0) {
count = 0;
}
@@ -4472,18 +4472,18 @@ void CXFA_FM2JSContext::Left(FXJSE_HOBJECT hThis,
L"Left");
}
}
-void CXFA_FM2JSContext::Len(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Len(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 1) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- if (HValueIsNull(hThis, argOne)) {
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ if (ValueIsNull(pThis, argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CFX_ByteString sourceString;
- HValueToUTF8String(argOne, sourceString);
+ ValueToUTF8String(argOne, sourceString);
FXJSE_Value_SetInteger(args.GetReturnValue(), sourceString.GetLength());
}
FXJSE_Value_Release(argOne);
@@ -4492,21 +4492,21 @@ void CXFA_FM2JSContext::Len(FXJSE_HOBJECT hThis,
L"Len");
}
}
-void CXFA_FM2JSContext::Lower(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Lower(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
if ((argc > 0) && (argc < 3)) {
CFX_ByteString argString;
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE localeValue = 0;
- if (HValueIsNull(hThis, argOne)) {
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* localeValue = nullptr;
+ if (ValueIsNull(pThis, argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
if (argc == 2) {
- localeValue = GetSimpleHValue(hThis, args, 1);
+ localeValue = GetSimpleValue(pThis, args, 1);
}
- HValueToUTF8String(argOne, argString);
+ ValueToUTF8String(argOne, argString);
CFX_WideTextBuf lowStringBuf;
CFX_WideString wsArgString =
CFX_WideString::FromUTF8(argString.AsStringC());
@@ -4538,23 +4538,23 @@ void CXFA_FM2JSContext::Lower(FXJSE_HOBJECT hThis,
FXJSE_Value_Release(argOne);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Lower");
}
}
-void CXFA_FM2JSContext::Ltrim(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Ltrim(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 1) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- if (HValueIsNull(hThis, argOne)) {
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ if (ValueIsNull(pThis, argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CFX_ByteString sourceString;
- HValueToUTF8String(argOne, sourceString);
+ ValueToUTF8String(argOne, sourceString);
sourceString.TrimLeft();
FXJSE_Value_SetUTF8String(args.GetReturnValue(),
sourceString.AsStringC());
@@ -4565,21 +4565,21 @@ void CXFA_FM2JSContext::Ltrim(FXJSE_HOBJECT hThis,
L"Ltrim");
}
}
-void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Parse(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 2) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- if (HValueIsNull(hThis, argTwo)) {
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ if (ValueIsNull(pThis, argTwo)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CFX_ByteString szPattern;
- HValueToUTF8String(argOne, szPattern);
+ ValueToUTF8String(argOne, szPattern);
CFX_ByteString szValue;
- HValueToUTF8String(argTwo, szValue);
+ ValueToUTF8String(argTwo, szValue);
CXFA_Document* pDoc = pContext->GetDocument();
IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr();
CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject());
@@ -4708,24 +4708,24 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis,
L"Parse");
}
}
-void CXFA_FM2JSContext::Replace(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Replace(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
if ((argc == 2) || (argc == 3)) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- FXJSE_HVALUE argThree = 0;
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ CFXJSE_Value* argThree = nullptr;
CFX_ByteString oneString;
CFX_ByteString twoString;
CFX_ByteString threeString;
- if (!HValueIsNull(hThis, argOne) && !HValueIsNull(hThis, argTwo)) {
- HValueToUTF8String(argOne, oneString);
- HValueToUTF8String(argTwo, twoString);
+ if (!ValueIsNull(pThis, argOne) && !ValueIsNull(pThis, argTwo)) {
+ ValueToUTF8String(argOne, oneString);
+ ValueToUTF8String(argTwo, twoString);
}
if (argc == 3) {
- argThree = GetSimpleHValue(hThis, args, 2);
- HValueToUTF8String(argThree, threeString);
+ argThree = GetSimpleValue(pThis, args, 2);
+ ValueToUTF8String(argThree, threeString);
}
int32_t iSrcLen = oneString.GetLength();
int32_t iFindLen = twoString.GetLength();
@@ -4768,29 +4768,29 @@ void CXFA_FM2JSContext::Replace(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Replace");
}
}
-void CXFA_FM2JSContext::Right(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Right(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 2) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
FX_BOOL argIsNull = FALSE;
- if ((HValueIsNull(hThis, argOne)) || (HValueIsNull(hThis, argTwo))) {
+ if ((ValueIsNull(pThis, argOne)) || (ValueIsNull(pThis, argTwo))) {
argIsNull = TRUE;
}
if (argIsNull) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CFX_ByteString sourceString;
- HValueToUTF8String(argOne, sourceString);
- int32_t count = HValueToInteger(hThis, argTwo);
+ ValueToUTF8String(argOne, sourceString);
+ int32_t count = ValueToInteger(pThis, argTwo);
if (count < 0) {
count = 0;
}
@@ -4804,18 +4804,18 @@ void CXFA_FM2JSContext::Right(FXJSE_HOBJECT hThis,
L"Right");
}
}
-void CXFA_FM2JSContext::Rtrim(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Rtrim(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 1) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- if (HValueIsNull(hThis, argOne)) {
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ if (ValueIsNull(pThis, argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CFX_ByteString sourceString;
- HValueToUTF8String(argOne, sourceString);
+ ValueToUTF8String(argOne, sourceString);
sourceString.TrimRight();
FXJSE_Value_SetUTF8String(args.GetReturnValue(),
sourceString.AsStringC());
@@ -4826,18 +4826,18 @@ void CXFA_FM2JSContext::Rtrim(FXJSE_HOBJECT hThis,
L"Rtrim");
}
}
-void CXFA_FM2JSContext::Space(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Space(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 1) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
if (FXJSE_Value_IsNull(argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
int32_t count = 0;
- count = HValueToInteger(hThis, argOne);
+ count = ValueToInteger(pThis, argOne);
count = (count < 0) ? 0 : count;
CFX_ByteTextBuf spaceString;
int32_t index = 0;
@@ -4854,7 +4854,7 @@ void CXFA_FM2JSContext::Space(FXJSE_HOBJECT hThis,
L"Space");
}
}
-void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Str(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
@@ -4863,21 +4863,21 @@ void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis,
FX_FLOAT fNumber = 0.0f;
int32_t iWidth = 10;
int32_t iPrecision = 0;
- FXJSE_HVALUE numberValue = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE widthValue = 0;
- FXJSE_HVALUE precisionValue = 0;
+ CFXJSE_Value* numberValue = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* widthValue = nullptr;
+ CFXJSE_Value* precisionValue = nullptr;
if (FXJSE_Value_IsNull(numberValue)) {
bFlags = TRUE;
} else {
- fNumber = HValueToFloat(hThis, numberValue);
+ fNumber = ValueToFloat(pThis, numberValue);
}
if (argc > 1) {
- widthValue = GetSimpleHValue(hThis, args, 1);
- iWidth = (int32_t)HValueToFloat(hThis, widthValue);
+ widthValue = GetSimpleValue(pThis, args, 1);
+ iWidth = (int32_t)ValueToFloat(pThis, widthValue);
}
if (argc == 3) {
- precisionValue = GetSimpleHValue(hThis, args, 2);
- iPrecision = (int32_t)HValueToFloat(hThis, precisionValue);
+ precisionValue = GetSimpleValue(pThis, args, 2);
+ iPrecision = (int32_t)ValueToFloat(pThis, precisionValue);
if (iPrecision < 0) {
iPrecision = 0;
}
@@ -4975,12 +4975,12 @@ void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Str");
}
}
-void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Stuff(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
@@ -4990,29 +4990,29 @@ void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis,
int32_t iLength = 0;
int32_t iStart = 0;
int32_t iDelete = 0;
- FXJSE_HVALUE sourceValue = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE startValue = GetSimpleHValue(hThis, args, 1);
- FXJSE_HVALUE deleteValue = GetSimpleHValue(hThis, args, 2);
- FXJSE_HVALUE insertValue = 0;
+ CFXJSE_Value* sourceValue = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* startValue = GetSimpleValue(pThis, args, 1);
+ CFXJSE_Value* deleteValue = GetSimpleValue(pThis, args, 2);
+ CFXJSE_Value* insertValue = nullptr;
if (!FXJSE_Value_IsNull(sourceValue) && !FXJSE_Value_IsNull(startValue) &&
!FXJSE_Value_IsNull(deleteValue)) {
- HValueToUTF8String(sourceValue, sourceString);
+ ValueToUTF8String(sourceValue, sourceString);
iLength = sourceString.GetLength();
- iStart = (int32_t)HValueToFloat(hThis, startValue);
+ iStart = (int32_t)ValueToFloat(pThis, startValue);
if (iStart < 1) {
iStart = 1;
}
if (iStart > iLength) {
iStart = iLength;
}
- iDelete = (int32_t)HValueToFloat(hThis, deleteValue);
+ iDelete = (int32_t)ValueToFloat(pThis, deleteValue);
if (iDelete <= 0) {
iDelete = 0;
}
}
if (argc == 4) {
- insertValue = GetSimpleHValue(hThis, args, 3);
- HValueToUTF8String(insertValue, insertString);
+ insertValue = GetSimpleValue(pThis, args, 3);
+ ValueToUTF8String(insertValue, insertString);
}
iStart -= 1;
CFX_ByteTextBuf resultString;
@@ -5037,33 +5037,33 @@ void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Stuff");
}
}
-void CXFA_FM2JSContext::Substr(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Substr(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
if (argc == 3) {
- FXJSE_HVALUE stringValue = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE startValue = GetSimpleHValue(hThis, args, 1);
- FXJSE_HVALUE endValue = GetSimpleHValue(hThis, args, 2);
- if (HValueIsNull(hThis, stringValue) || (HValueIsNull(hThis, startValue)) ||
- (HValueIsNull(hThis, endValue))) {
+ CFXJSE_Value* stringValue = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* startValue = GetSimpleValue(pThis, args, 1);
+ CFXJSE_Value* endValue = GetSimpleValue(pThis, args, 2);
+ if (ValueIsNull(pThis, stringValue) || (ValueIsNull(pThis, startValue)) ||
+ (ValueIsNull(pThis, endValue))) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CFX_ByteString szSourceStr;
int32_t iStart = 0;
int32_t iCount = 0;
- HValueToUTF8String(stringValue, szSourceStr);
+ ValueToUTF8String(stringValue, szSourceStr);
int32_t iLength = szSourceStr.GetLength();
if (iLength == 0) {
FXJSE_Value_SetUTF8String(args.GetReturnValue(), "");
} else {
- iStart = (int32_t)HValueToFloat(hThis, startValue);
- iCount = (int32_t)HValueToFloat(hThis, endValue);
+ iStart = (int32_t)ValueToFloat(pThis, startValue);
+ iCount = (int32_t)ValueToFloat(pThis, endValue);
if (iStart < 1) {
iStart = 1;
}
@@ -5083,21 +5083,21 @@ void CXFA_FM2JSContext::Substr(FXJSE_HOBJECT hThis,
FXJSE_Value_Release(endValue);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Substr");
}
}
-void CXFA_FM2JSContext::Uuid(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Uuid(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
if ((argc == 0) || (argc == 1)) {
int32_t iNum = 0;
- FXJSE_HVALUE argOne = 0;
+ CFXJSE_Value* argOne = nullptr;
if (argc == 1) {
- argOne = GetSimpleHValue(hThis, args, 0);
- iNum = (int32_t)HValueToFloat(hThis, argOne);
+ argOne = GetSimpleValue(pThis, args, 0);
+ iNum = (int32_t)ValueToFloat(pThis, argOne);
}
FX_GUID guid;
FX_GUID_CreateV4(&guid);
@@ -5109,26 +5109,26 @@ void CXFA_FM2JSContext::Uuid(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Uuid");
}
}
-void CXFA_FM2JSContext::Upper(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Upper(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
if ((argc > 0) && (argc < 3)) {
CFX_ByteString argString;
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE localeValue = 0;
- if (HValueIsNull(hThis, argOne)) {
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* localeValue = nullptr;
+ if (ValueIsNull(pThis, argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
if (argc == 2) {
- localeValue = GetSimpleHValue(hThis, args, 1);
+ localeValue = GetSimpleValue(pThis, args, 1);
}
- HValueToUTF8String(argOne, argString);
+ ValueToUTF8String(argOne, argString);
CFX_WideTextBuf upperStringBuf;
CFX_WideString wsArgString =
CFX_WideString::FromUTF8(argString.AsStringC());
@@ -5160,12 +5160,12 @@ void CXFA_FM2JSContext::Upper(FXJSE_HOBJECT hThis,
FXJSE_Value_Release(argOne);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"Upper");
}
}
-void CXFA_FM2JSContext::WordNum(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::WordNum(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
@@ -5174,28 +5174,28 @@ void CXFA_FM2JSContext::WordNum(FXJSE_HOBJECT hThis,
FX_FLOAT fNumber = 0.0f;
int32_t iIdentifier = 0;
CFX_ByteString localeString;
- FXJSE_HVALUE numberValue = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE identifierValue = 0;
- FXJSE_HVALUE localeValue = 0;
+ CFXJSE_Value* numberValue = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* identifierValue = nullptr;
+ CFXJSE_Value* localeValue = nullptr;
if (FXJSE_Value_IsNull(numberValue)) {
bFlags = TRUE;
} else {
- fNumber = HValueToFloat(hThis, numberValue);
+ fNumber = ValueToFloat(pThis, numberValue);
}
if (argc > 1) {
- identifierValue = GetSimpleHValue(hThis, args, 1);
+ identifierValue = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(identifierValue)) {
bFlags = TRUE;
} else {
- iIdentifier = (int32_t)HValueToFloat(hThis, identifierValue);
+ iIdentifier = (int32_t)ValueToFloat(pThis, identifierValue);
}
}
if (argc == 3) {
- localeValue = GetSimpleHValue(hThis, args, 2);
+ localeValue = GetSimpleValue(pThis, args, 2);
if (FXJSE_Value_IsNull(localeValue)) {
bFlags = TRUE;
} else {
- HValueToUTF8String(localeValue, localeString);
+ ValueToUTF8String(localeValue, localeString);
}
}
if (!bFlags) {
@@ -5220,7 +5220,7 @@ void CXFA_FM2JSContext::WordNum(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
L"WordNum");
}
@@ -5420,11 +5420,11 @@ void CXFA_FM2JSContext::WordUS(const CFX_ByteStringC& szData,
break;
}
}
-void CXFA_FM2JSContext::Get(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Get(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
int32_t argc = args.GetLength();
if (argc == 1) {
CXFA_Document* pDoc = pContext->GetDocument();
@@ -5436,9 +5436,9 @@ void CXFA_FM2JSContext::Get(FXJSE_HOBJECT hThis,
if (!pAppProvider) {
return;
}
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
CFX_ByteString urlString;
- HValueToUTF8String(argOne, urlString);
+ ValueToUTF8String(argOne, urlString);
IFX_FileRead* pFile = pAppProvider->DownloadURL(
CFX_WideString::FromUTF8(urlString.AsStringC()));
if (pFile) {
@@ -5456,11 +5456,11 @@ void CXFA_FM2JSContext::Get(FXJSE_HOBJECT hThis,
L"Get");
}
}
-void CXFA_FM2JSContext::Post(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Post(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
int32_t argc = args.GetLength();
if ((argc >= 2) && (argc <= 5)) {
CXFA_Document* pDoc = pContext->GetDocument();
@@ -5477,24 +5477,24 @@ void CXFA_FM2JSContext::Post(FXJSE_HOBJECT hThis,
CFX_ByteString bsContentType;
CFX_ByteString bsEncode;
CFX_ByteString bsHeader;
- FXJSE_HVALUE argThree = nullptr;
- FXJSE_HVALUE argFour = nullptr;
- FXJSE_HVALUE argFive = nullptr;
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- HValueToUTF8String(argOne, bsURL);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- HValueToUTF8String(argTwo, bsData);
+ CFXJSE_Value* argThree = nullptr;
+ CFXJSE_Value* argFour = nullptr;
+ CFXJSE_Value* argFive = nullptr;
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ ValueToUTF8String(argOne, bsURL);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ ValueToUTF8String(argTwo, bsData);
if (argc > 2) {
- argThree = GetSimpleHValue(hThis, args, 2);
- HValueToUTF8String(argThree, bsContentType);
+ argThree = GetSimpleValue(pThis, args, 2);
+ ValueToUTF8String(argThree, bsContentType);
}
if (argc > 3) {
- argFour = GetSimpleHValue(hThis, args, 3);
- HValueToUTF8String(argFour, bsEncode);
+ argFour = GetSimpleValue(pThis, args, 3);
+ ValueToUTF8String(argFour, bsEncode);
}
if (argc > 4) {
- argFive = GetSimpleHValue(hThis, args, 4);
- HValueToUTF8String(argFive, bsHeader);
+ argFive = GetSimpleValue(pThis, args, 4);
+ ValueToUTF8String(argFive, bsHeader);
}
CFX_WideString decodedResponse;
FX_BOOL bFlags = pAppProvider->PostRequestURL(
@@ -5527,11 +5527,11 @@ void CXFA_FM2JSContext::Post(FXJSE_HOBJECT hThis,
L"Post");
}
}
-void CXFA_FM2JSContext::Put(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::Put(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
int32_t argc = args.GetLength();
if ((argc == 2) || (argc == 3)) {
CXFA_Document* pDoc = pContext->GetDocument();
@@ -5546,14 +5546,14 @@ void CXFA_FM2JSContext::Put(FXJSE_HOBJECT hThis,
CFX_ByteString bsURL;
CFX_ByteString bsData;
CFX_ByteString bsEncode;
- FXJSE_HVALUE argThree = nullptr;
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
- HValueToUTF8String(argOne, bsURL);
- FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
- HValueToUTF8String(argTwo, bsData);
+ CFXJSE_Value* argThree = nullptr;
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
+ ValueToUTF8String(argOne, bsURL);
+ CFXJSE_Value* argTwo = GetSimpleValue(pThis, args, 1);
+ ValueToUTF8String(argTwo, bsData);
if (argc > 2) {
- argThree = GetSimpleHValue(hThis, args, 2);
- HValueToUTF8String(argThree, bsEncode);
+ argThree = GetSimpleValue(pThis, args, 2);
+ ValueToUTF8String(argThree, bsEncode);
}
FX_BOOL bFlags = pAppProvider->PutRequestURL(
CFX_WideString::FromUTF8(bsURL.AsStringC()),
@@ -5574,23 +5574,23 @@ void CXFA_FM2JSContext::Put(FXJSE_HOBJECT hThis,
L"Put");
}
}
-void CXFA_FM2JSContext::assign_value_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::assign_value_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
if (args.GetLength() == 2) {
- FXJSE_HVALUE lValue = args.GetValue(0);
- FXJSE_HVALUE rValue = GetSimpleHValue(hThis, args, 1);
+ CFXJSE_Value* lValue = args.GetValue(0);
+ CFXJSE_Value* rValue = GetSimpleValue(pThis, args, 1);
FX_BOOL bSetStatus = TRUE;
if (FXJSE_Value_IsArray(lValue)) {
- FXJSE_HVALUE leftLengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* leftLengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(lValue, "length", leftLengthValue);
int32_t iLeftLength = FXJSE_Value_ToInteger(leftLengthValue);
FXJSE_Value_Release(leftLengthValue);
- FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsObjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(lValue, 1, propertyValue);
if (FXJSE_Value_IsNull(propertyValue)) {
for (int32_t i = 2; i < iLeftLength; i++) {
@@ -5625,57 +5625,57 @@ void CXFA_FM2JSContext::assign_value_operator(FXJSE_HOBJECT hThis,
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::logical_or_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::logical_or_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 2) {
- FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1);
+ CFXJSE_Value* argFirst = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argSecond = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(argFirst) && FXJSE_Value_IsNull(argSecond)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- FX_FLOAT first = HValueToFloat(hThis, argFirst);
- FX_FLOAT second = HValueToFloat(hThis, argSecond);
+ FX_FLOAT first = ValueToFloat(pThis, argFirst);
+ FX_FLOAT second = ValueToFloat(pThis, argSecond);
FXJSE_Value_SetInteger(args.GetReturnValue(), (first || second) ? 1 : 0);
}
FXJSE_Value_Release(argFirst);
FXJSE_Value_Release(argSecond);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::logical_and_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::logical_and_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 2) {
- FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1);
+ CFXJSE_Value* argFirst = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argSecond = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(argFirst) && FXJSE_Value_IsNull(argSecond)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- FX_FLOAT first = HValueToFloat(hThis, argFirst);
- FX_FLOAT second = HValueToFloat(hThis, argSecond);
+ FX_FLOAT first = ValueToFloat(pThis, argFirst);
+ FX_FLOAT second = ValueToFloat(pThis, argSecond);
FXJSE_Value_SetInteger(args.GetReturnValue(), (first && second) ? 1 : 0);
}
FXJSE_Value_Release(argFirst);
FXJSE_Value_Release(argSecond);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::equality_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::equality_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 2) {
- if (fm_ref_equal(hThis, args)) {
+ if (fm_ref_equal(pThis, args)) {
FXJSE_Value_SetInteger(args.GetReturnValue(), 1);
} else {
- FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1);
+ CFXJSE_Value* argFirst = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argSecond = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(argFirst) || FXJSE_Value_IsNull(argSecond)) {
FXJSE_Value_SetInteger(
args.GetReturnValue(),
@@ -5691,8 +5691,8 @@ void CXFA_FM2JSContext::equality_operator(FXJSE_HOBJECT hThis,
FXJSE_Value_SetInteger(args.GetReturnValue(),
firstOutput == secondOutput);
} else {
- FX_DOUBLE first = HValueToDouble(hThis, argFirst);
- FX_DOUBLE second = HValueToDouble(hThis, argSecond);
+ FX_DOUBLE first = ValueToDouble(pThis, argFirst);
+ FX_DOUBLE second = ValueToDouble(pThis, argSecond);
FXJSE_Value_SetInteger(args.GetReturnValue(),
(first == second) ? 1 : 0);
}
@@ -5701,19 +5701,19 @@ void CXFA_FM2JSContext::equality_operator(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::notequality_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::notequality_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 2) {
- if (fm_ref_equal(hThis, args)) {
+ if (fm_ref_equal(pThis, args)) {
FXJSE_Value_SetInteger(args.GetReturnValue(), 0);
} else {
- FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1);
+ CFXJSE_Value* argFirst = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argSecond = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(argFirst) || FXJSE_Value_IsNull(argSecond)) {
FXJSE_Value_SetInteger(
args.GetReturnValue(),
@@ -5729,8 +5729,8 @@ void CXFA_FM2JSContext::notequality_operator(FXJSE_HOBJECT hThis,
FXJSE_Value_SetInteger(args.GetReturnValue(),
firstOutput != secondOutput);
} else {
- FX_DOUBLE first = HValueToDouble(hThis, argFirst);
- FX_DOUBLE second = HValueToDouble(hThis, argSecond);
+ FX_DOUBLE first = ValueToDouble(pThis, argFirst);
+ FX_DOUBLE second = ValueToDouble(pThis, argSecond);
FXJSE_Value_SetInteger(args.GetReturnValue(), first != second);
}
FXJSE_Value_Release(argFirst);
@@ -5738,27 +5738,27 @@ void CXFA_FM2JSContext::notequality_operator(FXJSE_HOBJECT hThis,
}
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-FX_BOOL CXFA_FM2JSContext::fm_ref_equal(FXJSE_HOBJECT hThis,
+FX_BOOL CXFA_FM2JSContext::fm_ref_equal(CFXJSE_Value* pThis,
CFXJSE_Arguments& args) {
FX_BOOL bRet = FALSE;
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
- FXJSE_HVALUE argFirst = args.GetValue(0);
- FXJSE_HVALUE argSecond = args.GetValue(0);
+ CFXJSE_Value* argFirst = args.GetValue(0);
+ CFXJSE_Value* argSecond = args.GetValue(0);
if (FXJSE_Value_IsArray(argFirst) && FXJSE_Value_IsArray(argSecond)) {
- FXJSE_HVALUE firstFlagValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE secondFlagValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* firstFlagValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* secondFlagValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argFirst, 0, firstFlagValue);
FXJSE_Value_GetObjectPropByIdx(argSecond, 0, secondFlagValue);
if ((FXJSE_Value_ToInteger(firstFlagValue) == 3) &&
(FXJSE_Value_ToInteger(secondFlagValue) == 3)) {
- FXJSE_HVALUE firstJSObject = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE secondJSObject = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* firstJSObject = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* secondJSObject = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argFirst, 2, firstJSObject);
FXJSE_Value_GetObjectPropByIdx(argSecond, 2, secondJSObject);
if (!FXJSE_Value_IsNull(firstJSObject) &&
@@ -5776,12 +5776,12 @@ FX_BOOL CXFA_FM2JSContext::fm_ref_equal(FXJSE_HOBJECT hThis,
FXJSE_Value_Release(argSecond);
return bRet;
}
-void CXFA_FM2JSContext::less_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::less_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 2) {
- FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1);
+ CFXJSE_Value* argFirst = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argSecond = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(argFirst) || FXJSE_Value_IsNull(argSecond)) {
FXJSE_Value_SetInteger(args.GetReturnValue(), 0);
} else if (FXJSE_Value_IsUTF8String(argFirst) &&
@@ -5794,24 +5794,24 @@ void CXFA_FM2JSContext::less_operator(FXJSE_HOBJECT hThis,
args.GetReturnValue(),
firstOutput.Compare(secondOutput.AsStringC()) == -1);
} else {
- FX_DOUBLE first = HValueToDouble(hThis, argFirst);
- FX_DOUBLE second = HValueToDouble(hThis, argSecond);
+ FX_DOUBLE first = ValueToDouble(pThis, argFirst);
+ FX_DOUBLE second = ValueToDouble(pThis, argSecond);
FXJSE_Value_SetInteger(args.GetReturnValue(), (first < second) ? 1 : 0);
}
FXJSE_Value_Release(argFirst);
FXJSE_Value_Release(argSecond);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::lessequal_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::lessequal_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 2) {
- FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1);
+ CFXJSE_Value* argFirst = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argSecond = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(argFirst) || FXJSE_Value_IsNull(argSecond)) {
FXJSE_Value_SetInteger(
args.GetReturnValue(),
@@ -5827,24 +5827,24 @@ void CXFA_FM2JSContext::lessequal_operator(FXJSE_HOBJECT hThis,
args.GetReturnValue(),
firstOutput.Compare(secondOutput.AsStringC()) != 1);
} else {
- FX_DOUBLE first = HValueToDouble(hThis, argFirst);
- FX_DOUBLE second = HValueToDouble(hThis, argSecond);
+ FX_DOUBLE first = ValueToDouble(pThis, argFirst);
+ FX_DOUBLE second = ValueToDouble(pThis, argSecond);
FXJSE_Value_SetInteger(args.GetReturnValue(), (first <= second) ? 1 : 0);
}
FXJSE_Value_Release(argFirst);
FXJSE_Value_Release(argSecond);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::greater_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::greater_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 2) {
- FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1);
+ CFXJSE_Value* argFirst = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argSecond = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(argFirst) || FXJSE_Value_IsNull(argSecond)) {
FXJSE_Value_SetInteger(args.GetReturnValue(), 0);
} else if (FXJSE_Value_IsUTF8String(argFirst) &&
@@ -5857,24 +5857,24 @@ void CXFA_FM2JSContext::greater_operator(FXJSE_HOBJECT hThis,
args.GetReturnValue(),
firstOutput.Compare(secondOutput.AsStringC()) == 1);
} else {
- FX_DOUBLE first = HValueToDouble(hThis, argFirst);
- FX_DOUBLE second = HValueToDouble(hThis, argSecond);
+ FX_DOUBLE first = ValueToDouble(pThis, argFirst);
+ FX_DOUBLE second = ValueToDouble(pThis, argSecond);
FXJSE_Value_SetInteger(args.GetReturnValue(), (first > second) ? 1 : 0);
}
FXJSE_Value_Release(argFirst);
FXJSE_Value_Release(argSecond);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::greaterequal_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::greaterequal_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 2) {
- FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1);
+ CFXJSE_Value* argFirst = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argSecond = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(argFirst) || FXJSE_Value_IsNull(argSecond)) {
FXJSE_Value_SetInteger(
args.GetReturnValue(),
@@ -5890,94 +5890,94 @@ void CXFA_FM2JSContext::greaterequal_operator(FXJSE_HOBJECT hThis,
args.GetReturnValue(),
firstOutput.Compare(secondOutput.AsStringC()) != -1);
} else {
- FX_DOUBLE first = HValueToDouble(hThis, argFirst);
- FX_DOUBLE second = HValueToDouble(hThis, argSecond);
+ FX_DOUBLE first = ValueToDouble(pThis, argFirst);
+ FX_DOUBLE second = ValueToDouble(pThis, argSecond);
FXJSE_Value_SetInteger(args.GetReturnValue(), (first >= second) ? 1 : 0);
}
FXJSE_Value_Release(argFirst);
FXJSE_Value_Release(argSecond);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::plus_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::plus_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 2) {
- FXJSE_HVALUE argFirst = args.GetValue(0);
- FXJSE_HVALUE argSecond = args.GetValue(1);
- if (HValueIsNull(hThis, argFirst) && HValueIsNull(hThis, argSecond)) {
+ CFXJSE_Value* argFirst = args.GetValue(0);
+ CFXJSE_Value* argSecond = args.GetValue(1);
+ if (ValueIsNull(pThis, argFirst) && ValueIsNull(pThis, argSecond)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- FX_DOUBLE first = HValueToDouble(hThis, argFirst);
- FX_DOUBLE second = HValueToDouble(hThis, argSecond);
+ FX_DOUBLE first = ValueToDouble(pThis, argFirst);
+ FX_DOUBLE second = ValueToDouble(pThis, argSecond);
FXJSE_Value_SetDouble(args.GetReturnValue(), first + second);
}
FXJSE_Value_Release(argFirst);
FXJSE_Value_Release(argSecond);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::minus_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::minus_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 2) {
- FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1);
+ CFXJSE_Value* argFirst = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argSecond = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(argFirst) && FXJSE_Value_IsNull(argSecond)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- FX_DOUBLE first = HValueToDouble(hThis, argFirst);
- FX_DOUBLE second = HValueToDouble(hThis, argSecond);
+ FX_DOUBLE first = ValueToDouble(pThis, argFirst);
+ FX_DOUBLE second = ValueToDouble(pThis, argSecond);
FXJSE_Value_SetDouble(args.GetReturnValue(), first - second);
}
FXJSE_Value_Release(argFirst);
FXJSE_Value_Release(argSecond);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::multiple_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::multiple_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() == 2) {
- FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1);
+ CFXJSE_Value* argFirst = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argSecond = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(argFirst) && FXJSE_Value_IsNull(argSecond)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- FX_DOUBLE first = HValueToDouble(hThis, argFirst);
- FX_DOUBLE second = HValueToDouble(hThis, argSecond);
+ FX_DOUBLE first = ValueToDouble(pThis, argFirst);
+ FX_DOUBLE second = ValueToDouble(pThis, argSecond);
FXJSE_Value_SetDouble(args.GetReturnValue(), first * second);
}
FXJSE_Value_Release(argFirst);
FXJSE_Value_Release(argSecond);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::divide_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::divide_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
if (args.GetLength() == 2) {
- FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0);
- FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1);
+ CFXJSE_Value* argFirst = GetSimpleValue(pThis, args, 0);
+ CFXJSE_Value* argSecond = GetSimpleValue(pThis, args, 1);
if (FXJSE_Value_IsNull(argFirst) && FXJSE_Value_IsNull(argSecond)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- FX_DOUBLE first = HValueToDouble(hThis, argFirst);
- FX_DOUBLE second = HValueToDouble(hThis, argSecond);
+ FX_DOUBLE first = ValueToDouble(pThis, argFirst);
+ FX_DOUBLE second = ValueToDouble(pThis, argSecond);
if (second == 0.0) {
pContext->ThrowScriptErrorMessage(XFA_IDS_DIVIDE_ZERO);
} else {
@@ -5990,113 +5990,113 @@ void CXFA_FM2JSContext::divide_operator(FXJSE_HOBJECT hThis,
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::positive_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::positive_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t iLength = args.GetLength();
if (iLength == 1) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
if (FXJSE_Value_IsNull(argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
FXJSE_Value_SetDouble(args.GetReturnValue(),
- 0.0 + HValueToDouble(hThis, argOne));
+ 0.0 + ValueToDouble(pThis, argOne));
}
FXJSE_Value_Release(argOne);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::negative_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::negative_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t iLength = args.GetLength();
if (iLength == 1) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
if (FXJSE_Value_IsNull(argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
FXJSE_Value_SetDouble(args.GetReturnValue(),
- 0.0 - HValueToDouble(hThis, argOne));
+ 0.0 - ValueToDouble(pThis, argOne));
}
FXJSE_Value_Release(argOne);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::logical_not_operator(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::logical_not_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t iLength = args.GetLength();
if (iLength == 1) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
if (FXJSE_Value_IsNull(argOne)) {
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
- FX_DOUBLE first = HValueToDouble(hThis, argOne);
+ FX_DOUBLE first = ValueToDouble(pThis, argOne);
FXJSE_Value_SetInteger(args.GetReturnValue(), (first == 0.0) ? 1 : 0);
}
FXJSE_Value_Release(argOne);
} else {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::dot_accessor(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
int32_t argc = args.GetLength();
if ((argc == 4) || (argc == 5)) {
FX_BOOL bIsStar = TRUE;
- FXJSE_HVALUE argAccessor = args.GetValue(0);
+ CFXJSE_Value* argAccessor = args.GetValue(0);
CFX_ByteString bsAccessorName = args.GetUTF8String(1);
CFX_ByteString szName = args.GetUTF8String(2);
int32_t iIndexFlags = args.GetInt32(3);
int32_t iIndexValue = 0;
- FXJSE_HVALUE argIndex = NULL;
+ CFXJSE_Value* argIndex = NULL;
if (argc == 5) {
bIsStar = FALSE;
argIndex = args.GetValue(4);
- iIndexValue = HValueToInteger(hThis, argIndex);
+ iIndexValue = ValueToInteger(pThis, argIndex);
}
CFX_ByteString szSomExp;
GenerateSomExpression(szName.AsStringC(), iIndexFlags, iIndexValue, bIsStar,
szSomExp);
if (FXJSE_Value_IsArray(argAccessor)) {
- FXJSE_HVALUE hLengthValue = FXJSE_Value_Create(pIsolate);
- FXJSE_Value_GetObjectProp(argAccessor, "length", hLengthValue);
- int32_t iLength = FXJSE_Value_ToInteger(hLengthValue);
- FXJSE_Value_Release(hLengthValue);
+ CFXJSE_Value* pLengthValue = FXJSE_Value_Create(pIsolate);
+ FXJSE_Value_GetObjectProp(argAccessor, "length", pLengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(pLengthValue);
+ FXJSE_Value_Release(pLengthValue);
int32_t iCounter = 0;
- FXJSE_HVALUE** hResolveValues = FX_Alloc(FXJSE_HVALUE*, iLength - 2);
+ CFXJSE_Value*** hResolveValues = FX_Alloc(CFXJSE_Value**, iLength - 2);
int32_t* iSizes = FX_Alloc(int32_t, iLength - 2);
for (int32_t i = 0; i < (iLength - 2); i++) {
iSizes[i] = 0;
}
- FXJSE_HVALUE hJSObjValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* hJSObjValue = FXJSE_Value_Create(pIsolate);
FX_BOOL bAttribute = FALSE;
for (int32_t i = 2; i < iLength; i++) {
FXJSE_Value_GetObjectPropByIdx(argAccessor, i, hJSObjValue);
XFA_RESOLVENODE_RS resoveNodeRS;
- int32_t iRet = ResolveObjects(hThis, hJSObjValue, szSomExp.AsStringC(),
+ int32_t iRet = ResolveObjects(pThis, hJSObjValue, szSomExp.AsStringC(),
resoveNodeRS, TRUE, szName.IsEmpty());
if (iRet > 0) {
- ParseResolveResult(hThis, resoveNodeRS, hJSObjValue,
+ ParseResolveResult(pThis, resoveNodeRS, hJSObjValue,
hResolveValues[i - 2], iSizes[i - 2], bAttribute);
iCounter += iSizes[i - 2];
}
}
FXJSE_Value_Release(hJSObjValue);
if (iCounter > 0) {
- FXJSE_HVALUE* rgValues = FX_Alloc(FXJSE_HVALUE, iCounter + 2);
+ CFXJSE_Value** rgValues = FX_Alloc(CFXJSE_Value*, iCounter + 2);
for (int32_t i = 0; i < (iCounter + 2); i++) {
rgValues[i] = FXJSE_Value_Create(pIsolate);
}
@@ -6142,24 +6142,24 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis,
int32_t iRet = 0;
if (FXJSE_Value_IsObject(argAccessor) ||
(FXJSE_Value_IsNull(argAccessor) && bsAccessorName.IsEmpty())) {
- iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsStringC(),
+ iRet = ResolveObjects(pThis, argAccessor, szSomExp.AsStringC(),
resoveNodeRS, TRUE, szName.IsEmpty());
} else if (!FXJSE_Value_IsObject(argAccessor) &&
!bsAccessorName.IsEmpty()) {
FX_BOOL bGetObject =
- GetObjectByName(hThis, argAccessor, bsAccessorName.AsStringC());
+ GetObjectByName(pThis, argAccessor, bsAccessorName.AsStringC());
if (bGetObject) {
- iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsStringC(),
+ iRet = ResolveObjects(pThis, argAccessor, szSomExp.AsStringC(),
resoveNodeRS, TRUE, szName.IsEmpty());
}
}
if (iRet > 0) {
- FXJSE_HVALUE* hResolveValues;
+ CFXJSE_Value** hResolveValues;
int32_t iSize = 0;
FX_BOOL bAttribute = FALSE;
- ParseResolveResult(hThis, resoveNodeRS, argAccessor, hResolveValues,
+ ParseResolveResult(pThis, resoveNodeRS, argAccessor, hResolveValues,
iSize, bAttribute);
- FXJSE_HVALUE* rgValues = FX_Alloc(FXJSE_HVALUE, iSize + 2);
+ CFXJSE_Value** rgValues = FX_Alloc(CFXJSE_Value*, iSize + 2);
for (int32_t i = 0; i < (iSize + 2); i++) {
rgValues[i] = FXJSE_Value_Create(pIsolate);
}
@@ -6199,52 +6199,52 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis,
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::dotdot_accessor(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
int32_t argc = args.GetLength();
if ((argc == 4) || (argc == 5)) {
FX_BOOL bIsStar = TRUE;
- FXJSE_HVALUE argAccessor = args.GetValue(0);
+ CFXJSE_Value* argAccessor = args.GetValue(0);
CFX_ByteString bsAccessorName = args.GetUTF8String(1);
CFX_ByteString szName = args.GetUTF8String(2);
int32_t iIndexFlags = args.GetInt32(3);
int32_t iIndexValue = 0;
- FXJSE_HVALUE argIndex = NULL;
+ CFXJSE_Value* argIndex = NULL;
if (argc == 5) {
bIsStar = FALSE;
argIndex = args.GetValue(4);
- iIndexValue = HValueToInteger(hThis, argIndex);
+ iIndexValue = ValueToInteger(pThis, argIndex);
}
CFX_ByteString szSomExp;
GenerateSomExpression(szName.AsStringC(), iIndexFlags, iIndexValue, bIsStar,
szSomExp);
if (FXJSE_Value_IsArray(argAccessor)) {
- FXJSE_HVALUE hLengthValue = FXJSE_Value_Create(pIsolate);
- FXJSE_Value_GetObjectProp(argAccessor, "length", hLengthValue);
- int32_t iLength = FXJSE_Value_ToInteger(hLengthValue);
+ CFXJSE_Value* pLengthValue = FXJSE_Value_Create(pIsolate);
+ FXJSE_Value_GetObjectProp(argAccessor, "length", pLengthValue);
+ int32_t iLength = FXJSE_Value_ToInteger(pLengthValue);
int32_t iCounter = 0;
- FXJSE_HVALUE** hResolveValues = FX_Alloc(FXJSE_HVALUE*, iLength - 2);
+ CFXJSE_Value*** hResolveValues = FX_Alloc(CFXJSE_Value**, iLength - 2);
int32_t* iSizes = FX_Alloc(int32_t, iLength - 2);
- FXJSE_HVALUE hJSObjValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* hJSObjValue = FXJSE_Value_Create(pIsolate);
FX_BOOL bAttribute = FALSE;
for (int32_t i = 2; i < iLength; i++) {
FXJSE_Value_GetObjectPropByIdx(argAccessor, i, hJSObjValue);
XFA_RESOLVENODE_RS resoveNodeRS;
- int32_t iRet = ResolveObjects(hThis, hJSObjValue, szSomExp.AsStringC(),
+ int32_t iRet = ResolveObjects(pThis, hJSObjValue, szSomExp.AsStringC(),
resoveNodeRS, FALSE);
if (iRet > 0) {
- ParseResolveResult(hThis, resoveNodeRS, hJSObjValue,
+ ParseResolveResult(pThis, resoveNodeRS, hJSObjValue,
hResolveValues[i - 2], iSizes[i - 2], bAttribute);
iCounter += iSizes[i - 2];
}
}
FXJSE_Value_Release(hJSObjValue);
if (iCounter > 0) {
- FXJSE_HVALUE* rgValues = FX_Alloc(FXJSE_HVALUE, iCounter + 2);
+ CFXJSE_Value** rgValues = FX_Alloc(CFXJSE_Value*, iCounter + 2);
for (int32_t i = 0; i < (iCounter + 2); i++) {
rgValues[i] = FXJSE_Value_Create(pIsolate);
}
@@ -6283,30 +6283,30 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis,
}
FX_Free(hResolveValues);
FX_Free(iSizes);
- FXJSE_Value_Release(hLengthValue);
+ FXJSE_Value_Release(pLengthValue);
} else {
XFA_RESOLVENODE_RS resoveNodeRS;
int32_t iRet = 0;
if (FXJSE_Value_IsObject(argAccessor) ||
(FXJSE_Value_IsNull(argAccessor) && bsAccessorName.IsEmpty())) {
- iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsStringC(),
+ iRet = ResolveObjects(pThis, argAccessor, szSomExp.AsStringC(),
resoveNodeRS, FALSE);
} else if (!FXJSE_Value_IsObject(argAccessor) &&
!bsAccessorName.IsEmpty()) {
FX_BOOL bGetObject =
- GetObjectByName(hThis, argAccessor, bsAccessorName.AsStringC());
+ GetObjectByName(pThis, argAccessor, bsAccessorName.AsStringC());
if (bGetObject) {
- iRet = ResolveObjects(hThis, argAccessor, szSomExp.AsStringC(),
+ iRet = ResolveObjects(pThis, argAccessor, szSomExp.AsStringC(),
resoveNodeRS, FALSE);
}
}
if (iRet > 0) {
- FXJSE_HVALUE* hResolveValues;
+ CFXJSE_Value** hResolveValues;
int32_t iSize = 0;
FX_BOOL bAttribute = FALSE;
- ParseResolveResult(hThis, resoveNodeRS, argAccessor, hResolveValues,
+ ParseResolveResult(pThis, resoveNodeRS, argAccessor, hResolveValues,
iSize, bAttribute);
- FXJSE_HVALUE* rgValues = FX_Alloc(FXJSE_HVALUE, iSize + 2);
+ CFXJSE_Value** rgValues = FX_Alloc(CFXJSE_Value*, iSize + 2);
for (int32_t i = 0; i < (iSize + 2); i++) {
rgValues[i] = FXJSE_Value_Create(pIsolate);
}
@@ -6346,16 +6346,16 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis,
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::eval_translation(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::eval_translation(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
int32_t argc = args.GetLength();
if (argc == 1) {
- FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
+ CFXJSE_Value* argOne = GetSimpleValue(pThis, args, 0);
CFX_ByteString argString;
- HValueToUTF8String(argOne, argString);
+ ValueToUTF8String(argOne, argString);
if (argString.IsEmpty()) {
pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
} else {
@@ -6380,24 +6380,24 @@ void CXFA_FM2JSContext::eval_translation(FXJSE_HOBJECT hThis,
L"Eval");
}
}
-void CXFA_FM2JSContext::is_fm_object(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::is_fm_object(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t iLength = args.GetLength();
if (iLength == 1) {
- FXJSE_HVALUE argOne = args.GetValue(0);
+ CFXJSE_Value* argOne = args.GetValue(0);
FXJSE_Value_SetBoolean(args.GetReturnValue(), FXJSE_Value_IsObject(argOne));
FXJSE_Value_Release(argOne);
} else {
FXJSE_Value_SetBoolean(args.GetReturnValue(), FALSE);
}
}
-void CXFA_FM2JSContext::is_fm_array(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::is_fm_array(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
int32_t iLength = args.GetLength();
if (iLength == 1) {
- FXJSE_HVALUE argOne = args.GetValue(0);
+ CFXJSE_Value* argOne = args.GetValue(0);
FX_BOOL bIsArray = FXJSE_Value_IsArray(argOne);
FXJSE_Value_SetBoolean(args.GetReturnValue(), bIsArray);
FXJSE_Value_Release(argOne);
@@ -6405,18 +6405,18 @@ void CXFA_FM2JSContext::is_fm_array(FXJSE_HOBJECT hThis,
FXJSE_Value_SetBoolean(args.GetReturnValue(), FALSE);
}
}
-void CXFA_FM2JSContext::get_fm_value(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::get_fm_value(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
int32_t iLength = args.GetLength();
if (iLength == 1) {
- FXJSE_HVALUE argOne = args.GetValue(0);
+ CFXJSE_Value* argOne = args.GetValue(0);
if (FXJSE_Value_IsArray(argOne)) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsobjectValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argOne, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(argOne, 2, jsobjectValue);
if (FXJSE_Value_IsNull(propertyValue)) {
@@ -6439,18 +6439,18 @@ void CXFA_FM2JSContext::get_fm_value(FXJSE_HOBJECT hThis,
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::get_fm_jsobj(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::get_fm_jsobj(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- static_cast<CXFA_FM2JSContext*>(FXJSE_Value_ToObject(hThis, nullptr));
+ static_cast<CXFA_FM2JSContext*>(FXJSE_Value_ToObject(pThis, nullptr));
int32_t argc = args.GetLength();
if (argc == 1) {
- FXJSE_HVALUE argOne = args.GetValue(0);
+ CFXJSE_Value* argOne = args.GetValue(0);
if (FXJSE_Value_IsArray(argOne)) {
#ifndef NDEBUG
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argOne, "length", lengthValue);
ASSERT(FXJSE_Value_ToInteger(lengthValue) >= 3);
FXJSE_Value_Release(lengthValue);
@@ -6464,28 +6464,28 @@ void CXFA_FM2JSContext::get_fm_jsobj(FXJSE_HOBJECT hThis,
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::fm_var_filter(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::fm_var_filter(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
int32_t argc = args.GetLength();
if (argc == 1) {
- FXJSE_HVALUE argOne = args.GetValue(0);
+ CFXJSE_Value* argOne = args.GetValue(0);
if (FXJSE_Value_IsArray(argOne)) {
#ifndef NDEBUG
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argOne, "length", lengthValue);
ASSERT(FXJSE_Value_ToInteger(lengthValue) >= 3);
FXJSE_Value_Release(lengthValue);
#endif
- FXJSE_HVALUE flagsValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* flagsValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argOne, 0, flagsValue);
int32_t iFlags = FXJSE_Value_ToInteger(flagsValue);
FXJSE_Value_Release(flagsValue);
if (iFlags == 4) {
- FXJSE_HVALUE rgValues[3];
+ CFXJSE_Value* rgValues[3];
for (int32_t i = 0; i < 3; i++) {
rgValues[i] = FXJSE_Value_Create(pIsolate);
}
@@ -6497,7 +6497,7 @@ void CXFA_FM2JSContext::fm_var_filter(FXJSE_HOBJECT hThis,
FXJSE_Value_Release(rgValues[i]);
}
} else if (iFlags == 3) {
- FXJSE_HVALUE objectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* objectValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argOne, 2, objectValue);
if (!FXJSE_Value_IsNull(objectValue)) {
FXJSE_Value_Set(args.GetReturnValue(), argOne);
@@ -6506,12 +6506,12 @@ void CXFA_FM2JSContext::fm_var_filter(FXJSE_HOBJECT hThis,
}
FXJSE_Value_Release(objectValue);
} else {
- FXJSE_HVALUE simpleValue = GetSimpleHValue(hThis, args, 0);
+ CFXJSE_Value* simpleValue = GetSimpleValue(pThis, args, 0);
FXJSE_Value_Set(args.GetReturnValue(), simpleValue);
FXJSE_Value_Release(simpleValue);
}
} else {
- FXJSE_HVALUE simpleValue = GetSimpleHValue(hThis, args, 0);
+ CFXJSE_Value* simpleValue = GetSimpleValue(pThis, args, 0);
FXJSE_Value_Set(args.GetReturnValue(), simpleValue);
FXJSE_Value_Release(simpleValue);
}
@@ -6520,19 +6520,19 @@ void CXFA_FM2JSContext::fm_var_filter(FXJSE_HOBJECT hThis,
pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
}
}
-void CXFA_FM2JSContext::concat_fm_object(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::concat_fm_object(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
uint32_t iLength = 0;
int32_t argCount = args.GetLength();
- FXJSE_HVALUE* argValues = FX_Alloc(FXJSE_HVALUE, argCount);
+ CFXJSE_Value** argValues = FX_Alloc(CFXJSE_Value*, argCount);
for (int32_t i = 0; i < argCount; i++) {
argValues[i] = args.GetValue(i);
if (FXJSE_Value_IsArray(argValues[i])) {
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argValues[i], "length", lengthValue);
int32_t length = FXJSE_Value_ToInteger(lengthValue);
iLength = iLength + ((length > 2) ? (length - 2) : 0);
@@ -6540,14 +6540,14 @@ void CXFA_FM2JSContext::concat_fm_object(FXJSE_HOBJECT hThis,
}
iLength += 1;
}
- FXJSE_HVALUE* returnValues = FX_Alloc(FXJSE_HVALUE, iLength);
+ CFXJSE_Value** returnValues = FX_Alloc(CFXJSE_Value*, iLength);
for (int32_t i = 0; i < (int32_t)iLength; i++) {
returnValues[i] = FXJSE_Value_Create(pIsolate);
}
int32_t index = 0;
for (int32_t i = 0; i < argCount; i++) {
if (FXJSE_Value_IsArray(argValues[i])) {
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argValues[i], "length", lengthValue);
int32_t length = FXJSE_Value_ToInteger(lengthValue);
for (int32_t j = 2; j < length; j++) {
@@ -6569,23 +6569,23 @@ void CXFA_FM2JSContext::concat_fm_object(FXJSE_HOBJECT hThis,
}
FX_Free(returnValues);
}
-FXJSE_HVALUE CXFA_FM2JSContext::GetSimpleHValue(FXJSE_HOBJECT hThis,
+CFXJSE_Value* CXFA_FM2JSContext::GetSimpleValue(CFXJSE_Value* pThis,
CFXJSE_Arguments& args,
uint32_t index) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
ASSERT(index < (uint32_t)args.GetLength());
- FXJSE_HVALUE argIndex = args.GetValue(index);
+ CFXJSE_Value* argIndex = args.GetValue(index);
if (FXJSE_Value_IsArray(argIndex)) {
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argIndex, "length", lengthValue);
int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
- FXJSE_HVALUE simpleValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* simpleValue = FXJSE_Value_Create(pIsolate);
if (iLength > 2) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsobjectValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argIndex, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(argIndex, 2, jsobjectValue);
if (FXJSE_Value_IsNull(propertyValue)) {
@@ -6604,7 +6604,7 @@ FXJSE_HVALUE CXFA_FM2JSContext::GetSimpleHValue(FXJSE_HOBJECT hThis,
FXJSE_Value_Release(argIndex);
return simpleValue;
} else if (FXJSE_Value_IsObject(argIndex)) {
- FXJSE_HVALUE defaultValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* defaultValue = FXJSE_Value_Create(pIsolate);
GetObjectDefaultValue(argIndex, defaultValue);
FXJSE_Value_Release(argIndex);
return defaultValue;
@@ -6612,22 +6612,23 @@ FXJSE_HVALUE CXFA_FM2JSContext::GetSimpleHValue(FXJSE_HOBJECT hThis,
return argIndex;
}
}
-FX_BOOL CXFA_FM2JSContext::HValueIsNull(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg) {
+
+FX_BOOL CXFA_FM2JSContext::ValueIsNull(CFXJSE_Value* pThis, CFXJSE_Value* arg) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
FX_BOOL isNull = FALSE;
if (FXJSE_Value_IsNull(arg)) {
isNull = TRUE;
} else if (FXJSE_Value_IsArray(arg)) {
- int32_t iLength = hvalue_get_array_length(hThis, arg);
+ int32_t iLength = hvalue_get_array_length(pThis, arg);
if (iLength > 2) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsObjectValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(arg, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(arg, 2, jsObjectValue);
if (FXJSE_Value_IsNull(propertyValue)) {
- FXJSE_HVALUE defaultValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* defaultValue = FXJSE_Value_Create(pIsolate);
GetObjectDefaultValue(jsObjectValue, defaultValue);
if (FXJSE_Value_IsNull(defaultValue)) {
isNull = TRUE;
@@ -6636,7 +6637,7 @@ FX_BOOL CXFA_FM2JSContext::HValueIsNull(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg) {
} else {
CFX_ByteString propertyStr;
FXJSE_Value_ToUTF8String(propertyValue, propertyStr);
- FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newPropertyValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr.AsStringC(),
newPropertyValue);
if (FXJSE_Value_IsNull(newPropertyValue)) {
@@ -6650,7 +6651,7 @@ FX_BOOL CXFA_FM2JSContext::HValueIsNull(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg) {
isNull = TRUE;
}
} else if (FXJSE_Value_IsObject(arg)) {
- FXJSE_HVALUE defaultValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* defaultValue = FXJSE_Value_Create(pIsolate);
GetObjectDefaultValue(arg, defaultValue);
if (FXJSE_Value_IsNull(defaultValue)) {
isNull = TRUE;
@@ -6659,32 +6660,33 @@ FX_BOOL CXFA_FM2JSContext::HValueIsNull(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg) {
}
return isNull;
}
-int32_t CXFA_FM2JSContext::hvalue_get_array_length(FXJSE_HOBJECT hThis,
- FXJSE_HVALUE arg) {
+
+int32_t CXFA_FM2JSContext::hvalue_get_array_length(CFXJSE_Value* pThis,
+ CFXJSE_Value* arg) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
int32_t iLength = 0;
if (FXJSE_Value_IsArray(arg)) {
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(arg, "length", lengthValue);
iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
}
return iLength;
}
-FX_BOOL CXFA_FM2JSContext::simpleValueCompare(FXJSE_HOBJECT hThis,
- FXJSE_HVALUE firstValue,
- FXJSE_HVALUE secondValue) {
+FX_BOOL CXFA_FM2JSContext::simpleValueCompare(CFXJSE_Value* pThis,
+ CFXJSE_Value* firstValue,
+ CFXJSE_Value* secondValue) {
FX_BOOL bReturn = FALSE;
if (FXJSE_Value_IsUTF8String(firstValue)) {
CFX_ByteString firstString, secondString;
- HValueToUTF8String(firstValue, firstString);
- HValueToUTF8String(secondValue, secondString);
+ ValueToUTF8String(firstValue, firstString);
+ ValueToUTF8String(secondValue, secondString);
bReturn = firstString == secondString;
} else if (FXJSE_Value_IsNumber(firstValue)) {
- FX_FLOAT first = HValueToFloat(hThis, firstValue);
- FX_FLOAT second = HValueToFloat(hThis, secondValue);
+ FX_FLOAT first = ValueToFloat(pThis, firstValue);
+ FX_FLOAT second = ValueToFloat(pThis, secondValue);
bReturn = (first == second);
} else if (FXJSE_Value_IsBoolean(firstValue)) {
bReturn = (FXJSE_Value_ToBoolean(firstValue) ==
@@ -6695,21 +6697,21 @@ FX_BOOL CXFA_FM2JSContext::simpleValueCompare(FXJSE_HOBJECT hThis,
}
return bReturn;
}
-void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis,
+void CXFA_FM2JSContext::unfoldArgs(CFXJSE_Value* pThis,
CFXJSE_Arguments& args,
- FXJSE_HVALUE*& resultValues,
+ CFXJSE_Value**& resultValues,
int32_t& iCount,
int32_t iStart) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
iCount = 0;
int32_t argc = args.GetLength();
- FXJSE_HVALUE* argsValue = FX_Alloc(FXJSE_HVALUE, argc);
+ CFXJSE_Value** argsValue = FX_Alloc(CFXJSE_Value*, argc);
for (int32_t i = iStart; i < argc; i++) {
argsValue[i] = args.GetValue(i);
if (FXJSE_Value_IsArray(argsValue[i])) {
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argsValue[i], "length", lengthValue);
int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
@@ -6718,20 +6720,20 @@ void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis,
iCount += 1;
}
}
- resultValues = FX_Alloc(FXJSE_HVALUE, iCount);
+ resultValues = FX_Alloc(CFXJSE_Value*, iCount);
for (int32_t i = 0; i < iCount; i++) {
resultValues[i] = FXJSE_Value_Create(pIsolate);
}
int32_t index = 0;
for (int32_t i = iStart; i < argc; i++) {
if (FXJSE_Value_IsArray(argsValue[i])) {
- FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* lengthValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectProp(argsValue[i], "length", lengthValue);
int32_t iLength = FXJSE_Value_ToInteger(lengthValue);
FXJSE_Value_Release(lengthValue);
if (iLength > 2) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsObjectValue = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(argsValue[i], 1, propertyValue);
if (FXJSE_Value_IsNull(propertyValue)) {
for (int32_t j = 2; j < iLength; j++) {
@@ -6765,20 +6767,20 @@ void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis,
}
FX_Free(argsValue);
}
-void CXFA_FM2JSContext::GetObjectDefaultValue(FXJSE_HVALUE hObjectValue,
- FXJSE_HVALUE hDefaultValue) {
+void CXFA_FM2JSContext::GetObjectDefaultValue(CFXJSE_Value* pObjectValue,
+ CFXJSE_Value* pDefaultValue) {
CXFA_Node* pNode =
- ToNode((CXFA_Object*)FXJSE_Value_ToObject(hObjectValue, NULL));
+ ToNode((CXFA_Object*)FXJSE_Value_ToObject(pObjectValue, nullptr));
if (pNode) {
- pNode->Script_Som_DefaultValue(hDefaultValue, FALSE, (XFA_ATTRIBUTE)-1);
+ pNode->Script_Som_DefaultValue(pDefaultValue, FALSE, (XFA_ATTRIBUTE)-1);
} else {
- FXJSE_Value_SetNull(hDefaultValue);
+ FXJSE_Value_SetNull(pDefaultValue);
}
}
-FX_BOOL CXFA_FM2JSContext::SetObjectDefaultValue(FXJSE_HVALUE hObjectValue,
- FXJSE_HVALUE hNewValue) {
+FX_BOOL CXFA_FM2JSContext::SetObjectDefaultValue(CFXJSE_Value* pObjectValue,
+ CFXJSE_Value* hNewValue) {
CXFA_Node* pNode =
- ToNode((CXFA_Object*)FXJSE_Value_ToObject(hObjectValue, NULL));
+ ToNode((CXFA_Object*)FXJSE_Value_ToObject(pObjectValue, nullptr));
if (pNode) {
pNode->Script_Som_DefaultValue(hNewValue, TRUE, (XFA_ATTRIBUTE)-1);
return TRUE;
@@ -6815,12 +6817,12 @@ void CXFA_FM2JSContext::GenerateSomExpression(const CFX_ByteStringC& szName,
}
}
FX_BOOL CXFA_FM2JSContext::GetObjectByName(
- FXJSE_HOBJECT hThis,
- FXJSE_HVALUE accessorValue,
+ CFXJSE_Value* pThis,
+ CFXJSE_Value* accessorValue,
const CFX_ByteStringC& szAccessorName) {
FX_BOOL bFlags = FALSE;
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
CXFA_Document* pDoc = pContext->GetDocument();
if (!pDoc) {
return bFlags;
@@ -6840,8 +6842,8 @@ FX_BOOL CXFA_FM2JSContext::GetObjectByName(
}
return bFlags;
}
-int32_t CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis,
- FXJSE_HVALUE hRefValue,
+int32_t CXFA_FM2JSContext::ResolveObjects(CFXJSE_Value* pThis,
+ CFXJSE_Value* pRefValue,
const CFX_ByteStringC& bsSomExp,
XFA_RESOLVENODE_RS& resoveNodeRS,
FX_BOOL bdotAccessor,
@@ -6849,7 +6851,7 @@ int32_t CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis,
CFX_WideString wsSomExpression = CFX_WideString::FromUTF8(bsSomExp);
int32_t iRet = -1;
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
CXFA_Document* pDoc = pContext->GetDocument();
if (!pDoc) {
return iRet;
@@ -6858,11 +6860,11 @@ int32_t CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis,
CXFA_Object* pNode = NULL;
uint32_t dFlags = 0UL;
if (bdotAccessor) {
- if (FXJSE_Value_IsNull(hRefValue)) {
+ if (FXJSE_Value_IsNull(pRefValue)) {
pNode = pScriptContext->GetThisObject();
dFlags = XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent;
} else {
- pNode = (CXFA_Object*)FXJSE_Value_ToObject(hRefValue, NULL);
+ pNode = (CXFA_Object*)FXJSE_Value_ToObject(pRefValue, nullptr);
ASSERT(pNode);
if (bHasNoResolveName) {
CFX_WideString wsName;
@@ -6884,7 +6886,7 @@ int32_t CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis,
}
}
} else {
- pNode = (CXFA_Object*)FXJSE_Value_ToObject(hRefValue, NULL);
+ pNode = (CXFA_Object*)FXJSE_Value_ToObject(pRefValue, nullptr);
dFlags = XFA_RESOLVENODE_AnyChild;
}
iRet = pScriptContext->ResolveObjects(pNode, wsSomExpression.AsStringC(),
@@ -6892,21 +6894,21 @@ int32_t CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis,
return iRet;
}
void CXFA_FM2JSContext::ParseResolveResult(
- FXJSE_HOBJECT hThis,
+ CFXJSE_Value* pThis,
const XFA_RESOLVENODE_RS& resoveNodeRS,
- FXJSE_HVALUE hParentValue,
- FXJSE_HVALUE*& resultValues,
+ CFXJSE_Value* pParentValue,
+ CFXJSE_Value**& resultValues,
int32_t& iSize,
FX_BOOL& bAttribute) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
iSize = 0;
resultValues = NULL;
if (resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) {
bAttribute = FALSE;
iSize = resoveNodeRS.nodes.GetSize();
- resultValues = FX_Alloc(FXJSE_HVALUE, iSize);
+ resultValues = FX_Alloc(CFXJSE_Value*, iSize);
for (int32_t i = 0; i < iSize; i++) {
resultValues[i] = FXJSE_Value_Create(pIsolate);
FXJSE_Value_Set(
@@ -6915,19 +6917,19 @@ void CXFA_FM2JSContext::ParseResolveResult(
resoveNodeRS.nodes.GetAt(i)));
}
} else {
- CXFA_HVALUEArray objectProperties(pIsolate);
+ CXFA_ValueArray objectProperties(pIsolate);
int32_t iRet = resoveNodeRS.GetAttributeResult(objectProperties);
bAttribute = (iRet == 0);
if (bAttribute) {
- if (FXJSE_Value_IsObject(hParentValue)) {
+ if (FXJSE_Value_IsObject(pParentValue)) {
iSize = 1;
- resultValues = FX_Alloc(FXJSE_HVALUE, 1);
+ resultValues = FX_Alloc(CFXJSE_Value*, 1);
resultValues[0] = FXJSE_Value_Create(pIsolate);
- FXJSE_Value_Set(resultValues[0], hParentValue);
+ FXJSE_Value_Set(resultValues[0], pParentValue);
}
} else {
iSize = iRet;
- resultValues = FX_Alloc(FXJSE_HVALUE, iSize);
+ resultValues = FX_Alloc(CFXJSE_Value*, iSize);
for (int32_t i = 0; i < iSize; i++) {
resultValues[i] = FXJSE_Value_Create(pIsolate);
FXJSE_Value_Set(resultValues[i], objectProperties[i]);
@@ -6935,18 +6937,18 @@ void CXFA_FM2JSContext::ParseResolveResult(
}
}
}
-int32_t CXFA_FM2JSContext::HValueToInteger(FXJSE_HOBJECT hThis,
- FXJSE_HVALUE hValue) {
+int32_t CXFA_FM2JSContext::ValueToInteger(CFXJSE_Value* pThis,
+ CFXJSE_Value* pValue) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
int32_t iValue = 0;
- if (FXJSE_Value_IsArray(hValue)) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE newProperty = FXJSE_Value_Create(pIsolate);
- FXJSE_Value_GetObjectPropByIdx(hValue, 1, propertyValue);
- FXJSE_Value_GetObjectPropByIdx(hValue, 2, jsobjectValue);
+ if (FXJSE_Value_IsArray(pValue)) {
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsobjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newProperty = FXJSE_Value_Create(pIsolate);
+ FXJSE_Value_GetObjectPropByIdx(pValue, 1, propertyValue);
+ FXJSE_Value_GetObjectPropByIdx(pValue, 2, jsobjectValue);
if (FXJSE_Value_IsNull(propertyValue)) {
GetObjectDefaultValue(jsobjectValue, newProperty);
} else {
@@ -6955,23 +6957,23 @@ int32_t CXFA_FM2JSContext::HValueToInteger(FXJSE_HOBJECT hThis,
FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsStringC(),
newProperty);
}
- iValue = HValueToInteger(hThis, newProperty);
+ iValue = ValueToInteger(pThis, newProperty);
FXJSE_Value_Release(newProperty);
FXJSE_Value_Release(jsobjectValue);
FXJSE_Value_Release(propertyValue);
return iValue;
- } else if (FXJSE_Value_IsObject(hValue)) {
- FXJSE_HVALUE newProperty = FXJSE_Value_Create(pIsolate);
- GetObjectDefaultValue(hValue, newProperty);
- iValue = HValueToInteger(hThis, newProperty);
+ } else if (FXJSE_Value_IsObject(pValue)) {
+ CFXJSE_Value* newProperty = FXJSE_Value_Create(pIsolate);
+ GetObjectDefaultValue(pValue, newProperty);
+ iValue = ValueToInteger(pThis, newProperty);
FXJSE_Value_Release(newProperty);
return iValue;
- } else if (FXJSE_Value_IsUTF8String(hValue)) {
+ } else if (FXJSE_Value_IsUTF8String(pValue)) {
CFX_ByteString szValue;
- FXJSE_Value_ToUTF8String(hValue, szValue);
+ FXJSE_Value_ToUTF8String(pValue, szValue);
iValue = FXSYS_atoi(szValue.c_str());
} else {
- iValue = FXJSE_Value_ToInteger(hValue);
+ iValue = FXJSE_Value_ToInteger(pValue);
}
return iValue;
}
@@ -6979,16 +6981,16 @@ FX_DOUBLE CXFA_FM2JSContext::StringToDouble(
const CFX_ByteStringC& szStringVal) {
return XFA_ByteStringToDouble(szStringVal);
}
-FX_FLOAT CXFA_FM2JSContext::HValueToFloat(FXJSE_HOBJECT hThis,
- FXJSE_HVALUE arg) {
+FX_FLOAT CXFA_FM2JSContext::ValueToFloat(CFXJSE_Value* pThis,
+ CFXJSE_Value* arg) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
FX_FLOAT fRet = 0.0f;
if (FXJSE_Value_IsArray(arg)) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE newProperty = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsobjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newProperty = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(arg, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(arg, 2, jsobjectValue);
if (FXJSE_Value_IsNull(propertyValue)) {
@@ -6999,14 +7001,14 @@ FX_FLOAT CXFA_FM2JSContext::HValueToFloat(FXJSE_HOBJECT hThis,
FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsStringC(),
newProperty);
}
- fRet = HValueToFloat(hThis, newProperty);
+ fRet = ValueToFloat(pThis, newProperty);
FXJSE_Value_Release(newProperty);
FXJSE_Value_Release(jsobjectValue);
FXJSE_Value_Release(propertyValue);
} else if (FXJSE_Value_IsObject(arg)) {
- FXJSE_HVALUE newProperty = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newProperty = FXJSE_Value_Create(pIsolate);
GetObjectDefaultValue(arg, newProperty);
- fRet = HValueToFloat(hThis, newProperty);
+ fRet = ValueToFloat(pThis, newProperty);
FXJSE_Value_Release(newProperty);
} else if (FXJSE_Value_IsUTF8String(arg)) {
CFX_ByteString bsOutput;
@@ -7019,16 +7021,16 @@ FX_FLOAT CXFA_FM2JSContext::HValueToFloat(FXJSE_HOBJECT hThis,
}
return fRet;
}
-FX_DOUBLE CXFA_FM2JSContext::HValueToDouble(FXJSE_HOBJECT hThis,
- FXJSE_HVALUE arg) {
+FX_DOUBLE CXFA_FM2JSContext::ValueToDouble(CFXJSE_Value* pThis,
+ CFXJSE_Value* arg) {
CXFA_FM2JSContext* pContext =
- (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
+ (CXFA_FM2JSContext*)FXJSE_Value_ToObject(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
FX_DOUBLE dRet = 0;
if (FXJSE_Value_IsArray(arg)) {
- FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(pIsolate);
- FXJSE_HVALUE newProperty = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* propertyValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* jsobjectValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newProperty = FXJSE_Value_Create(pIsolate);
FXJSE_Value_GetObjectPropByIdx(arg, 1, propertyValue);
FXJSE_Value_GetObjectPropByIdx(arg, 2, jsobjectValue);
if (FXJSE_Value_IsNull(propertyValue)) {
@@ -7039,14 +7041,14 @@ FX_DOUBLE CXFA_FM2JSContext::HValueToDouble(FXJSE_HOBJECT hThis,
FXJSE_Value_GetObjectProp(jsobjectValue, propertyStr.AsStringC(),
newProperty);
}
- dRet = HValueToDouble(hThis, newProperty);
+ dRet = ValueToDouble(pThis, newProperty);
FXJSE_Value_Release(newProperty);
FXJSE_Value_Release(jsobjectValue);
FXJSE_Value_Release(propertyValue);
} else if (FXJSE_Value_IsObject(arg)) {
- FXJSE_HVALUE newProperty = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* newProperty = FXJSE_Value_Create(pIsolate);
GetObjectDefaultValue(arg, newProperty);
- dRet = HValueToDouble(hThis, newProperty);
+ dRet = ValueToDouble(pThis, newProperty);
FXJSE_Value_Release(newProperty);
} else if (FXJSE_Value_IsUTF8String(arg)) {
CFX_ByteString bsOutput;
@@ -7059,8 +7061,8 @@ FX_DOUBLE CXFA_FM2JSContext::HValueToDouble(FXJSE_HOBJECT hThis,
}
return dRet;
}
-void CXFA_FM2JSContext::HValueToUTF8String(FXJSE_HVALUE arg,
- CFX_ByteString& szOutputString) {
+void CXFA_FM2JSContext::ValueToUTF8String(CFXJSE_Value* arg,
+ CFX_ByteString& szOutputString) {
if (FXJSE_Value_IsNull(arg) || FXJSE_Value_IsUndefined(arg)) {
szOutputString = "";
} else if (FXJSE_Value_IsBoolean(arg)) {
@@ -7167,14 +7169,12 @@ CXFA_FM2JSContext::CXFA_FM2JSContext()
: m_pFMClass(nullptr), m_pDocument(nullptr) {
FXSYS_memset(&m_fmClass, 0, sizeof(FXJSE_CLASS));
}
+
CXFA_FM2JSContext::~CXFA_FM2JSContext() {
- m_pDocument = NULL;
- if (m_hValue) {
- FXJSE_Value_Release(m_hValue);
- m_hValue = NULL;
- }
- m_pIsolate = NULL;
+ if (m_pValue)
+ FXJSE_Value_Release(m_pValue);
}
+
void CXFA_FM2JSContext::Initialize(v8::Isolate* pScriptIsolate,
CFXJSE_Context* pScriptContext,
CXFA_Document* pDoc) {
@@ -7188,12 +7188,12 @@ void CXFA_FM2JSContext::Initialize(v8::Isolate* pScriptIsolate,
m_fmClass.methNum =
sizeof(formcalc_fm2js_functions) / sizeof(formcalc_fm2js_functions[0]);
m_pFMClass = FXJSE_DefineClass(pScriptContext, &m_fmClass);
- m_hValue = FXJSE_Value_Create(pScriptIsolate);
- FXJSE_Value_SetNull(m_hValue);
- FXJSE_Value_SetObject(m_hValue, this, m_pFMClass);
+ m_pValue = FXJSE_Value_Create(pScriptIsolate);
+ FXJSE_Value_SetNull(m_pValue);
+ FXJSE_Value_SetObject(m_pValue, this, m_pFMClass);
}
-void CXFA_FM2JSContext::GlobalPropertyGetter(FXJSE_HVALUE hValue) {
- FXJSE_Value_Set(hValue, m_hValue);
+void CXFA_FM2JSContext::GlobalPropertyGetter(CFXJSE_Value* pValue) {
+ FXJSE_Value_Set(pValue, m_pValue);
}
void CXFA_FM2JSContext::ThrowScriptErrorMessage(int32_t iStringID, ...) {
IXFA_AppProvider* pAppProvider = m_pDocument->GetNotify()->GetAppProvider();
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.h b/xfa/fxfa/fm2js/xfa_fm2jscontext.h
index 81cf08b2a5..fc1a111a80 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.h
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.h
@@ -12,73 +12,73 @@
class CXFA_FM2JSContext {
public:
- static void Abs(FXJSE_HOBJECT hThis,
+ static void Abs(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Avg(FXJSE_HOBJECT hThis,
+ static void Avg(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Ceil(FXJSE_HOBJECT hThis,
+ static void Ceil(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Count(FXJSE_HOBJECT hThis,
+ static void Count(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Floor(FXJSE_HOBJECT hThis,
+ static void Floor(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Max(FXJSE_HOBJECT hThis,
+ static void Max(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Min(FXJSE_HOBJECT hThis,
+ static void Min(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Mod(FXJSE_HOBJECT hThis,
+ static void Mod(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Round(FXJSE_HOBJECT hThis,
+ static void Round(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Sum(FXJSE_HOBJECT hThis,
+ static void Sum(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Date(FXJSE_HOBJECT hThis,
+ static void Date(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Date2Num(FXJSE_HOBJECT hThis,
+ static void Date2Num(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void DateFmt(FXJSE_HOBJECT hThis,
+ static void DateFmt(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void IsoDate2Num(FXJSE_HOBJECT hThis,
+ static void IsoDate2Num(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void IsoTime2Num(FXJSE_HOBJECT hThis,
+ static void IsoTime2Num(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void LocalDateFmt(FXJSE_HOBJECT hThis,
+ static void LocalDateFmt(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void LocalTimeFmt(FXJSE_HOBJECT hThis,
+ static void LocalTimeFmt(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Num2Date(FXJSE_HOBJECT hThis,
+ static void Num2Date(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Num2GMTime(FXJSE_HOBJECT hThis,
+ static void Num2GMTime(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Num2Time(FXJSE_HOBJECT hThis,
+ static void Num2Time(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Time(FXJSE_HOBJECT hThis,
+ static void Time(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Time2Num(FXJSE_HOBJECT hThis,
+ static void Time2Num(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void TimeFmt(FXJSE_HOBJECT hThis,
+ static void TimeFmt(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
@@ -107,52 +107,52 @@ class CXFA_FM2JSContext {
int32_t& iMillionSecond,
int32_t& iZoneHour,
int32_t& iZoneMinute);
- static FX_BOOL Local2IsoDate(FXJSE_HOBJECT hThis,
+ static FX_BOOL Local2IsoDate(CFXJSE_Value* pThis,
const CFX_ByteStringC& szDate,
const CFX_ByteStringC& szFormat,
const CFX_ByteStringC& szLocale,
CFX_ByteString& strIsoDate);
- static FX_BOOL Local2IsoTime(FXJSE_HOBJECT hThis,
+ static FX_BOOL Local2IsoTime(CFXJSE_Value* pThis,
const CFX_ByteStringC& szTime,
const CFX_ByteStringC& szFormat,
const CFX_ByteStringC& szLocale,
CFX_ByteString& strIsoTime);
- static FX_BOOL IsoDate2Local(FXJSE_HOBJECT hThis,
+ static FX_BOOL IsoDate2Local(CFXJSE_Value* pThis,
const CFX_ByteStringC& szDate,
const CFX_ByteStringC& szFormat,
const CFX_ByteStringC& szLocale,
CFX_ByteString& strLocalDate);
- static FX_BOOL IsoTime2Local(FXJSE_HOBJECT hThis,
+ static FX_BOOL IsoTime2Local(CFXJSE_Value* pThis,
const CFX_ByteStringC& szTime,
const CFX_ByteStringC& szFormat,
const CFX_ByteStringC& szLocale,
CFX_ByteString& strLocalTime);
- static FX_BOOL GetGMTTime(FXJSE_HOBJECT hThis,
+ static FX_BOOL GetGMTTime(CFXJSE_Value* pThis,
const CFX_ByteStringC& szTime,
const CFX_ByteStringC& szFormat,
const CFX_ByteStringC& szLocale,
CFX_ByteString& strGMTTime);
static int32_t DateString2Num(const CFX_ByteStringC& szDateString);
- static void GetLocalDateFormat(FXJSE_HOBJECT hThis,
+ static void GetLocalDateFormat(CFXJSE_Value* pThis,
int32_t iStyle,
const CFX_ByteStringC& szLocalStr,
CFX_ByteString& strFormat,
FX_BOOL bStandard);
- static void GetLocalTimeFormat(FXJSE_HOBJECT hThis,
+ static void GetLocalTimeFormat(CFXJSE_Value* pThis,
int32_t iStyle,
const CFX_ByteStringC& szLocalStr,
CFX_ByteString& strFormat,
FX_BOOL bStandard);
- static void GetStandardDateFormat(FXJSE_HOBJECT hThis,
+ static void GetStandardDateFormat(CFXJSE_Value* pThis,
int32_t iStyle,
const CFX_ByteStringC& szLocalStr,
CFX_ByteString& strFormat);
- static void GetStandardTimeFormat(FXJSE_HOBJECT hThis,
+ static void GetStandardTimeFormat(CFXJSE_Value* pThis,
int32_t iStyle,
const CFX_ByteStringC& szLocalStr,
CFX_ByteString& strFormat);
- static void Num2AllTime(FXJSE_HOBJECT hThis,
+ static void Num2AllTime(CFXJSE_Value* pThis,
int32_t iTime,
const CFX_ByteStringC& szFormat,
const CFX_ByteStringC& szLocale,
@@ -160,74 +160,74 @@ class CXFA_FM2JSContext {
CFX_ByteString& strTime);
static void GetLocalTimeZone(int32_t& iHour, int32_t& iMin, int32_t& iSec);
- static void Apr(FXJSE_HOBJECT hThis,
+ static void Apr(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void CTerm(FXJSE_HOBJECT hThis,
+ static void CTerm(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void FV(FXJSE_HOBJECT hThis,
+ static void FV(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void IPmt(FXJSE_HOBJECT hThis,
+ static void IPmt(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void NPV(FXJSE_HOBJECT hThis,
+ static void NPV(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Pmt(FXJSE_HOBJECT hThis,
+ static void Pmt(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void PPmt(FXJSE_HOBJECT hThis,
+ static void PPmt(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void PV(FXJSE_HOBJECT hThis,
+ static void PV(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Rate(FXJSE_HOBJECT hThis,
+ static void Rate(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Term(FXJSE_HOBJECT hThis,
+ static void Term(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Choose(FXJSE_HOBJECT hThis,
+ static void Choose(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Exists(FXJSE_HOBJECT hThis,
+ static void Exists(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void HasValue(FXJSE_HOBJECT hThis,
+ static void HasValue(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Oneof(FXJSE_HOBJECT hThis,
+ static void Oneof(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Within(FXJSE_HOBJECT hThis,
+ static void Within(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void If(FXJSE_HOBJECT hThis,
+ static void If(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Eval(FXJSE_HOBJECT hThis,
+ static void Eval(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Ref(FXJSE_HOBJECT hThis,
+ static void Ref(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void UnitType(FXJSE_HOBJECT hThis,
+ static void UnitType(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void UnitValue(FXJSE_HOBJECT hThis,
+ static void UnitValue(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void At(FXJSE_HOBJECT hThis,
+ static void At(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Concat(FXJSE_HOBJECT hThis,
+ static void Concat(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Decode(FXJSE_HOBJECT hThis,
+ static void Decode(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
static void DecodeURL(const CFX_ByteStringC& szURLString,
@@ -236,7 +236,7 @@ class CXFA_FM2JSContext {
CFX_ByteTextBuf& szResultBuf);
static void DecodeXML(const CFX_ByteStringC& szXMLString,
CFX_ByteTextBuf& szResultBuf);
- static void Encode(FXJSE_HOBJECT hThis,
+ static void Encode(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
static void EncodeURL(const CFX_ByteStringC& szURLString,
@@ -247,52 +247,52 @@ class CXFA_FM2JSContext {
CFX_ByteTextBuf& szResultBuf);
static FX_BOOL HTMLSTR2Code(const CFX_WideStringC& pData, uint32_t& iCode);
static FX_BOOL HTMLCode2STR(uint32_t iCode, CFX_WideString& wsHTMLReserve);
- static void Format(FXJSE_HOBJECT hThis,
+ static void Format(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Left(FXJSE_HOBJECT hThis,
+ static void Left(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Len(FXJSE_HOBJECT hThis,
+ static void Len(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Lower(FXJSE_HOBJECT hThis,
+ static void Lower(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Ltrim(FXJSE_HOBJECT hThis,
+ static void Ltrim(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Parse(FXJSE_HOBJECT hThis,
+ static void Parse(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Replace(FXJSE_HOBJECT hThis,
+ static void Replace(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Right(FXJSE_HOBJECT hThis,
+ static void Right(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Rtrim(FXJSE_HOBJECT hThis,
+ static void Rtrim(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Space(FXJSE_HOBJECT hThis,
+ static void Space(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Str(FXJSE_HOBJECT hThis,
+ static void Str(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Stuff(FXJSE_HOBJECT hThis,
+ static void Stuff(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Substr(FXJSE_HOBJECT hThis,
+ static void Substr(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Uuid(FXJSE_HOBJECT hThis,
+ static void Uuid(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Upper(FXJSE_HOBJECT hThis,
+ static void Upper(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void WordNum(FXJSE_HOBJECT hThis,
+ static void WordNum(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
static void TrillionUS(const CFX_ByteStringC& szData,
@@ -301,136 +301,137 @@ class CXFA_FM2JSContext {
int32_t iStyle,
CFX_ByteTextBuf& strBuf);
- static void Get(FXJSE_HOBJECT hThis,
+ static void Get(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Post(FXJSE_HOBJECT hThis,
+ static void Post(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void Put(FXJSE_HOBJECT hThis,
+ static void Put(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void assign_value_operator(FXJSE_HOBJECT hThis,
+ static void assign_value_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void logical_or_operator(FXJSE_HOBJECT hThis,
+ static void logical_or_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void logical_and_operator(FXJSE_HOBJECT hThis,
+ static void logical_and_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void equality_operator(FXJSE_HOBJECT hThis,
+ static void equality_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void notequality_operator(FXJSE_HOBJECT hThis,
+ static void notequality_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static FX_BOOL fm_ref_equal(FXJSE_HOBJECT hThis, CFXJSE_Arguments& args);
- static void less_operator(FXJSE_HOBJECT hThis,
+ static FX_BOOL fm_ref_equal(CFXJSE_Value* pThis, CFXJSE_Arguments& args);
+ static void less_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void lessequal_operator(FXJSE_HOBJECT hThis,
+ static void lessequal_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void greater_operator(FXJSE_HOBJECT hThis,
+ static void greater_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void greaterequal_operator(FXJSE_HOBJECT hThis,
+ static void greaterequal_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void plus_operator(FXJSE_HOBJECT hThis,
+ static void plus_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void minus_operator(FXJSE_HOBJECT hThis,
+ static void minus_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void multiple_operator(FXJSE_HOBJECT hThis,
+ static void multiple_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void divide_operator(FXJSE_HOBJECT hThis,
+ static void divide_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void positive_operator(FXJSE_HOBJECT hThis,
+ static void positive_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void negative_operator(FXJSE_HOBJECT hThis,
+ static void negative_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void logical_not_operator(FXJSE_HOBJECT hThis,
+ static void logical_not_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void dot_accessor(FXJSE_HOBJECT hThis,
+ static void dot_accessor(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void dotdot_accessor(FXJSE_HOBJECT hThis,
+ static void dotdot_accessor(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void eval_translation(FXJSE_HOBJECT hThis,
+ static void eval_translation(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void is_fm_object(FXJSE_HOBJECT hThis,
+ static void is_fm_object(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void is_fm_array(FXJSE_HOBJECT hThis,
+ static void is_fm_array(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void get_fm_value(FXJSE_HOBJECT hThis,
+ static void get_fm_value(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void get_fm_jsobj(FXJSE_HOBJECT hThis,
+ static void get_fm_jsobj(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void fm_var_filter(FXJSE_HOBJECT hThis,
+ static void fm_var_filter(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static void concat_fm_object(FXJSE_HOBJECT hThis,
+ static void concat_fm_object(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static int32_t hvalue_get_array_length(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg);
- static FX_BOOL simpleValueCompare(FXJSE_HOBJECT hThis,
- FXJSE_HVALUE firstValue,
- FXJSE_HVALUE secondValue);
- static void unfoldArgs(FXJSE_HOBJECT hThis,
+ static int32_t hvalue_get_array_length(CFXJSE_Value* pThis,
+ CFXJSE_Value* arg);
+ static FX_BOOL simpleValueCompare(CFXJSE_Value* pThis,
+ CFXJSE_Value* firstValue,
+ CFXJSE_Value* secondValue);
+ static void unfoldArgs(CFXJSE_Value* pThis,
CFXJSE_Arguments& args,
- FXJSE_HVALUE*& resultValues,
+ CFXJSE_Value**& resultValues,
int32_t& iCount,
int32_t iStart = 0);
- static void GetObjectDefaultValue(FXJSE_HVALUE hObjectValue,
- FXJSE_HVALUE hDefaultValue);
- static FX_BOOL SetObjectDefaultValue(FXJSE_HVALUE hObjectValue,
- FXJSE_HVALUE hNewValue);
+ static void GetObjectDefaultValue(CFXJSE_Value* pObjectValue,
+ CFXJSE_Value* pDefaultValue);
+ static FX_BOOL SetObjectDefaultValue(CFXJSE_Value* pObjectValue,
+ CFXJSE_Value* pNewValue);
static void GenerateSomExpression(const CFX_ByteStringC& szName,
int32_t iIndexFlags,
int32_t iIndexValue,
FX_BOOL bIsStar,
CFX_ByteString& szSomExp);
- static FX_BOOL GetObjectByName(FXJSE_HOBJECT hThis,
- FXJSE_HVALUE accessorValue,
+ static FX_BOOL GetObjectByName(CFXJSE_Value* pThis,
+ CFXJSE_Value* accessorValue,
const CFX_ByteStringC& szAccessorName);
- static int32_t ResolveObjects(FXJSE_HOBJECT hThis,
- FXJSE_HVALUE hParentValue,
+ static int32_t ResolveObjects(CFXJSE_Value* pThis,
+ CFXJSE_Value* pParentValue,
const CFX_ByteStringC& bsSomExp,
XFA_RESOLVENODE_RS& resoveNodeRS,
FX_BOOL bdotAccessor = TRUE,
FX_BOOL bHasNoResolveName = FALSE);
- static void ParseResolveResult(FXJSE_HOBJECT hThis,
+ static void ParseResolveResult(CFXJSE_Value* pThis,
const XFA_RESOLVENODE_RS& resoveNodeRS,
- FXJSE_HVALUE hParentValue,
- FXJSE_HVALUE*& resultValues,
+ CFXJSE_Value* pParentValue,
+ CFXJSE_Value**& resultValues,
int32_t& iSize,
FX_BOOL& bAttribute);
- static FXJSE_HVALUE GetSimpleHValue(FXJSE_HOBJECT hThis,
+ static CFXJSE_Value* GetSimpleValue(CFXJSE_Value* pThis,
CFXJSE_Arguments& args,
uint32_t index);
- static FX_BOOL HValueIsNull(FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue);
- static int32_t HValueToInteger(FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue);
+ static FX_BOOL ValueIsNull(CFXJSE_Value* pThis, CFXJSE_Value* pValue);
+ static int32_t ValueToInteger(CFXJSE_Value* pThis, CFXJSE_Value* pValue);
static FX_DOUBLE StringToDouble(const CFX_ByteStringC& szStringVal);
- static FX_FLOAT HValueToFloat(FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue);
- static FX_DOUBLE HValueToDouble(FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue);
- static void HValueToUTF8String(FXJSE_HVALUE hValue,
- CFX_ByteString& outputValue);
+ static FX_FLOAT ValueToFloat(CFXJSE_Value* pThis, CFXJSE_Value* pValue);
+ static FX_DOUBLE ValueToDouble(CFXJSE_Value* pThis, CFXJSE_Value* pValue);
+ static void ValueToUTF8String(CFXJSE_Value* pValue,
+ CFX_ByteString& outputValue);
CXFA_FM2JSContext();
~CXFA_FM2JSContext();
@@ -438,7 +439,7 @@ class CXFA_FM2JSContext {
void Initialize(v8::Isolate* pScriptIsolate,
CFXJSE_Context* pScriptContext,
CXFA_Document* pDoc);
- void GlobalPropertyGetter(FXJSE_HVALUE hValue);
+ void GlobalPropertyGetter(CFXJSE_Value* pValue);
v8::Isolate* GetScriptRuntime() const { return m_pIsolate; }
CXFA_Document* GetDocument() const { return m_pDocument; }
@@ -448,7 +449,7 @@ class CXFA_FM2JSContext {
v8::Isolate* m_pIsolate;
FXJSE_CLASS m_fmClass;
CFXJSE_Class* m_pFMClass;
- FXJSE_HVALUE m_hValue;
+ CFXJSE_Value* m_pValue;
CXFA_Document* m_pDocument;
};
diff --git a/xfa/fxfa/include/fxfa.h b/xfa/fxfa/include/fxfa.h
index f7f4a04166..a33263364d 100644
--- a/xfa/fxfa/include/fxfa.h
+++ b/xfa/fxfa/include/fxfa.h
@@ -470,13 +470,13 @@ class IXFA_DocProvider {
std::vector<CFX_ByteString>& sSuggest) = 0;
virtual FX_BOOL GetPDFScriptObject(CXFA_FFDoc* hDoc,
const CFX_ByteStringC& utf8Name,
- FXJSE_HVALUE hValue) = 0;
+ CFXJSE_Value* pValue) = 0;
virtual FX_BOOL GetGlobalProperty(CXFA_FFDoc* hDoc,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue) = 0;
+ CFXJSE_Value* pValue) = 0;
virtual FX_BOOL SetGlobalProperty(CXFA_FFDoc* hDoc,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue) = 0;
+ CFXJSE_Value* pValue) = 0;
virtual CPDF_Document* OpenPDF(CXFA_FFDoc* hDoc,
IFX_FileRead* pFile,
FX_BOOL bTakeOverFile) = 0;
diff --git a/xfa/fxfa/include/fxfa_basic.h b/xfa/fxfa/include/fxfa_basic.h
index f5f52c7a7f..e1aa67447e 100644
--- a/xfa/fxfa/include/fxfa_basic.h
+++ b/xfa/fxfa/include/fxfa_basic.h
@@ -1063,7 +1063,7 @@ struct XFA_METHODINFO {
const XFA_METHODINFO* XFA_GetMethodByName(XFA_ELEMENT eElement,
const CFX_WideStringC& wsMethodName);
-typedef void (CXFA_Object::*XFA_ATTRIBUTE_CALLBACK)(FXJSE_HVALUE hValue,
+typedef void (CXFA_Object::*XFA_ATTRIBUTE_CALLBACK)(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
enum XFA_SCRIPT_TYPE {
diff --git a/xfa/fxfa/include/fxfa_widget.h b/xfa/fxfa/include/fxfa_widget.h
index 53409433dc..e07005cc74 100644
--- a/xfa/fxfa/include/fxfa_widget.h
+++ b/xfa/fxfa/include/fxfa_widget.h
@@ -53,7 +53,7 @@ class CXFA_WidgetAcc : public CXFA_WidgetData {
int32_t ProcessValidate(int32_t iFlags = 0);
int32_t ExecuteScript(CXFA_Script script,
CXFA_EventParam* pEventParam,
- FXJSE_HVALUE* pRetValue = NULL);
+ CFXJSE_Value** pRetValue = nullptr);
CXFA_FFWidget* GetNextWidget(CXFA_FFWidget* pWidget);
void StartWidgetLayout(FX_FLOAT& fCalcWidth, FX_FLOAT& fCalcHeight);
@@ -82,7 +82,7 @@ class CXFA_WidgetAcc : public CXFA_WidgetData {
protected:
void ProcessScriptTestValidate(CXFA_Validate validate,
int32_t iRet,
- FXJSE_HVALUE pRetValue,
+ CFXJSE_Value* pRetValue,
FX_BOOL bVersionFlag);
int32_t ProcessFormatTestValidate(CXFA_Validate validate,
FX_BOOL bVersionFlag);
diff --git a/xfa/fxfa/include/xfa_ffdochandler.h b/xfa/fxfa/include/xfa_ffdochandler.h
index 9cd9b0e632..b5a73d1d10 100644
--- a/xfa/fxfa/include/xfa_ffdochandler.h
+++ b/xfa/fxfa/include/xfa_ffdochandler.h
@@ -16,14 +16,14 @@ class CXFA_FFDocHandler {
CXFA_FFDocHandler();
~CXFA_FFDocHandler();
- FXJSE_HVALUE GetXFAScriptObject(CXFA_FFDoc* hDoc);
+ CFXJSE_Value* GetXFAScriptObject(CXFA_FFDoc* hDoc);
XFA_ATTRIBUTEENUM GetRestoreState(CXFA_FFDoc* hDoc);
FX_BOOL RunDocScript(CXFA_FFDoc* hDoc,
XFA_SCRIPTTYPE eScriptType,
const CFX_WideStringC& wsScript,
- FXJSE_HVALUE hRetValue,
- FXJSE_HVALUE hThisObject);
+ CFXJSE_Value* pRetValue,
+ CFXJSE_Value* pThisObject);
protected:
};
diff --git a/xfa/fxfa/parser/xfa_object.h b/xfa/fxfa/parser/xfa_object.h
index f6267b5998..28d4712e46 100644
--- a/xfa/fxfa/parser/xfa_object.h
+++ b/xfa/fxfa/parser/xfa_object.h
@@ -80,7 +80,7 @@ class CXFA_Object {
XFA_ELEMENT GetClassID() const;
void GetClassName(CFX_WideStringC& wsName) const;
uint32_t GetClassHashCode() const;
- void Script_ObjectClass_ClassName(FXJSE_HVALUE hValue,
+ void Script_ObjectClass_ClassName(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
void ThrowScriptErrorMessage(int32_t iStringID, ...);
@@ -307,29 +307,29 @@ class CXFA_Node : public CXFA_Object {
CXFA_Node* GetOccurNode();
void Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments);
void Script_TreeClass_ResolveNodes(CFXJSE_Arguments* pArguments);
- void Script_Som_ResolveNodeList(FXJSE_HVALUE hValue,
+ void Script_Som_ResolveNodeList(CFXJSE_Value* pValue,
CFX_WideString wsExpression,
uint32_t dwFlag,
CXFA_Node* refNode = NULL);
- void Script_TreeClass_All(FXJSE_HVALUE hValue,
+ void Script_TreeClass_All(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_TreeClass_Nodes(FXJSE_HVALUE hValue,
+ void Script_TreeClass_Nodes(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_TreeClass_ClassAll(FXJSE_HVALUE hValue,
+ void Script_TreeClass_ClassAll(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_TreeClass_Parent(FXJSE_HVALUE hValue,
+ void Script_TreeClass_Parent(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_TreeClass_Index(FXJSE_HVALUE hValue,
+ void Script_TreeClass_Index(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_TreeClass_ClassIndex(FXJSE_HVALUE hValue,
+ void Script_TreeClass_ClassIndex(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_TreeClass_SomExpression(FXJSE_HVALUE hValue,
+ void Script_TreeClass_SomExpression(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_NodeClass_ApplyXSL(CFXJSE_Arguments* pArguments);
@@ -343,19 +343,19 @@ class CXFA_Node : public CXFA_Object {
void Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments);
void Script_NodeClass_SetAttribute(CFXJSE_Arguments* pArguments);
void Script_NodeClass_SetElement(CFXJSE_Arguments* pArguments);
- void Script_NodeClass_Ns(FXJSE_HVALUE hValue,
+ void Script_NodeClass_Ns(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_NodeClass_Model(FXJSE_HVALUE hValue,
+ void Script_NodeClass_Model(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_NodeClass_IsContainer(FXJSE_HVALUE hValue,
+ void Script_NodeClass_IsContainer(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_NodeClass_IsNull(FXJSE_HVALUE hValue,
+ void Script_NodeClass_IsNull(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_NodeClass_OneOfChild(FXJSE_HVALUE hValue,
+ void Script_NodeClass_OneOfChild(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_ContainerClass_GetDelta(CFXJSE_Arguments* pArguments);
@@ -363,104 +363,104 @@ class CXFA_Node : public CXFA_Object {
void Script_ModelClass_ClearErrorList(CFXJSE_Arguments* pArguments);
void Script_ModelClass_CreateNode(CFXJSE_Arguments* pArguments);
void Script_ModelClass_IsCompatibleNS(CFXJSE_Arguments* pArguments);
- void Script_ModelClass_Context(FXJSE_HVALUE hValue,
+ void Script_ModelClass_Context(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_ModelClass_AliasNode(FXJSE_HVALUE hValue,
+ void Script_ModelClass_AliasNode(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_WsdlConnection_Execute(CFXJSE_Arguments* pArguments);
void Script_Delta_Restore(CFXJSE_Arguments* pArguments);
- void Script_Delta_CurrentValue(FXJSE_HVALUE hValue,
+ void Script_Delta_CurrentValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Delta_SavedValue(FXJSE_HVALUE hValue,
+ void Script_Delta_SavedValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Delta_Target(FXJSE_HVALUE hValue,
+ void Script_Delta_Target(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Attribute_SendAttributeChangeMessage(XFA_ATTRIBUTE eAttribute,
FX_BOOL bScriptModify);
- void Script_Attribute_Integer(FXJSE_HVALUE hValue,
+ void Script_Attribute_Integer(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Attribute_IntegerRead(FXJSE_HVALUE hValue,
+ void Script_Attribute_IntegerRead(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Attribute_BOOL(FXJSE_HVALUE hValue,
+ void Script_Attribute_BOOL(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Attribute_BOOLRead(FXJSE_HVALUE hValue,
+ void Script_Attribute_BOOLRead(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Attribute_String(FXJSE_HVALUE hValue,
+ void Script_Attribute_String(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Attribute_StringRead(FXJSE_HVALUE hValue,
+ void Script_Attribute_StringRead(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Som_ValidationMessage(FXJSE_HVALUE hValue,
+ void Script_Som_ValidationMessage(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Field_Length(FXJSE_HVALUE hValue,
+ void Script_Field_Length(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Som_DefaultValue(FXJSE_HVALUE hValue,
+ void Script_Som_DefaultValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Som_DefaultValue_Read(FXJSE_HVALUE hValue,
+ void Script_Som_DefaultValue_Read(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Boolean_Value(FXJSE_HVALUE hValue,
+ void Script_Boolean_Value(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Som_Message(FXJSE_HVALUE hValue,
+ void Script_Som_Message(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_SOM_MESSAGETYPE iMessageType);
- void Script_Som_BorderColor(FXJSE_HVALUE hValue,
+ void Script_Som_BorderColor(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Som_BorderWidth(FXJSE_HVALUE hValue,
+ void Script_Som_BorderWidth(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Som_FillColor(FXJSE_HVALUE hValue,
+ void Script_Som_FillColor(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Som_DataNode(FXJSE_HVALUE hValue,
+ void Script_Som_DataNode(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Som_FontColor(FXJSE_HVALUE hValue,
+ void Script_Som_FontColor(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Som_Mandatory(FXJSE_HVALUE hValue,
+ void Script_Som_Mandatory(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Som_MandatoryMessage(FXJSE_HVALUE hValue,
+ void Script_Som_MandatoryMessage(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Som_InstanceIndex(FXJSE_HVALUE hValue,
+ void Script_Som_InstanceIndex(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Draw_DefaultValue(FXJSE_HVALUE hValue,
+ void Script_Draw_DefaultValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Field_DefaultValue(FXJSE_HVALUE hValue,
+ void Script_Field_DefaultValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Field_EditValue(FXJSE_HVALUE hValue,
+ void Script_Field_EditValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Field_FormatMessage(FXJSE_HVALUE hValue,
+ void Script_Field_FormatMessage(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Field_FormattedValue(FXJSE_HVALUE hValue,
+ void Script_Field_FormattedValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Field_ParentSubform(FXJSE_HVALUE hValue,
+ void Script_Field_ParentSubform(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Field_SelectedIndex(FXJSE_HVALUE hValue,
+ void Script_Field_SelectedIndex(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Field_ClearItems(CFXJSE_Arguments* pArguments);
@@ -476,13 +476,13 @@ class CXFA_Node : public CXFA_Object {
void Script_Field_SetItemState(CFXJSE_Arguments* pArguments);
void Script_Field_AddItem(CFXJSE_Arguments* pArguments);
void Script_Field_ExecValidate(CFXJSE_Arguments* pArguments);
- void Script_ExclGroup_DefaultAndRawValue(FXJSE_HVALUE hValue,
+ void Script_ExclGroup_DefaultAndRawValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_ExclGroup_ErrorText(FXJSE_HVALUE hValue,
+ void Script_ExclGroup_ErrorText(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_ExclGroup_Transient(FXJSE_HVALUE hValue,
+ void Script_ExclGroup_Transient(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_ExclGroup_ExecEvent(CFXJSE_Arguments* pArguments);
@@ -490,10 +490,10 @@ class CXFA_Node : public CXFA_Object {
void Script_ExclGroup_ExecInitialize(CFXJSE_Arguments* pArguments);
void Script_ExclGroup_ExecCalculate(CFXJSE_Arguments* pArguments);
void Script_ExclGroup_ExecValidate(CFXJSE_Arguments* pArguments);
- void Script_Subform_InstanceManager(FXJSE_HVALUE hValue,
+ void Script_Subform_InstanceManager(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Subform_Locale(FXJSE_HVALUE hValue,
+ void Script_Subform_Locale(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments);
@@ -511,13 +511,13 @@ class CXFA_Node : public CXFA_Object {
void Script_Template_ExecCalculate(CFXJSE_Arguments* pArguments);
void Script_Template_ExecValidate(CFXJSE_Arguments* pArguments);
void Script_Manifest_Evaluate(CFXJSE_Arguments* pArguments);
- void Script_InstanceManager_Count(FXJSE_HVALUE hValue,
+ void Script_InstanceManager_Count(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_InstanceManager_Max(FXJSE_HVALUE hValue,
+ void Script_InstanceManager_Max(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_InstanceManager_Min(FXJSE_HVALUE hValue,
+ void Script_InstanceManager_Min(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_InstanceManager_MoveInstance(CFXJSE_Arguments* pArguments);
@@ -527,10 +527,10 @@ class CXFA_Node : public CXFA_Object {
void Script_InstanceManager_InsertInstance(CFXJSE_Arguments* pArguments);
int32_t InstanceManager_SetInstances(int32_t iCount);
int32_t InstanceManager_MoveInstance(int32_t iTo, int32_t iFrom);
- void Script_Occur_Max(FXJSE_HVALUE hValue,
+ void Script_Occur_Max(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Occur_Min(FXJSE_HVALUE hValue,
+ void Script_Occur_Min(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Desc_Metadata(CFXJSE_Arguments* pArguments);
@@ -540,13 +540,13 @@ class CXFA_Node : public CXFA_Object {
void Script_Form_Recalculate(CFXJSE_Arguments* pArguments);
void Script_Form_ExecCalculate(CFXJSE_Arguments* pArguments);
void Script_Form_ExecValidate(CFXJSE_Arguments* pArguments);
- void Script_Form_Checksum(FXJSE_HVALUE hValue,
+ void Script_Form_Checksum(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments);
void Script_Packet_SetAttribute(CFXJSE_Arguments* pArguments);
void Script_Packet_RemoveAttribute(CFXJSE_Arguments* pArguments);
- void Script_Packet_Content(FXJSE_HVALUE hValue,
+ void Script_Packet_Content(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Source_Next(CFXJSE_Arguments* pArguments);
@@ -566,25 +566,25 @@ class CXFA_Node : public CXFA_Object {
void Script_Source_Close(CFXJSE_Arguments* pArguments);
void Script_Source_Last(CFXJSE_Arguments* pArguments);
void Script_Source_HasDataChanged(CFXJSE_Arguments* pArguments);
- void Script_Source_Db(FXJSE_HVALUE hValue,
+ void Script_Source_Db(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Xfa_This(FXJSE_HVALUE hValue,
+ void Script_Xfa_This(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Handler_Version(FXJSE_HVALUE hValue,
+ void Script_Handler_Version(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_SubmitFormat_Mode(FXJSE_HVALUE hValue,
+ void Script_SubmitFormat_Mode(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Extras_Type(FXJSE_HVALUE hValue,
+ void Script_Extras_Type(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Encrypt_Format(FXJSE_HVALUE hValue,
+ void Script_Encrypt_Format(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_Script_Stateless(FXJSE_HVALUE hValue,
+ void Script_Script_Stateless(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
@@ -695,7 +695,7 @@ class CXFA_NodeList : public CXFA_Object {
void Script_ListClass_Item(CFXJSE_Arguments* pArguments);
void Script_TreelistClass_NamedItem(CFXJSE_Arguments* pArguments);
- void Script_ListClass_Length(FXJSE_HVALUE hValue,
+ void Script_ListClass_Length(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
};
diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp
index 1d1a5a2290..6ee95eb8aa 100644
--- a/xfa/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/fxfa/parser/xfa_object_imp.cpp
@@ -52,14 +52,14 @@ XFA_ELEMENT CXFA_Object::GetClassID() const {
ASSERT(FALSE);
return (XFA_ELEMENT)0;
}
-void CXFA_Object::Script_ObjectClass_ClassName(FXJSE_HVALUE hValue,
+void CXFA_Object::Script_ObjectClass_ClassName(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
CFX_WideStringC className;
GetClassName(className);
FXJSE_Value_SetUTF8String(
- hValue,
+ pValue,
FX_UTF8Encode(className.c_str(), className.GetLength()).AsStringC());
} else {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
@@ -654,20 +654,20 @@ void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) {
if (iRet < 1) {
return FXJSE_Value_SetNull(pArguments->GetReturnValue());
}
- FXJSE_HVALUE hValue = NULL;
+ CFXJSE_Value* pValue = nullptr;
if (resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) {
CXFA_Object* pNode = resoveNodeRS.nodes[0];
- hValue = pScriptContext->GetJSValueFromMap(pNode);
- FXJSE_Value_Set(pArguments->GetReturnValue(), hValue);
+ pValue = pScriptContext->GetJSValueFromMap(pNode);
+ FXJSE_Value_Set(pArguments->GetReturnValue(), pValue);
} else {
const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo =
resoveNodeRS.pScriptAttribute;
if (lpAttributeInfo && lpAttributeInfo->eValueType == XFA_SCRIPT_Object) {
- hValue = FXJSE_Value_Create(pScriptContext->GetRuntime());
+ pValue = FXJSE_Value_Create(pScriptContext->GetRuntime());
(resoveNodeRS.nodes[0]->*(lpAttributeInfo->lpfnCallback))(
- hValue, FALSE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
- FXJSE_Value_Set(pArguments->GetReturnValue(), hValue);
- FXJSE_Value_Release(hValue);
+ pValue, FALSE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
+ FXJSE_Value_Set(pArguments->GetReturnValue(), pValue);
+ FXJSE_Value_Release(pValue);
} else {
FXJSE_Value_SetNull(pArguments->GetReturnValue());
}
@@ -682,8 +682,8 @@ void CXFA_Node::Script_TreeClass_ResolveNodes(CFXJSE_Arguments* pArguments) {
}
CFX_WideString wsExpression =
CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsStringC());
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (!hValue) {
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (!pValue) {
return;
}
uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes |
@@ -693,9 +693,9 @@ void CXFA_Node::Script_TreeClass_ResolveNodes(CFXJSE_Arguments* pArguments) {
if (refNode->GetClassID() == XFA_ELEMENT_Xfa) {
refNode = ToNode(m_pDocument->GetScriptContext()->GetThisObject());
}
- Script_Som_ResolveNodeList(hValue, wsExpression, dwFlag, refNode);
+ Script_Som_ResolveNodeList(pValue, wsExpression, dwFlag, refNode);
}
-void CXFA_Node::Script_Som_ResolveNodeList(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Som_ResolveNodeList(CFXJSE_Value* pValue,
CFX_WideString wsExpression,
uint32_t dwFlag,
CXFA_Node* refNode) {
@@ -716,20 +716,20 @@ void CXFA_Node::Script_Som_ResolveNodeList(FXJSE_HVALUE hValue,
pNodeList->Append(resoveNodeRS.nodes[i]->AsNode());
}
} else {
- CXFA_HVALUEArray hValueArray(pScriptContext->GetRuntime());
- if (resoveNodeRS.GetAttributeResult(hValueArray) > 0) {
+ CXFA_ValueArray valueArray(pScriptContext->GetRuntime());
+ if (resoveNodeRS.GetAttributeResult(valueArray) > 0) {
CXFA_ObjArray objectArray;
- hValueArray.GetAttributeObject(objectArray);
+ valueArray.GetAttributeObject(objectArray);
for (int32_t i = 0; i < objectArray.GetSize(); i++) {
if (objectArray[i]->IsNode())
pNodeList->Append(objectArray[i]->AsNode());
}
}
}
- FXJSE_Value_SetObject(hValue, (CXFA_Object*)pNodeList,
+ FXJSE_Value_SetObject(pValue, (CXFA_Object*)pNodeList,
pScriptContext->GetJseNormalClass());
}
-void CXFA_Node::Script_TreeClass_All(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_TreeClass_All(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
@@ -739,10 +739,10 @@ void CXFA_Node::Script_TreeClass_All(FXJSE_HVALUE hValue,
CFX_WideString wsName;
GetAttribute(XFA_ATTRIBUTE_Name, wsName);
CFX_WideString wsExpression = wsName + FX_WSTRC(L"[*]");
- Script_Som_ResolveNodeList(hValue, wsExpression, dwFlag);
+ Script_Som_ResolveNodeList(pValue, wsExpression, dwFlag);
}
}
-void CXFA_Node::Script_TreeClass_Nodes(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_TreeClass_Nodes(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
@@ -759,11 +759,11 @@ void CXFA_Node::Script_TreeClass_Nodes(FXJSE_HVALUE hValue,
FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC());
} else {
CXFA_AttachNodeList* pNodeList = new CXFA_AttachNodeList(m_pDocument, this);
- FXJSE_Value_SetObject(hValue, (CXFA_Object*)pNodeList,
+ FXJSE_Value_SetObject(pValue, (CXFA_Object*)pNodeList,
pScriptContext->GetJseNormalClass());
}
}
-void CXFA_Node::Script_TreeClass_ClassAll(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_TreeClass_ClassAll(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
@@ -773,10 +773,10 @@ void CXFA_Node::Script_TreeClass_ClassAll(FXJSE_HVALUE hValue,
CFX_WideStringC wsName;
GetClassName(wsName);
CFX_WideString wsExpression = FX_WSTRC(L"#") + wsName + FX_WSTRC(L"[*]");
- Script_Som_ResolveNodeList(hValue, wsExpression, dwFlag);
+ Script_Som_ResolveNodeList(pValue, wsExpression, dwFlag);
}
}
-void CXFA_Node::Script_TreeClass_Parent(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_TreeClass_Parent(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
@@ -785,31 +785,31 @@ void CXFA_Node::Script_TreeClass_Parent(FXJSE_HVALUE hValue,
CXFA_Node* pParent = GetNodeItem(XFA_NODEITEM_Parent);
if (pParent) {
FXJSE_Value_Set(
- hValue, m_pDocument->GetScriptContext()->GetJSValueFromMap(pParent));
+ pValue, m_pDocument->GetScriptContext()->GetJSValueFromMap(pParent));
} else {
- FXJSE_Value_SetNull(hValue);
+ FXJSE_Value_SetNull(pValue);
}
}
}
-void CXFA_Node::Script_TreeClass_Index(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_TreeClass_Index(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
} else {
- FXJSE_Value_SetInteger(hValue, GetNodeSameNameIndex());
+ FXJSE_Value_SetInteger(pValue, GetNodeSameNameIndex());
}
}
-void CXFA_Node::Script_TreeClass_ClassIndex(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_TreeClass_ClassIndex(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
} else {
- FXJSE_Value_SetInteger(hValue, GetNodeSameClassIndex());
+ FXJSE_Value_SetInteger(pValue, GetNodeSameClassIndex());
}
}
-void CXFA_Node::Script_TreeClass_SomExpression(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_TreeClass_SomExpression(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
@@ -817,7 +817,7 @@ void CXFA_Node::Script_TreeClass_SomExpression(FXJSE_HVALUE hValue,
} else {
CFX_WideString wsSOMExpression;
GetSOMExpression(wsSOMExpression);
- FXJSE_Value_SetUTF8String(hValue,
+ FXJSE_Value_SetUTF8String(pValue,
FX_UTF8Encode(wsSOMExpression).AsStringC());
}
}
@@ -876,9 +876,9 @@ void CXFA_Node::Script_NodeClass_GetAttribute(CFXJSE_Arguments* pArguments) {
CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsStringC());
CFX_WideString wsValue;
GetAttribute(wsExpression.AsStringC(), wsValue);
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsStringC());
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsValue).AsStringC());
}
}
void CXFA_Node::Script_NodeClass_GetElement(CFXJSE_Arguments* pArguments) {
@@ -939,9 +939,9 @@ void CXFA_Node::Script_NodeClass_IsPropertySpecified(
bHas = !!m_pParent->GetProperty(iIndex, pElementInfo->eName);
}
}
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue)
- FXJSE_Value_SetBoolean(hValue, bHas);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue)
+ FXJSE_Value_SetBoolean(pValue, bHas);
}
void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) {
@@ -1155,7 +1155,7 @@ void CXFA_Node::Script_NodeClass_SetElement(CFXJSE_Arguments* pArguments) {
wsName = CFX_WideString::FromUTF8(bsName.AsStringC());
}
}
-void CXFA_Node::Script_NodeClass_Ns(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_NodeClass_Ns(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
@@ -1163,43 +1163,43 @@ void CXFA_Node::Script_NodeClass_Ns(FXJSE_HVALUE hValue,
} else {
CFX_WideString wsNameSpace;
TryNamespace(wsNameSpace);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsNameSpace).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsNameSpace).AsStringC());
}
}
-void CXFA_Node::Script_NodeClass_Model(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_NodeClass_Model(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
} else {
- FXJSE_Value_Set(hValue, m_pDocument->GetScriptContext()->GetJSValueFromMap(
+ FXJSE_Value_Set(pValue, m_pDocument->GetScriptContext()->GetJSValueFromMap(
GetModelNode()));
}
}
-void CXFA_Node::Script_NodeClass_IsContainer(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_NodeClass_IsContainer(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
} else {
- FXJSE_Value_SetBoolean(hValue, IsContainerNode());
+ FXJSE_Value_SetBoolean(pValue, IsContainerNode());
}
}
-void CXFA_Node::Script_NodeClass_IsNull(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_NodeClass_IsNull(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
} else {
if (GetClassID() == XFA_ELEMENT_Subform) {
- FXJSE_Value_SetBoolean(hValue, FALSE);
+ FXJSE_Value_SetBoolean(pValue, FALSE);
return;
}
CFX_WideString strValue;
- FXJSE_Value_SetBoolean(hValue, !TryContent(strValue) || strValue.IsEmpty());
+ FXJSE_Value_SetBoolean(pValue, !TryContent(strValue) || strValue.IsEmpty());
}
}
-void CXFA_Node::Script_NodeClass_OneOfChild(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_NodeClass_OneOfChild(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
@@ -1209,7 +1209,7 @@ void CXFA_Node::Script_NodeClass_OneOfChild(FXJSE_HVALUE hValue,
int32_t iSize = GetNodeList(properts, XFA_NODEFILTER_OneOfProperty);
if (iSize > 0) {
FXJSE_Value_Set(
- hValue,
+ pValue,
m_pDocument->GetScriptContext()->GetJSValueFromMap(properts[0]));
}
}
@@ -1239,49 +1239,49 @@ void CXFA_Node::Script_ModelClass_IsCompatibleNS(CFXJSE_Arguments* pArguments) {
}
CFX_WideString wsNodeNameSpace;
TryNamespace(wsNodeNameSpace);
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetBoolean(hValue, wsNodeNameSpace == wsNameSpace);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetBoolean(pValue, wsNodeNameSpace == wsNameSpace);
}
}
-void CXFA_Node::Script_ModelClass_Context(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_ModelClass_Context(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {}
-void CXFA_Node::Script_ModelClass_AliasNode(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_ModelClass_AliasNode(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {}
-void CXFA_Node::Script_Attribute_Integer(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Attribute_Integer(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
- SetInteger(eAttribute, FXJSE_Value_ToInteger(hValue), true);
+ SetInteger(eAttribute, FXJSE_Value_ToInteger(pValue), true);
} else {
- FXJSE_Value_SetInteger(hValue, GetInteger(eAttribute));
+ FXJSE_Value_SetInteger(pValue, GetInteger(eAttribute));
}
}
-void CXFA_Node::Script_Attribute_IntegerRead(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Attribute_IntegerRead(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
- FXJSE_Value_SetInteger(hValue, GetInteger(eAttribute));
+ FXJSE_Value_SetInteger(pValue, GetInteger(eAttribute));
} else {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
}
}
-void CXFA_Node::Script_Attribute_BOOL(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Attribute_BOOL(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
- SetBoolean(eAttribute, FXJSE_Value_ToBoolean(hValue), true);
+ SetBoolean(eAttribute, FXJSE_Value_ToBoolean(pValue), true);
} else {
- FXJSE_Value_SetUTF8String(hValue, GetBoolean(eAttribute) ? "1" : "0");
+ FXJSE_Value_SetUTF8String(pValue, GetBoolean(eAttribute) ? "1" : "0");
}
}
-void CXFA_Node::Script_Attribute_BOOLRead(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Attribute_BOOLRead(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
- FXJSE_Value_SetUTF8String(hValue, GetBoolean(eAttribute) ? "1" : "0");
+ FXJSE_Value_SetUTF8String(pValue, GetBoolean(eAttribute) ? "1" : "0");
} else {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
}
@@ -1441,12 +1441,12 @@ void CXFA_Node::Script_Attribute_SendAttributeChangeMessage(
}
}
-void CXFA_Node::Script_Attribute_String(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Attribute_String(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
CFX_ByteString szValue;
- FXJSE_Value_ToUTF8String(hValue, szValue);
+ FXJSE_Value_ToUTF8String(pValue, szValue);
CFX_WideString wsValue = CFX_WideString::FromUTF8(szValue.AsStringC());
SetAttribute(eAttribute, wsValue.AsStringC(), true);
if (eAttribute == XFA_ATTRIBUTE_Use && GetClassID() == XFA_ELEMENT_Desc) {
@@ -1503,18 +1503,18 @@ void CXFA_Node::Script_Attribute_String(FXJSE_HVALUE hValue,
CFX_WideString wsValue;
GetAttribute(eAttribute, wsValue);
FXJSE_Value_SetUTF8String(
- hValue,
+ pValue,
FX_UTF8Encode(wsValue.c_str(), wsValue.GetLength()).AsStringC());
}
}
-void CXFA_Node::Script_Attribute_StringRead(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Attribute_StringRead(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
CFX_WideString wsValue;
GetAttribute(eAttribute, wsValue);
FXJSE_Value_SetUTF8String(
- hValue,
+ pValue,
FX_UTF8Encode(wsValue.c_str(), wsValue.GetLength()).AsStringC());
} else {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
@@ -1535,16 +1535,16 @@ void CXFA_Node::Script_Delta_Restore(CFXJSE_Arguments* pArguments) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"restore");
}
}
-void CXFA_Node::Script_Delta_CurrentValue(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Delta_CurrentValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {}
-void CXFA_Node::Script_Delta_SavedValue(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Delta_SavedValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {}
-void CXFA_Node::Script_Delta_Target(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Delta_Target(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {}
-void CXFA_Node::Script_Som_Message(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Som_Message(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_SOM_MESSAGETYPE iMessageType) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
@@ -1559,7 +1559,7 @@ void CXFA_Node::Script_Som_Message(FXJSE_HVALUE hValue,
}
if (bSetting) {
CFX_ByteString bsMessage;
- FXJSE_Value_ToUTF8String(hValue, bsMessage);
+ FXJSE_Value_ToUTF8String(pValue, bsMessage);
switch (iMessageType) {
case XFA_SOM_ValidationMessage:
validate.SetScriptMessageText(
@@ -1598,15 +1598,15 @@ void CXFA_Node::Script_Som_Message(FXJSE_HVALUE hValue,
default:
break;
}
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsMessage).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsMessage).AsStringC());
}
}
-void CXFA_Node::Script_Som_ValidationMessage(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Som_ValidationMessage(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_Som_Message(hValue, bSetting, XFA_SOM_ValidationMessage);
+ Script_Som_Message(pValue, bSetting, XFA_SOM_ValidationMessage);
}
-void CXFA_Node::Script_Field_Length(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Field_Length(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
@@ -1614,30 +1614,30 @@ void CXFA_Node::Script_Field_Length(FXJSE_HVALUE hValue,
} else {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
- FXJSE_Value_SetInteger(hValue, 0);
+ FXJSE_Value_SetInteger(pValue, 0);
return;
}
- FXJSE_Value_SetInteger(hValue, pWidgetData->CountChoiceListItems(TRUE));
+ FXJSE_Value_SetInteger(pValue, pWidgetData->CountChoiceListItems(TRUE));
}
}
-void CXFA_Node::Script_Som_DefaultValue(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Som_DefaultValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
XFA_ELEMENT classID = GetClassID();
if (classID == XFA_ELEMENT_Field) {
- Script_Field_DefaultValue(hValue, bSetting, eAttribute);
+ Script_Field_DefaultValue(pValue, bSetting, eAttribute);
return;
} else if (classID == XFA_ELEMENT_Draw) {
- Script_Draw_DefaultValue(hValue, bSetting, eAttribute);
+ Script_Draw_DefaultValue(pValue, bSetting, eAttribute);
return;
} else if (classID == XFA_ELEMENT_Boolean) {
- Script_Boolean_Value(hValue, bSetting, eAttribute);
+ Script_Boolean_Value(pValue, bSetting, eAttribute);
return;
}
if (bSetting) {
CFX_ByteString newValue;
- if (!(FXJSE_Value_IsNull(hValue) || FXJSE_Value_IsUndefined(hValue))) {
- FXJSE_Value_ToUTF8String(hValue, newValue);
+ if (!(FXJSE_Value_IsNull(pValue) || FXJSE_Value_IsUndefined(pValue))) {
+ FXJSE_Value_ToUTF8String(pValue, newValue);
}
CFX_WideString wsNewValue = CFX_WideString::FromUTF8(newValue.AsStringC());
CFX_WideString wsFormatValue(wsNewValue);
@@ -1672,20 +1672,20 @@ void CXFA_Node::Script_Som_DefaultValue(FXJSE_HVALUE hValue,
CFX_WideString content = GetScriptContent(TRUE);
if (content.IsEmpty() && classID != XFA_ELEMENT_Text &&
classID != XFA_ELEMENT_SubmitUrl) {
- FXJSE_Value_SetNull(hValue);
+ FXJSE_Value_SetNull(pValue);
} else if (classID == XFA_ELEMENT_Integer) {
- FXJSE_Value_SetInteger(hValue, FXSYS_wtoi(content.c_str()));
+ FXJSE_Value_SetInteger(pValue, FXSYS_wtoi(content.c_str()));
} else if (classID == XFA_ELEMENT_Float || classID == XFA_ELEMENT_Decimal) {
CFX_Decimal decimal(content.AsStringC());
- FXJSE_Value_SetFloat(hValue, (FX_FLOAT)(double)decimal);
+ FXJSE_Value_SetFloat(pValue, (FX_FLOAT)(double)decimal);
} else {
FXJSE_Value_SetUTF8String(
- hValue,
+ pValue,
FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC());
}
}
}
-void CXFA_Node::Script_Som_DefaultValue_Read(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Som_DefaultValue_Read(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
@@ -1694,20 +1694,20 @@ void CXFA_Node::Script_Som_DefaultValue_Read(FXJSE_HVALUE hValue,
}
CFX_WideString content = GetScriptContent(TRUE);
if (content.IsEmpty()) {
- FXJSE_Value_SetNull(hValue);
+ FXJSE_Value_SetNull(pValue);
} else {
FXJSE_Value_SetUTF8String(
- hValue,
+ pValue,
FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC());
}
}
-void CXFA_Node::Script_Boolean_Value(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Boolean_Value(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
CFX_ByteString newValue;
- if (!(FXJSE_Value_IsNull(hValue) || FXJSE_Value_IsUndefined(hValue))) {
- FXJSE_Value_ToUTF8String(hValue, newValue);
+ if (!(FXJSE_Value_IsNull(pValue) || FXJSE_Value_IsUndefined(pValue))) {
+ FXJSE_Value_ToUTF8String(pValue, newValue);
}
int32_t iValue = FXSYS_atoi(newValue.c_str());
CFX_WideString wsNewValue(iValue == 0 ? L"0" : L"1");
@@ -1719,7 +1719,7 @@ void CXFA_Node::Script_Boolean_Value(FXJSE_HVALUE hValue,
SetScriptContent(wsNewValue, wsFormatValue, true, TRUE);
} else {
CFX_WideString wsValue = GetScriptContent(TRUE);
- FXJSE_Value_SetBoolean(hValue, wsValue == FX_WSTRC(L"1"));
+ FXJSE_Value_SetBoolean(pValue, wsValue == FX_WSTRC(L"1"));
}
}
struct XFA_ExecEventParaInfo {
@@ -1809,7 +1809,7 @@ void XFA_STRING_TO_RGB(CFX_WideString& strRGB,
}
}
}
-void CXFA_Node::Script_Som_BorderColor(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Som_BorderColor(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
@@ -1821,7 +1821,7 @@ void CXFA_Node::Script_Som_BorderColor(FXJSE_HVALUE hValue,
CFX_WideString strColor;
if (bSetting) {
CFX_ByteString bsValue;
- FXJSE_Value_ToUTF8String(hValue, bsValue);
+ FXJSE_Value_ToUTF8String(pValue, bsValue);
strColor = CFX_WideString::FromUTF8(bsValue.AsStringC());
int32_t r = 0, g = 0, b = 0;
XFA_STRING_TO_RGB(strColor, r, g, b);
@@ -1836,10 +1836,10 @@ void CXFA_Node::Script_Som_BorderColor(FXJSE_HVALUE hValue,
int32_t a, r, g, b;
ArgbDecode(color, a, r, g, b);
strColor.Format(L"%d,%d,%d", r, g, b);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(strColor).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(strColor).AsStringC());
}
}
-void CXFA_Node::Script_Som_BorderWidth(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Som_BorderWidth(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
@@ -1851,7 +1851,7 @@ void CXFA_Node::Script_Som_BorderWidth(FXJSE_HVALUE hValue,
CFX_WideString wsThickness;
if (bSetting) {
CFX_ByteString bsValue;
- FXJSE_Value_ToUTF8String(hValue, bsValue);
+ FXJSE_Value_ToUTF8String(pValue, bsValue);
wsThickness = CFX_WideString::FromUTF8(bsValue.AsStringC());
for (int32_t i = 0; i < iSize; ++i) {
CXFA_Edge edge = border.GetEdge(i);
@@ -1862,10 +1862,10 @@ void CXFA_Node::Script_Som_BorderWidth(FXJSE_HVALUE hValue,
CXFA_Edge edge = border.GetEdge(0);
CXFA_Measurement thickness = edge.GetMSThickness();
thickness.ToString(wsThickness);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsThickness).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsThickness).AsStringC());
}
}
-void CXFA_Node::Script_Som_FillColor(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Som_FillColor(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
@@ -1881,7 +1881,7 @@ void CXFA_Node::Script_Som_FillColor(FXJSE_HVALUE hValue,
CFX_WideString wsColor;
if (bSetting) {
CFX_ByteString bsValue;
- FXJSE_Value_ToUTF8String(hValue, bsValue);
+ FXJSE_Value_ToUTF8String(pValue, bsValue);
wsColor = CFX_WideString::FromUTF8(bsValue.AsStringC());
int32_t r, g, b;
XFA_STRING_TO_RGB(wsColor, r, g, b);
@@ -1892,36 +1892,36 @@ void CXFA_Node::Script_Som_FillColor(FXJSE_HVALUE hValue,
int32_t a, r, g, b;
ArgbDecode(color, a, r, g, b);
wsColor.Format(L"%d,%d,%d", r, g, b);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsColor).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsColor).AsStringC());
}
}
-void CXFA_Node::Script_Som_DataNode(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Som_DataNode(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
CXFA_Node* pDataNode = GetBindData();
if (pDataNode) {
FXJSE_Value_Set(
- hValue,
+ pValue,
m_pDocument->GetScriptContext()->GetJSValueFromMap(pDataNode));
} else {
- FXJSE_Value_SetNull(hValue);
+ FXJSE_Value_SetNull(pValue);
}
} else {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
}
}
-void CXFA_Node::Script_Draw_DefaultValue(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Draw_DefaultValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
- if (FXJSE_Value_IsUTF8String(hValue)) {
+ if (FXJSE_Value_IsUTF8String(pValue)) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
ASSERT(pWidgetData);
XFA_ELEMENT uiType = pWidgetData->GetUIType();
if (uiType == XFA_ELEMENT_Text) {
CFX_ByteString newValue;
- FXJSE_Value_ToUTF8String(hValue, newValue);
+ FXJSE_Value_ToUTF8String(pValue, newValue);
CFX_WideString wsNewValue =
CFX_WideString::FromUTF8(newValue.AsStringC());
CFX_WideString wsFormatValue(wsNewValue);
@@ -1932,15 +1932,15 @@ void CXFA_Node::Script_Draw_DefaultValue(FXJSE_HVALUE hValue,
} else {
CFX_WideString content = GetScriptContent(TRUE);
if (content.IsEmpty()) {
- FXJSE_Value_SetNull(hValue);
+ FXJSE_Value_SetNull(pValue);
} else {
FXJSE_Value_SetUTF8String(
- hValue,
+ pValue,
FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC());
}
}
}
-void CXFA_Node::Script_Field_DefaultValue(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Field_DefaultValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
@@ -1948,7 +1948,7 @@ void CXFA_Node::Script_Field_DefaultValue(FXJSE_HVALUE hValue,
return;
}
if (bSetting) {
- if (FXJSE_Value_IsNull(hValue)) {
+ if (FXJSE_Value_IsNull(pValue)) {
pWidgetData->m_bPreNull = pWidgetData->m_bIsNull;
pWidgetData->m_bIsNull = TRUE;
} else {
@@ -1956,8 +1956,8 @@ void CXFA_Node::Script_Field_DefaultValue(FXJSE_HVALUE hValue,
pWidgetData->m_bIsNull = FALSE;
}
CFX_ByteString newValue;
- if (!(FXJSE_Value_IsNull(hValue) || FXJSE_Value_IsUndefined(hValue))) {
- FXJSE_Value_ToUTF8String(hValue, newValue);
+ if (!(FXJSE_Value_IsNull(pValue) || FXJSE_Value_IsUndefined(pValue))) {
+ FXJSE_Value_ToUTF8String(pValue, newValue);
}
CFX_WideString wsNewText = CFX_WideString::FromUTF8(newValue.AsStringC());
CXFA_Node* pUIChild = pWidgetData->GetUIChild();
@@ -1978,7 +1978,7 @@ void CXFA_Node::Script_Field_DefaultValue(FXJSE_HVALUE hValue,
} else {
CFX_WideString content = GetScriptContent(TRUE);
if (content.IsEmpty()) {
- FXJSE_Value_SetNull(hValue);
+ FXJSE_Value_SetNull(pValue);
} else {
CXFA_Node* pUIChild = pWidgetData->GetUIChild();
XFA_ELEMENT eUI = pUIChild->GetClassID();
@@ -1988,29 +1988,29 @@ void CXFA_Node::Script_Field_DefaultValue(FXJSE_HVALUE hValue,
if (eUI == XFA_ELEMENT_NumericEdit &&
(pNode->GetInteger(XFA_ATTRIBUTE_FracDigits) == -1)) {
FXJSE_Value_SetUTF8String(
- hValue,
+ pValue,
FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC());
} else {
CFX_Decimal decimal(content.AsStringC());
- FXJSE_Value_SetFloat(hValue, (FX_FLOAT)(double)decimal);
+ FXJSE_Value_SetFloat(pValue, (FX_FLOAT)(double)decimal);
}
} else if (pNode && pNode->GetClassID() == XFA_ELEMENT_Integer) {
- FXJSE_Value_SetInteger(hValue, FXSYS_wtoi(content.c_str()));
+ FXJSE_Value_SetInteger(pValue, FXSYS_wtoi(content.c_str()));
} else if (pNode && pNode->GetClassID() == XFA_ELEMENT_Boolean) {
- FXJSE_Value_SetBoolean(hValue,
+ FXJSE_Value_SetBoolean(pValue,
FXSYS_wtoi(content.c_str()) == 0 ? FALSE : TRUE);
} else if (pNode && pNode->GetClassID() == XFA_ELEMENT_Float) {
CFX_Decimal decimal(content.AsStringC());
- FXJSE_Value_SetFloat(hValue, (FX_FLOAT)(double)decimal);
+ FXJSE_Value_SetFloat(pValue, (FX_FLOAT)(double)decimal);
} else {
FXJSE_Value_SetUTF8String(
- hValue,
+ pValue,
FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC());
}
}
}
}
-void CXFA_Node::Script_Field_EditValue(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Field_EditValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
@@ -2020,15 +2020,15 @@ void CXFA_Node::Script_Field_EditValue(FXJSE_HVALUE hValue,
CFX_WideString wsValue;
if (bSetting) {
CFX_ByteString bsValue;
- FXJSE_Value_ToUTF8String(hValue, bsValue);
+ FXJSE_Value_ToUTF8String(pValue, bsValue);
wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC());
pWidgetData->SetValue(wsValue, XFA_VALUEPICTURE_Edit);
} else {
pWidgetData->GetValue(wsValue, XFA_VALUEPICTURE_Edit);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsValue).AsStringC());
}
}
-void CXFA_Node::Script_Som_FontColor(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Som_FontColor(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
@@ -2043,7 +2043,7 @@ void CXFA_Node::Script_Som_FontColor(FXJSE_HVALUE hValue,
CFX_WideString wsColor;
if (bSetting) {
CFX_ByteString bsValue;
- FXJSE_Value_ToUTF8String(hValue, bsValue);
+ FXJSE_Value_ToUTF8String(pValue, bsValue);
wsColor = CFX_WideString::FromUTF8(bsValue.AsStringC());
int32_t r, g, b;
XFA_STRING_TO_RGB(wsColor, r, g, b);
@@ -2054,15 +2054,15 @@ void CXFA_Node::Script_Som_FontColor(FXJSE_HVALUE hValue,
int32_t a, r, g, b;
ArgbDecode(color, a, r, g, b);
wsColor.Format(L"%d,%d,%d", r, g, b);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsColor).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsColor).AsStringC());
}
}
-void CXFA_Node::Script_Field_FormatMessage(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Field_FormatMessage(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_Som_Message(hValue, bSetting, XFA_SOM_FormatMessage);
+ Script_Som_Message(pValue, bSetting, XFA_SOM_FormatMessage);
}
-void CXFA_Node::Script_Field_FormattedValue(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Field_FormattedValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
@@ -2072,15 +2072,15 @@ void CXFA_Node::Script_Field_FormattedValue(FXJSE_HVALUE hValue,
CFX_WideString wsValue;
if (bSetting) {
CFX_ByteString bsValue;
- FXJSE_Value_ToUTF8String(hValue, bsValue);
+ FXJSE_Value_ToUTF8String(pValue, bsValue);
wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC());
pWidgetData->SetValue(wsValue, XFA_VALUEPICTURE_Display);
} else {
pWidgetData->GetValue(wsValue, XFA_VALUEPICTURE_Display);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsValue).AsStringC());
}
}
-void CXFA_Node::Script_Som_Mandatory(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Som_Mandatory(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
@@ -2091,7 +2091,7 @@ void CXFA_Node::Script_Som_Mandatory(FXJSE_HVALUE hValue,
CFX_WideString wsValue;
if (bSetting) {
CFX_ByteString bsValue;
- FXJSE_Value_ToUTF8String(hValue, bsValue);
+ FXJSE_Value_ToUTF8String(pValue, bsValue);
wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC());
validate.SetNullTest(wsValue);
} else {
@@ -2101,24 +2101,24 @@ void CXFA_Node::Script_Som_Mandatory(FXJSE_HVALUE hValue,
if (pInfo) {
wsValue = pInfo->pName;
}
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsValue).AsStringC());
}
}
-void CXFA_Node::Script_Som_MandatoryMessage(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Som_MandatoryMessage(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_Som_Message(hValue, bSetting, XFA_SOM_MandatoryMessage);
+ Script_Som_Message(pValue, bSetting, XFA_SOM_MandatoryMessage);
}
-void CXFA_Node::Script_Field_ParentSubform(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Field_ParentSubform(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
} else {
- FXJSE_Value_SetNull(hValue);
+ FXJSE_Value_SetNull(pValue);
}
}
-void CXFA_Node::Script_Field_SelectedIndex(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Field_SelectedIndex(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
@@ -2126,14 +2126,14 @@ void CXFA_Node::Script_Field_SelectedIndex(FXJSE_HVALUE hValue,
return;
}
if (bSetting) {
- int32_t iIndex = FXJSE_Value_ToInteger(hValue);
+ int32_t iIndex = FXJSE_Value_ToInteger(pValue);
if (iIndex == -1) {
pWidgetData->ClearAllSelections();
return;
}
pWidgetData->SetItemState(iIndex, TRUE, TRUE, TRUE);
} else {
- FXJSE_Value_SetInteger(hValue, pWidgetData->GetSelectedItem());
+ FXJSE_Value_SetInteger(pValue, pWidgetData->GetSelectedItem());
}
}
void CXFA_Node::Script_Field_ClearItems(CFXJSE_Arguments* pArguments) {
@@ -2183,9 +2183,9 @@ void CXFA_Node::Script_Field_DeleteItem(CFXJSE_Arguments* pArguments) {
}
int32_t iIndex = pArguments->GetInt32(0);
FX_BOOL bValue = pWidgetData->DeleteItem(iIndex, TRUE, TRUE);
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetBoolean(hValue, bValue);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetBoolean(pValue, bValue);
}
}
void CXFA_Node::Script_Field_GetSaveItem(CFXJSE_Arguments* pArguments) {
@@ -2228,9 +2228,9 @@ void CXFA_Node::Script_Field_BoundItem(CFXJSE_Arguments* pArguments) {
CFX_WideString wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC());
CFX_WideString wsBoundValue;
pWidgetData->GetItemValue(wsValue.AsStringC(), wsBoundValue);
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsBoundValue).AsStringC());
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsBoundValue).AsStringC());
}
}
void CXFA_Node::Script_Field_GetItemState(CFXJSE_Arguments* pArguments) {
@@ -2246,9 +2246,9 @@ void CXFA_Node::Script_Field_GetItemState(CFXJSE_Arguments* pArguments) {
}
int32_t iIndex = pArguments->GetInt32(0);
FX_BOOL bValue = pWidgetData->GetItemState(iIndex);
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetBoolean(hValue, bValue);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetBoolean(pValue, bValue);
}
}
void CXFA_Node::Script_Field_ExecCalculate(CFXJSE_Arguments* pArguments) {
@@ -2351,7 +2351,7 @@ void CXFA_Node::Script_Field_ExecValidate(CFXJSE_Arguments* pArguments) {
L"execValidate");
}
}
-void CXFA_Node::Script_ExclGroup_ErrorText(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_ExclGroup_ErrorText(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
@@ -2359,7 +2359,7 @@ void CXFA_Node::Script_ExclGroup_ErrorText(FXJSE_HVALUE hValue,
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
}
}
-void CXFA_Node::Script_ExclGroup_DefaultAndRawValue(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_ExclGroup_DefaultAndRawValue(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
@@ -2368,20 +2368,20 @@ void CXFA_Node::Script_ExclGroup_DefaultAndRawValue(FXJSE_HVALUE hValue,
}
if (bSetting) {
CFX_ByteString bsValue;
- FXJSE_Value_ToUTF8String(hValue, bsValue);
+ FXJSE_Value_ToUTF8String(pValue, bsValue);
pWidgetData->SetSelectedMemberByValue(
CFX_WideString::FromUTF8(bsValue.AsStringC()).AsStringC(), TRUE, TRUE);
} else {
CFX_WideString wsValue = GetScriptContent(TRUE);
XFA_VERSION curVersion = GetDocument()->GetCurVersionMode();
if (wsValue.IsEmpty() && curVersion >= XFA_VERSION_300) {
- FXJSE_Value_SetNull(hValue);
+ FXJSE_Value_SetNull(pValue);
} else {
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsValue).AsStringC());
}
}
}
-void CXFA_Node::Script_ExclGroup_Transient(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_ExclGroup_Transient(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CXFA_Node::Script_ExclGroup_ExecEvent(CFXJSE_Arguments* pArguments) {
@@ -2500,11 +2500,11 @@ static CXFA_Node* XFA_ScriptInstanceManager_GetItem(CXFA_Node* pInstMgrNode,
}
return NULL;
}
-void CXFA_Node::Script_Som_InstanceIndex(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Som_InstanceIndex(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
- int32_t iTo = FXJSE_Value_ToInteger(hValue);
+ int32_t iTo = FXJSE_Value_ToInteger(pValue);
int32_t iFrom = Subform_and_SubformSet_InstanceIndex();
CXFA_Node* pManagerNode = NULL;
for (CXFA_Node* pNode = GetNodeItem(XFA_NODEITEM_PrevSibling); pNode;
@@ -2532,10 +2532,10 @@ void CXFA_Node::Script_Som_InstanceIndex(FXJSE_HVALUE hValue,
}
}
} else {
- FXJSE_Value_SetInteger(hValue, Subform_and_SubformSet_InstanceIndex());
+ FXJSE_Value_SetInteger(pValue, Subform_and_SubformSet_InstanceIndex());
}
}
-void CXFA_Node::Script_Subform_InstanceManager(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Subform_InstanceManager(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
@@ -2554,28 +2554,28 @@ void CXFA_Node::Script_Subform_InstanceManager(FXJSE_HVALUE hValue,
}
if (pInstanceMgr) {
FXJSE_Value_Set(
- hValue,
+ pValue,
m_pDocument->GetScriptContext()->GetJSValueFromMap(pInstanceMgr));
} else {
- FXJSE_Value_SetNull(hValue);
+ FXJSE_Value_SetNull(pValue);
}
} else {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
}
}
-void CXFA_Node::Script_Subform_Locale(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Subform_Locale(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
CFX_ByteString bsLocaleName;
- FXJSE_Value_ToUTF8String(hValue, bsLocaleName);
+ FXJSE_Value_ToUTF8String(pValue, bsLocaleName);
SetCData(XFA_ATTRIBUTE_Locale,
CFX_WideString::FromUTF8(bsLocaleName.AsStringC()), true, TRUE);
} else {
CFX_WideString wsLocaleName;
GetLocaleName(wsLocaleName);
FXJSE_Value_SetUTF8String(
- hValue, FX_UTF8Encode(wsLocaleName.c_str(), wsLocaleName.GetLength())
+ pValue, FX_UTF8Encode(wsLocaleName.c_str(), wsLocaleName.GetLength())
.AsStringC());
}
}
@@ -2777,7 +2777,7 @@ void CXFA_Node::Script_Manifest_Evaluate(CFXJSE_Arguments* pArguments) {
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"evaluate");
}
}
-void CXFA_Node::Script_InstanceManager_Max(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_InstanceManager_Max(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
@@ -2785,9 +2785,9 @@ void CXFA_Node::Script_InstanceManager_Max(FXJSE_HVALUE hValue,
return;
}
CXFA_Occur nodeOccur(GetOccurNode());
- FXJSE_Value_SetInteger(hValue, nodeOccur.GetMax());
+ FXJSE_Value_SetInteger(pValue, nodeOccur.GetMax());
}
-void CXFA_Node::Script_InstanceManager_Min(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_InstanceManager_Min(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
@@ -2795,7 +2795,7 @@ void CXFA_Node::Script_InstanceManager_Min(FXJSE_HVALUE hValue,
return;
}
CXFA_Occur nodeOccur(GetOccurNode());
- FXJSE_Value_SetInteger(hValue, nodeOccur.GetMin());
+ FXJSE_Value_SetInteger(pValue, nodeOccur.GetMin());
}
static int32_t XFA_ScriptInstanceManager_GetCount(CXFA_Node* pInstMgrNode) {
ASSERT(pInstMgrNode);
@@ -3070,14 +3070,14 @@ static CXFA_Node* XFA_ScriptInstanceManager_CreateInstance(
}
return pInstance;
}
-void CXFA_Node::Script_InstanceManager_Count(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_InstanceManager_Count(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
- int32_t iDesired = FXJSE_Value_ToInteger(hValue);
+ int32_t iDesired = FXJSE_Value_ToInteger(pValue);
InstanceManager_SetInstances(iDesired);
} else {
- FXJSE_Value_SetInteger(hValue, XFA_ScriptInstanceManager_GetCount(this));
+ FXJSE_Value_SetInteger(pValue, XFA_ScriptInstanceManager_GetCount(this));
}
}
void CXFA_Node::Script_InstanceManager_MoveInstance(
@@ -3314,26 +3314,26 @@ int32_t CXFA_Node::InstanceManager_MoveInstance(int32_t iTo, int32_t iFrom) {
}
return 0;
}
-void CXFA_Node::Script_Occur_Max(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Occur_Max(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_Occur occur(this);
if (bSetting) {
- int32_t iMax = FXJSE_Value_ToInteger(hValue);
+ int32_t iMax = FXJSE_Value_ToInteger(pValue);
occur.SetMax(iMax);
} else {
- FXJSE_Value_SetInteger(hValue, occur.GetMax());
+ FXJSE_Value_SetInteger(pValue, occur.GetMax());
}
}
-void CXFA_Node::Script_Occur_Min(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Occur_Min(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_Occur occur(this);
if (bSetting) {
- int32_t iMin = FXJSE_Value_ToInteger(hValue);
+ int32_t iMin = FXJSE_Value_ToInteger(pValue);
occur.SetMin(iMin);
} else {
- FXJSE_Value_SetInteger(hValue, occur.GetMin());
+ FXJSE_Value_SetInteger(pValue, occur.GetMin());
}
}
void CXFA_Node::Script_Desc_Metadata(CFXJSE_Arguments* pArguments) {
@@ -3436,19 +3436,19 @@ void CXFA_Node::Script_Form_ExecValidate(CFXJSE_Arguments* pArguments) {
L"execValidate");
}
}
-void CXFA_Node::Script_Form_Checksum(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Form_Checksum(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
CFX_ByteString bsChecksum;
- FXJSE_Value_ToUTF8String(hValue, bsChecksum);
+ FXJSE_Value_ToUTF8String(pValue, bsChecksum);
SetAttribute(XFA_ATTRIBUTE_Checksum,
CFX_WideString::FromUTF8(bsChecksum.AsStringC()).AsStringC());
} else {
CFX_WideString wsChecksum;
GetAttribute(XFA_ATTRIBUTE_Checksum, wsChecksum, FALSE);
FXJSE_Value_SetUTF8String(
- hValue,
+ pValue,
FX_UTF8Encode(wsChecksum.c_str(), wsChecksum.GetLength()).AsStringC());
}
}
@@ -3507,12 +3507,12 @@ void CXFA_Node::Script_Packet_RemoveAttribute(CFXJSE_Arguments* pArguments) {
L"removeAttribute");
}
}
-void CXFA_Node::Script_Packet_Content(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Packet_Content(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
CFX_ByteString bsNewContent;
- FXJSE_Value_ToUTF8String(hValue, bsNewContent);
+ FXJSE_Value_ToUTF8String(pValue, bsNewContent);
CFDE_XMLNode* pXMLNode = GetXMLMappingNode();
if (pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element) {
CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode);
@@ -3527,7 +3527,7 @@ void CXFA_Node::Script_Packet_Content(FXJSE_HVALUE hValue,
pXMLElement->GetTextData(wsTextData);
}
FXJSE_Value_SetUTF8String(
- hValue,
+ pValue,
FX_UTF8Encode(wsTextData.c_str(), wsTextData.GetLength()).AsStringC());
}
}
@@ -3651,38 +3651,38 @@ void CXFA_Node::Script_Source_HasDataChanged(CFXJSE_Arguments* pArguments) {
L"hasDataChanged");
}
}
-void CXFA_Node::Script_Source_Db(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Source_Db(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {}
-void CXFA_Node::Script_Xfa_This(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Xfa_This(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
CXFA_Object* pThis = m_pDocument->GetScriptContext()->GetThisObject();
ASSERT(pThis);
- FXJSE_Value_Set(hValue,
+ FXJSE_Value_Set(pValue,
m_pDocument->GetScriptContext()->GetJSValueFromMap(pThis));
}
}
-void CXFA_Node::Script_Handler_Version(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Handler_Version(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {}
-void CXFA_Node::Script_SubmitFormat_Mode(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_SubmitFormat_Mode(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {}
-void CXFA_Node::Script_Extras_Type(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Extras_Type(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {}
-void CXFA_Node::Script_Script_Stateless(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Script_Stateless(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
return;
}
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(FX_WSTRC(L"0")).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(FX_WSTRC(L"0")).AsStringC());
}
-void CXFA_Node::Script_Encrypt_Format(FXJSE_HVALUE hValue,
+void CXFA_Node::Script_Encrypt_Format(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {}
enum XFA_KEYTYPE {
@@ -5270,11 +5270,11 @@ void CXFA_NodeList::Script_TreelistClass_NamedItem(
ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"namedItem");
}
}
-void CXFA_NodeList::Script_ListClass_Length(FXJSE_HVALUE hValue,
+void CXFA_NodeList::Script_ListClass_Length(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
- FXJSE_Value_SetInteger(hValue, GetLength());
+ FXJSE_Value_SetInteger(pValue, GetLength());
} else {
ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
}
diff --git a/xfa/fxfa/parser/xfa_script.h b/xfa/fxfa/parser/xfa_script.h
index 04cc5b9a69..42d3ddfa47 100644
--- a/xfa/fxfa/parser/xfa_script.h
+++ b/xfa/fxfa/parser/xfa_script.h
@@ -35,38 +35,43 @@ enum XFA_RESOVENODE_RSTYPE {
XFA_RESOVENODE_RSTYPE_ExistNodes,
};
-class CXFA_HVALUEArray : public CFX_ArrayTemplate<FXJSE_HVALUE> {
+class CXFA_ValueArray : public CFX_ArrayTemplate<CFXJSE_Value*> {
public:
- CXFA_HVALUEArray(v8::Isolate* pIsolate) : m_pIsolate(pIsolate) {}
- ~CXFA_HVALUEArray() {
+ CXFA_ValueArray(v8::Isolate* pIsolate) : m_pIsolate(pIsolate) {}
+
+ ~CXFA_ValueArray() {
for (int32_t i = 0; i < GetSize(); i++) {
FXJSE_Value_Release(GetAt(i));
}
}
+
void GetAttributeObject(CXFA_ObjArray& objArray) {
for (int32_t i = 0; i < GetSize(); i++) {
CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(GetAt(i), NULL);
objArray.Add(pObject);
}
}
+
v8::Isolate* m_pIsolate;
};
struct XFA_RESOLVENODE_RS {
XFA_RESOLVENODE_RS()
: dwFlags(XFA_RESOVENODE_RSTYPE_Nodes), pScriptAttribute(NULL) {}
+
~XFA_RESOLVENODE_RS() { nodes.RemoveAll(); }
- int32_t GetAttributeResult(CXFA_HVALUEArray& hValueArray) const {
+
+ int32_t GetAttributeResult(CXFA_ValueArray& valueArray) const {
if (pScriptAttribute && pScriptAttribute->eValueType == XFA_SCRIPT_Object) {
- v8::Isolate* pIsolate = hValueArray.m_pIsolate;
+ v8::Isolate* pIsolate = valueArray.m_pIsolate;
for (int32_t i = 0; i < nodes.GetSize(); i++) {
- FXJSE_HVALUE hValue = FXJSE_Value_Create(pIsolate);
+ CFXJSE_Value* pValue = FXJSE_Value_Create(pIsolate);
(nodes[i]->*(pScriptAttribute->lpfnCallback))(
- hValue, FALSE, (XFA_ATTRIBUTE)pScriptAttribute->eAttribute);
- hValueArray.Add(hValue);
+ pValue, FALSE, (XFA_ATTRIBUTE)pScriptAttribute->eAttribute);
+ valueArray.Add(pValue);
}
}
- return hValueArray.GetSize();
+ return valueArray.GetSize();
}
CXFA_ObjArray nodes;
diff --git a/xfa/fxfa/parser/xfa_script_datawindow.cpp b/xfa/fxfa/parser/xfa_script_datawindow.cpp
index 8ce5061c03..f06c3110b9 100644
--- a/xfa/fxfa/parser/xfa_script_datawindow.cpp
+++ b/xfa/fxfa/parser/xfa_script_datawindow.cpp
@@ -30,18 +30,18 @@ void CScript_DataWindow::Script_DataWindow_GotoRecord(
void CScript_DataWindow::Script_DataWindow_IsRecordGroup(
CFXJSE_Arguments* pArguments) {}
void CScript_DataWindow::Script_DataWindow_RecordsBefore(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CScript_DataWindow::Script_DataWindow_CurrentRecordNumber(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CScript_DataWindow::Script_DataWindow_RecordsAfter(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {}
-void CScript_DataWindow::Script_DataWindow_IsDefined(FXJSE_HVALUE hValue,
+void CScript_DataWindow::Script_DataWindow_IsDefined(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
}
diff --git a/xfa/fxfa/parser/xfa_script_datawindow.h b/xfa/fxfa/parser/xfa_script_datawindow.h
index 515bb99b2e..55d12f8441 100644
--- a/xfa/fxfa/parser/xfa_script_datawindow.h
+++ b/xfa/fxfa/parser/xfa_script_datawindow.h
@@ -18,16 +18,16 @@ class CScript_DataWindow : public CXFA_OrdinaryObject {
void Script_DataWindow_Record(CFXJSE_Arguments* pArguments);
void Script_DataWindow_GotoRecord(CFXJSE_Arguments* pArguments);
void Script_DataWindow_IsRecordGroup(CFXJSE_Arguments* pArguments);
- void Script_DataWindow_RecordsBefore(FXJSE_HVALUE hValue,
+ void Script_DataWindow_RecordsBefore(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_DataWindow_CurrentRecordNumber(FXJSE_HVALUE hValue,
+ void Script_DataWindow_CurrentRecordNumber(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_DataWindow_RecordsAfter(FXJSE_HVALUE hValue,
+ void Script_DataWindow_RecordsAfter(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_DataWindow_IsDefined(FXJSE_HVALUE hValue,
+ void Script_DataWindow_IsDefined(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
};
diff --git a/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
index 335df6a32e..c5d25bc246 100644
--- a/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp
@@ -25,37 +25,37 @@ CScript_EventPseudoModel::CScript_EventPseudoModel(CXFA_Document* pDocument)
m_uScriptHash = XFA_HASHCODE_Event;
}
CScript_EventPseudoModel::~CScript_EventPseudoModel() {}
-void Script_EventPseudoModel_StringProperty(FXJSE_HVALUE hValue,
+void Script_EventPseudoModel_StringProperty(CFXJSE_Value* pValue,
CFX_WideString& wsValue,
FX_BOOL bSetting) {
if (bSetting) {
CFX_ByteString bsValue;
- FXJSE_Value_ToUTF8String(hValue, bsValue);
+ FXJSE_Value_ToUTF8String(pValue, bsValue);
wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC());
} else {
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsValue).AsStringC());
}
}
-void Script_EventPseudoModel_InterProperty(FXJSE_HVALUE hValue,
+void Script_EventPseudoModel_InterProperty(CFXJSE_Value* pValue,
int32_t& iValue,
FX_BOOL bSetting) {
if (bSetting) {
- iValue = FXJSE_Value_ToInteger(hValue);
+ iValue = FXJSE_Value_ToInteger(pValue);
} else {
- FXJSE_Value_SetInteger(hValue, iValue);
+ FXJSE_Value_SetInteger(pValue, iValue);
}
}
-void Script_EventPseudoModel_BooleanProperty(FXJSE_HVALUE hValue,
+void Script_EventPseudoModel_BooleanProperty(CFXJSE_Value* pValue,
FX_BOOL& bValue,
FX_BOOL bSetting) {
if (bSetting)
- bValue = FXJSE_Value_ToBoolean(hValue);
+ bValue = FXJSE_Value_ToBoolean(pValue);
else
- FXJSE_Value_SetBoolean(hValue, bValue);
+ FXJSE_Value_SetBoolean(pValue, bValue);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_Property(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
XFA_Event dwFlag,
FX_BOOL bSetting) {
CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
@@ -69,67 +69,67 @@ void CScript_EventPseudoModel::Script_EventPseudoModel_Property(
switch (dwFlag) {
case XFA_Event::CancelAction:
Script_EventPseudoModel_BooleanProperty(
- hValue, pEventParam->m_bCancelAction, bSetting);
+ pValue, pEventParam->m_bCancelAction, bSetting);
break;
case XFA_Event::Change:
- Script_EventPseudoModel_StringProperty(hValue, pEventParam->m_wsChange,
+ Script_EventPseudoModel_StringProperty(pValue, pEventParam->m_wsChange,
bSetting);
break;
case XFA_Event::CommitKey:
- Script_EventPseudoModel_InterProperty(hValue, pEventParam->m_iCommitKey,
+ Script_EventPseudoModel_InterProperty(pValue, pEventParam->m_iCommitKey,
bSetting);
break;
case XFA_Event::FullText:
- Script_EventPseudoModel_StringProperty(hValue, pEventParam->m_wsFullText,
+ Script_EventPseudoModel_StringProperty(pValue, pEventParam->m_wsFullText,
bSetting);
break;
case XFA_Event::Keydown:
- Script_EventPseudoModel_BooleanProperty(hValue, pEventParam->m_bKeyDown,
+ Script_EventPseudoModel_BooleanProperty(pValue, pEventParam->m_bKeyDown,
bSetting);
break;
case XFA_Event::Modifier:
- Script_EventPseudoModel_BooleanProperty(hValue, pEventParam->m_bModifier,
+ Script_EventPseudoModel_BooleanProperty(pValue, pEventParam->m_bModifier,
bSetting);
break;
case XFA_Event::NewContentType:
Script_EventPseudoModel_StringProperty(
- hValue, pEventParam->m_wsNewContentType, bSetting);
+ pValue, pEventParam->m_wsNewContentType, bSetting);
break;
case XFA_Event::NewText:
- Script_EventPseudoModel_StringProperty(hValue, pEventParam->m_wsNewText,
+ Script_EventPseudoModel_StringProperty(pValue, pEventParam->m_wsNewText,
bSetting);
break;
case XFA_Event::PreviousContentType:
Script_EventPseudoModel_StringProperty(
- hValue, pEventParam->m_wsPrevContentType, bSetting);
+ pValue, pEventParam->m_wsPrevContentType, bSetting);
break;
case XFA_Event::PreviousText:
- Script_EventPseudoModel_StringProperty(hValue, pEventParam->m_wsPrevText,
+ Script_EventPseudoModel_StringProperty(pValue, pEventParam->m_wsPrevText,
bSetting);
break;
case XFA_Event::Reenter:
- Script_EventPseudoModel_BooleanProperty(hValue, pEventParam->m_bReenter,
+ Script_EventPseudoModel_BooleanProperty(pValue, pEventParam->m_bReenter,
bSetting);
break;
case XFA_Event::SelectionEnd:
- Script_EventPseudoModel_InterProperty(hValue, pEventParam->m_iSelEnd,
+ Script_EventPseudoModel_InterProperty(pValue, pEventParam->m_iSelEnd,
bSetting);
break;
case XFA_Event::SelectionStart:
- Script_EventPseudoModel_InterProperty(hValue, pEventParam->m_iSelStart,
+ Script_EventPseudoModel_InterProperty(pValue, pEventParam->m_iSelStart,
bSetting);
break;
case XFA_Event::Shift:
- Script_EventPseudoModel_BooleanProperty(hValue, pEventParam->m_bShift,
+ Script_EventPseudoModel_BooleanProperty(pValue, pEventParam->m_bShift,
bSetting);
break;
case XFA_Event::SoapFaultCode:
Script_EventPseudoModel_StringProperty(
- hValue, pEventParam->m_wsSoapFaultCode, bSetting);
+ pValue, pEventParam->m_wsSoapFaultCode, bSetting);
break;
case XFA_Event::SoapFaultString:
Script_EventPseudoModel_StringProperty(
- hValue, pEventParam->m_wsSoapFaultString, bSetting);
+ pValue, pEventParam->m_wsSoapFaultString, bSetting);
break;
case XFA_Event::Target:
break;
@@ -138,102 +138,102 @@ void CScript_EventPseudoModel::Script_EventPseudoModel_Property(
}
}
void CScript_EventPseudoModel::Script_EventPseudoModel_Change(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::Change, bSetting);
+ Script_EventPseudoModel_Property(pValue, XFA_Event::Change, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_CommitKey(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::CommitKey, bSetting);
+ Script_EventPseudoModel_Property(pValue, XFA_Event::CommitKey, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_FullText(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::FullText, bSetting);
+ Script_EventPseudoModel_Property(pValue, XFA_Event::FullText, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_KeyDown(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::Keydown, bSetting);
+ Script_EventPseudoModel_Property(pValue, XFA_Event::Keydown, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_Modifier(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::Modifier, bSetting);
+ Script_EventPseudoModel_Property(pValue, XFA_Event::Modifier, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_NewContentType(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::NewContentType, bSetting);
+ Script_EventPseudoModel_Property(pValue, XFA_Event::NewContentType, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_NewText(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::NewText, bSetting);
+ Script_EventPseudoModel_Property(pValue, XFA_Event::NewText, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_PrevContentType(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::PreviousContentType,
+ Script_EventPseudoModel_Property(pValue, XFA_Event::PreviousContentType,
bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_PrevText(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::PreviousText, bSetting);
+ Script_EventPseudoModel_Property(pValue, XFA_Event::PreviousText, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_Reenter(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::Reenter, bSetting);
+ Script_EventPseudoModel_Property(pValue, XFA_Event::Reenter, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_SelEnd(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::SelectionEnd, bSetting);
+ Script_EventPseudoModel_Property(pValue, XFA_Event::SelectionEnd, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_SelStart(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::SelectionStart, bSetting);
+ Script_EventPseudoModel_Property(pValue, XFA_Event::SelectionStart, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_Shift(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::Shift, bSetting);
+ Script_EventPseudoModel_Property(pValue, XFA_Event::Shift, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_SoapFaultCode(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::SoapFaultCode, bSetting);
+ Script_EventPseudoModel_Property(pValue, XFA_Event::SoapFaultCode, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_SoapFaultString(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::SoapFaultString,
+ Script_EventPseudoModel_Property(pValue, XFA_Event::SoapFaultString,
bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_Target(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
- Script_EventPseudoModel_Property(hValue, XFA_Event::Target, bSetting);
+ Script_EventPseudoModel_Property(pValue, XFA_Event::Target, bSetting);
}
void CScript_EventPseudoModel::Script_EventPseudoModel_Emit(
CFXJSE_Arguments* pArguments) {
diff --git a/xfa/fxfa/parser/xfa_script_eventpseudomodel.h b/xfa/fxfa/parser/xfa_script_eventpseudomodel.h
index d840329b4c..f7649eb643 100644
--- a/xfa/fxfa/parser/xfa_script_eventpseudomodel.h
+++ b/xfa/fxfa/parser/xfa_script_eventpseudomodel.h
@@ -35,52 +35,52 @@ class CScript_EventPseudoModel : public CXFA_OrdinaryObject {
explicit CScript_EventPseudoModel(CXFA_Document* pDocument);
virtual ~CScript_EventPseudoModel();
- void Script_EventPseudoModel_Change(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_Change(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_EventPseudoModel_CommitKey(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_CommitKey(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_EventPseudoModel_FullText(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_FullText(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_EventPseudoModel_KeyDown(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_KeyDown(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_EventPseudoModel_Modifier(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_Modifier(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_EventPseudoModel_NewContentType(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_NewContentType(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_EventPseudoModel_NewText(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_NewText(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_EventPseudoModel_PrevContentType(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_PrevContentType(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_EventPseudoModel_PrevText(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_PrevText(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_EventPseudoModel_Reenter(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_Reenter(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_EventPseudoModel_SelEnd(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_SelEnd(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_EventPseudoModel_SelStart(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_SelStart(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_EventPseudoModel_Shift(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_Shift(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_EventPseudoModel_SoapFaultCode(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_SoapFaultCode(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_EventPseudoModel_SoapFaultString(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_SoapFaultString(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_EventPseudoModel_Target(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_Target(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
@@ -88,7 +88,7 @@ class CScript_EventPseudoModel : public CXFA_OrdinaryObject {
void Script_EventPseudoModel_Reset(CFXJSE_Arguments* pArguments);
protected:
- void Script_EventPseudoModel_Property(FXJSE_HVALUE hValue,
+ void Script_EventPseudoModel_Property(CFXJSE_Value* pValue,
XFA_Event dwFlag,
FX_BOOL bSetting);
};
diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
index 94fa8db96c..2bff14c77f 100644
--- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
@@ -26,15 +26,15 @@ CScript_HostPseudoModel::CScript_HostPseudoModel(CXFA_Document* pDocument)
}
CScript_HostPseudoModel::~CScript_HostPseudoModel() {}
void CScript_HostPseudoModel::Script_HostPseudoModel_LoadString(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
CXFA_FFNotify* pNotify,
uint32_t dwFlag) {
CFX_WideString wsValue;
pNotify->GetAppProvider()->LoadString(dwFlag, wsValue);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsValue).AsStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_AppType(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify();
@@ -47,10 +47,10 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_AppType(
}
CFX_WideString wsAppType;
pNotify->GetAppProvider()->GetAppType(wsAppType);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppType).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsAppType).AsStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitAppType(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify();
@@ -63,10 +63,10 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitAppType(
}
CFX_WideString wsAppType;
pNotify->GetAppProvider()->GetFoxitAppType(wsAppType);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppType).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsAppType).AsStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_CalculationsEnabled(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify();
@@ -76,14 +76,14 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_CalculationsEnabled(
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
if (bSetting) {
pNotify->GetDocProvider()->SetCalculationsEnabled(
- hDoc, FXJSE_Value_ToBoolean(hValue));
+ hDoc, FXJSE_Value_ToBoolean(pValue));
return;
}
FX_BOOL bEnabled = pNotify->GetDocProvider()->IsCalculationsEnabled(hDoc);
- FXJSE_Value_SetBoolean(hValue, bEnabled);
+ FXJSE_Value_SetBoolean(pValue, bEnabled);
}
void CScript_HostPseudoModel::Script_HostPseudoModel_CurrentPage(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify();
@@ -93,14 +93,14 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_CurrentPage(
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
if (bSetting) {
pNotify->GetDocProvider()->SetCurrentPage(hDoc,
- FXJSE_Value_ToInteger(hValue));
+ FXJSE_Value_ToInteger(pValue));
return;
}
int32_t iCurrentPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc);
- FXJSE_Value_SetInteger(hValue, iCurrentPage);
+ FXJSE_Value_SetInteger(pValue, iCurrentPage);
}
void CScript_HostPseudoModel::Script_HostPseudoModel_Language(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify();
@@ -113,10 +113,10 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Language(
}
CFX_WideString wsLanguage;
pNotify->GetAppProvider()->GetLanguage(wsLanguage);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsLanguage).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsLanguage).AsStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_NumPages(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify();
@@ -129,10 +129,10 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_NumPages(
return;
}
int32_t iNumPages = pNotify->GetDocProvider()->CountPages(hDoc);
- FXJSE_Value_SetInteger(hValue, iNumPages);
+ FXJSE_Value_SetInteger(pValue, iNumPages);
}
void CScript_HostPseudoModel::Script_HostPseudoModel_Platform(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify();
@@ -145,10 +145,10 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Platform(
}
CFX_WideString wsPlatform;
pNotify->GetAppProvider()->GetPlatform(wsPlatform);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsPlatform).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsPlatform).AsStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_Title(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!m_pDocument->GetScriptContext()->IsRunAtClient()) {
@@ -161,17 +161,17 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Title(
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
if (bSetting) {
CFX_ByteString bsValue;
- FXJSE_Value_ToUTF8String(hValue, bsValue);
+ FXJSE_Value_ToUTF8String(pValue, bsValue);
pNotify->GetDocProvider()->SetTitle(
hDoc, CFX_WideString::FromUTF8(bsValue.AsStringC()));
return;
}
CFX_WideString wsTitle;
pNotify->GetDocProvider()->GetTitle(hDoc, wsTitle);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsTitle).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsTitle).AsStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_ValidationsEnabled(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify();
@@ -181,14 +181,14 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ValidationsEnabled(
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
if (bSetting) {
pNotify->GetDocProvider()->SetValidationsEnabled(
- hDoc, FXJSE_Value_ToBoolean(hValue));
+ hDoc, FXJSE_Value_ToBoolean(pValue));
return;
}
FX_BOOL bEnabled = pNotify->GetDocProvider()->IsValidationsEnabled(hDoc);
- FXJSE_Value_SetBoolean(hValue, bEnabled);
+ FXJSE_Value_SetBoolean(pValue, bEnabled);
}
void CScript_HostPseudoModel::Script_HostPseudoModel_Variation(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!m_pDocument->GetScriptContext()->IsRunAtClient()) {
@@ -204,10 +204,10 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Variation(
}
CFX_WideString wsVariation;
pNotify->GetAppProvider()->GetVariation(wsVariation);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVariation).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsVariation).AsStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_Version(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify();
@@ -220,10 +220,10 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Version(
}
CFX_WideString wsVersion;
pNotify->GetAppProvider()->GetVersion(wsVersion);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVersion).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsVersion).AsStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitVersion(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify();
@@ -236,10 +236,10 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitVersion(
}
CFX_WideString wsVersion;
pNotify->GetAppProvider()->GetFoxitVersion(wsVersion);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsVersion).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsVersion).AsStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_Name(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify();
@@ -252,10 +252,10 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Name(
}
CFX_WideString wsAppName;
pNotify->GetAppProvider()->GetAppName(wsAppName);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAppName).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsAppName).AsStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitName(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify();
@@ -268,7 +268,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitName(
}
CFX_WideString wsFoxitAppName;
pNotify->GetAppProvider()->GetFoxitAppName(wsFoxitAppName);
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsFoxitAppName).AsStringC());
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsFoxitAppName).AsStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_GotoURL(
CFXJSE_Arguments* pArguments) {
@@ -308,22 +308,22 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(
}
CXFA_Node* pNode = NULL;
if (iLength >= 1) {
- FXJSE_HVALUE hValue = pArguments->GetValue(0);
- if (FXJSE_Value_IsObject(hValue)) {
- pNode = static_cast<CXFA_Node*>(FXJSE_Value_ToObject(hValue, nullptr));
- } else if (FXJSE_Value_IsUTF8String(hValue)) {
+ CFXJSE_Value* pValue = pArguments->GetValue(0);
+ if (FXJSE_Value_IsObject(pValue)) {
+ pNode = static_cast<CXFA_Node*>(FXJSE_Value_ToObject(pValue, nullptr));
+ } else if (FXJSE_Value_IsUTF8String(pValue)) {
CFX_ByteString bsString;
- FXJSE_Value_ToUTF8String(hValue, bsString);
+ FXJSE_Value_ToUTF8String(pValue, bsString);
CFX_WideString wsExpression =
CFX_WideString::FromUTF8(bsString.AsStringC());
CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
if (!pScriptContext) {
- FXJSE_Value_Release(hValue);
+ FXJSE_Value_Release(pValue);
return;
}
CXFA_Object* pObject = pScriptContext->GetThisObject();
if (!pObject) {
- FXJSE_Value_Release(hValue);
+ FXJSE_Value_Release(pValue);
return;
}
uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent |
@@ -332,12 +332,12 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(
int32_t iRet = pScriptContext->ResolveObjects(
pObject, wsExpression.AsStringC(), resoveNodeRS, dwFlag);
if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode()) {
- FXJSE_Value_Release(hValue);
+ FXJSE_Value_Release(pValue);
return;
}
pNode = resoveNodeRS.nodes[0]->AsNode();
}
- FXJSE_Value_Release(hValue);
+ FXJSE_Value_Release(pValue);
}
CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout();
if (!pDocLayout) {
@@ -383,9 +383,9 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Response(
}
CFX_WideString wsAnswer = pNotify->GetAppProvider()->Response(
wsQuestion, wsTitle, wsDefaultAnswer, bMark);
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAnswer).AsStringC());
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsAnswer).AsStringC());
}
}
void CScript_HostPseudoModel::Script_HostPseudoModel_DocumentInBatch(
@@ -395,9 +395,9 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_DocumentInBatch(
return;
}
int32_t iCur = pNotify->GetAppProvider()->GetCurDocumentInBatch();
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetInteger(hValue, iCur);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetInteger(pValue, iCur);
}
}
static int32_t XFA_FilterName(const CFX_WideStringC& wsExpression,
@@ -509,22 +509,22 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus(
}
CXFA_Node* pNode = NULL;
if (iLength >= 1) {
- FXJSE_HVALUE hValue = pArguments->GetValue(0);
- if (FXJSE_Value_IsObject(hValue)) {
- pNode = static_cast<CXFA_Node*>(FXJSE_Value_ToObject(hValue, NULL));
- } else if (FXJSE_Value_IsUTF8String(hValue)) {
+ CFXJSE_Value* pValue = pArguments->GetValue(0);
+ if (FXJSE_Value_IsObject(pValue)) {
+ pNode = static_cast<CXFA_Node*>(FXJSE_Value_ToObject(pValue, nullptr));
+ } else if (FXJSE_Value_IsUTF8String(pValue)) {
CFX_ByteString bsString;
- FXJSE_Value_ToUTF8String(hValue, bsString);
+ FXJSE_Value_ToUTF8String(pValue, bsString);
CFX_WideString wsExpression =
CFX_WideString::FromUTF8(bsString.AsStringC());
CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
if (!pScriptContext) {
- FXJSE_Value_Release(hValue);
+ FXJSE_Value_Release(pValue);
return;
}
CXFA_Object* pObject = pScriptContext->GetThisObject();
if (!pObject) {
- FXJSE_Value_Release(hValue);
+ FXJSE_Value_Release(pValue);
return;
}
uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent |
@@ -533,12 +533,12 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus(
int32_t iRet = pScriptContext->ResolveObjects(
pObject, wsExpression.AsStringC(), resoveNodeRS, dwFlag);
if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode()) {
- FXJSE_Value_Release(hValue);
+ FXJSE_Value_Release(pValue);
return;
}
pNode = resoveNodeRS.nodes[0]->AsNode();
}
- FXJSE_Value_Release(hValue);
+ FXJSE_Value_Release(pValue);
}
pNotify->SetFocusWidgetNode(pNode);
}
@@ -597,9 +597,9 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_MessageBox(
}
int32_t iValue = pNotify->GetAppProvider()->MsgBox(
wsMessage, bsTitle, dwMessageType, dwButtonType);
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetInteger(hValue, iValue);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetInteger(pValue, iValue);
}
}
FX_BOOL CScript_HostPseudoModel::Script_HostPseudoModel_ValidateArgsForMsg(
@@ -614,20 +614,20 @@ FX_BOOL CScript_HostPseudoModel::Script_HostPseudoModel_ValidateArgsForMsg(
XFA_SCRIPTLANGTYPE_Javascript) {
bIsJsType = TRUE;
}
- FXJSE_HVALUE hValueArg = pArguments->GetValue(iArgIndex);
- if (!FXJSE_Value_IsUTF8String(hValueArg) && bIsJsType) {
+ CFXJSE_Value* pValueArg = pArguments->GetValue(iArgIndex);
+ if (!FXJSE_Value_IsUTF8String(pValueArg) && bIsJsType) {
ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
- FXJSE_Value_Release(hValueArg);
+ FXJSE_Value_Release(pValueArg);
return FALSE;
}
- if (FXJSE_Value_IsNull(hValueArg)) {
+ if (FXJSE_Value_IsNull(pValueArg)) {
wsValue = FX_WSTRC(L"");
} else {
CFX_ByteString byMessage;
- FXJSE_Value_ToUTF8String(hValueArg, byMessage);
+ FXJSE_Value_ToUTF8String(pValueArg, byMessage);
wsValue = CFX_WideString::FromUTF8(byMessage.AsStringC());
}
- FXJSE_Value_Release(hValueArg);
+ FXJSE_Value_Release(pValueArg);
return TRUE;
}
void CScript_HostPseudoModel::Script_HostPseudoModel_DocumentCountInBatch(
@@ -637,9 +637,9 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_DocumentCountInBatch(
return;
}
int32_t iValue = pNotify->GetAppProvider()->GetDocumentCountInBatch();
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetInteger(hValue, iValue);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetInteger(pValue, iValue);
}
}
void CScript_HostPseudoModel::Script_HostPseudoModel_Print(
@@ -795,8 +795,8 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_CurrentDateTime(
return;
}
CFX_WideString wsDataTime = pNotify->GetCurrentDateTime();
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsDataTime).AsStringC());
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetUTF8String(pValue, FX_UTF8Encode(wsDataTime).AsStringC());
}
}
diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.h b/xfa/fxfa/parser/xfa_script_hostpseudomodel.h
index 1f456ffe7c..7ead797669 100644
--- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.h
+++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.h
@@ -16,46 +16,46 @@ class CScript_HostPseudoModel : public CXFA_OrdinaryObject {
CScript_HostPseudoModel(CXFA_Document* pDocument);
virtual ~CScript_HostPseudoModel();
- void Script_HostPseudoModel_AppType(FXJSE_HVALUE hValue,
+ void Script_HostPseudoModel_AppType(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_HostPseudoModel_FoxitAppType(FXJSE_HVALUE hValue,
+ void Script_HostPseudoModel_FoxitAppType(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_HostPseudoModel_CalculationsEnabled(FXJSE_HVALUE hValue,
+ void Script_HostPseudoModel_CalculationsEnabled(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_HostPseudoModel_CurrentPage(FXJSE_HVALUE hValue,
+ void Script_HostPseudoModel_CurrentPage(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_HostPseudoModel_Language(FXJSE_HVALUE hValue,
+ void Script_HostPseudoModel_Language(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_HostPseudoModel_NumPages(FXJSE_HVALUE hValue,
+ void Script_HostPseudoModel_NumPages(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_HostPseudoModel_Platform(FXJSE_HVALUE hValue,
+ void Script_HostPseudoModel_Platform(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_HostPseudoModel_Title(FXJSE_HVALUE hValue,
+ void Script_HostPseudoModel_Title(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_HostPseudoModel_ValidationsEnabled(FXJSE_HVALUE hValue,
+ void Script_HostPseudoModel_ValidationsEnabled(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_HostPseudoModel_Variation(FXJSE_HVALUE hValue,
+ void Script_HostPseudoModel_Variation(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_HostPseudoModel_Version(FXJSE_HVALUE hValue,
+ void Script_HostPseudoModel_Version(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_HostPseudoModel_FoxitVersion(FXJSE_HVALUE hValue,
+ void Script_HostPseudoModel_FoxitVersion(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_HostPseudoModel_Name(FXJSE_HVALUE hValue,
+ void Script_HostPseudoModel_Name(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
- void Script_HostPseudoModel_FoxitName(FXJSE_HVALUE hValue,
+ void Script_HostPseudoModel_FoxitName(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
@@ -78,7 +78,7 @@ class CScript_HostPseudoModel : public CXFA_OrdinaryObject {
void Script_HostPseudoModel_CurrentDateTime(CFXJSE_Arguments* pArguments);
protected:
- void Script_HostPseudoModel_LoadString(FXJSE_HVALUE hValue,
+ void Script_HostPseudoModel_LoadString(CFXJSE_Value* pValue,
CXFA_FFNotify* pNotify,
uint32_t dwFlag);
FX_BOOL Script_HostPseudoModel_ValidateArgsForMsg(
diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp
index c55a66cf9a..743719ca55 100644
--- a/xfa/fxfa/parser/xfa_script_imp.cpp
+++ b/xfa/fxfa/parser/xfa_script_imp.cpp
@@ -19,6 +19,7 @@
#include "xfa/fxfa/parser/xfa_script_resolveprocessor.h"
#include "xfa/fxfa/parser/xfa_utils.h"
#include "xfa/fxjse/cfxjse_arguments.h"
+#include "xfa/fxjse/value.h"
CXFA_ScriptContext::CXFA_ScriptContext(CXFA_Document* pDocument)
: m_pDocument(pDocument),
@@ -36,14 +37,14 @@ CXFA_ScriptContext::CXFA_ScriptContext(CXFA_Document* pDocument)
FXSYS_memset(&m_JsNormalClass, 0, sizeof(FXJSE_CLASS));
}
CXFA_ScriptContext::~CXFA_ScriptContext() {
- FX_POSITION ps = m_mapXFAToHValue.GetStartPosition();
+ FX_POSITION ps = m_mapXFAToValue.GetStartPosition();
while (ps) {
CXFA_Object* pXFAObj;
- FXJSE_HVALUE pValue;
- m_mapXFAToHValue.GetNextAssoc(ps, pXFAObj, pValue);
+ CFXJSE_Value* pValue;
+ m_mapXFAToValue.GetNextAssoc(ps, pXFAObj, pValue);
FXJSE_Value_Release(pValue);
}
- m_mapXFAToHValue.RemoveAll();
+ m_mapXFAToValue.RemoveAll();
ReleaseVariablesMap();
if (m_hFM2JSContext) {
XFA_FM2JS_ContextRelease(m_hFM2JSContext);
@@ -66,7 +67,7 @@ void CXFA_ScriptContext::Initialize(v8::Isolate* pIsolate) {
}
FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType,
const CFX_WideStringC& wsScript,
- FXJSE_HVALUE hRetValue,
+ CFXJSE_Value* hRetValue,
CXFA_Object* pThisObject) {
CFX_ByteString btScript;
XFA_SCRIPTLANGTYPE eSaveType = m_eScriptType;
@@ -91,18 +92,18 @@ FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType,
}
CXFA_Object* pOriginalObject = m_pThisObject;
m_pThisObject = pThisObject;
- FXJSE_HVALUE pValue = pThisObject ? GetJSValueFromMap(pThisObject) : NULL;
+ CFXJSE_Value* pValue = pThisObject ? GetJSValueFromMap(pThisObject) : NULL;
FX_BOOL bRet =
FXJSE_ExecuteScript(m_pJsContext, btScript.c_str(), hRetValue, pValue);
m_pThisObject = pOriginalObject;
m_eScriptType = eSaveType;
return bRet;
}
-void CXFA_ScriptContext::GlobalPropertySetter(FXJSE_HOBJECT hObject,
+void CXFA_ScriptContext::GlobalPropertySetter(CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue) {
+ CFXJSE_Value* pValue) {
CXFA_Object* lpOrginalNode =
- (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL);
+ (CXFA_Object*)FXJSE_Value_ToObject(pObject, nullptr);
CXFA_Document* pDoc = lpOrginalNode->GetDocument();
CXFA_ScriptContext* lpScriptContext =
(CXFA_ScriptContext*)pDoc->GetScriptContext();
@@ -115,13 +116,13 @@ void CXFA_ScriptContext::GlobalPropertySetter(FXJSE_HOBJECT hObject,
if (lpOrginalNode->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) {
pRefNode = ToNode(lpCurNode);
}
- if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), hValue,
+ if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), pValue,
dwFlag, TRUE)) {
return;
}
if (lpOrginalNode->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) {
- if (FXJSE_Value_IsUndefined(hValue)) {
- FXJSE_Value_SetObjectOwnProp(hObject, szPropName, hValue);
+ if (FXJSE_Value_IsUndefined(pValue)) {
+ FXJSE_Value_SetObjectOwnProp(pObject, szPropName, pValue);
return;
}
}
@@ -130,11 +131,11 @@ void CXFA_ScriptContext::GlobalPropertySetter(FXJSE_HOBJECT hObject,
return;
}
pNotify->GetDocProvider()->SetGlobalProperty(pNotify->GetHDOC(), szPropName,
- hValue);
+ pValue);
}
FX_BOOL CXFA_ScriptContext::QueryNodeByFlag(CXFA_Node* refNode,
const CFX_WideStringC& propname,
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
uint32_t dwFlag,
FX_BOOL bSetting) {
if (!refNode)
@@ -143,32 +144,31 @@ FX_BOOL CXFA_ScriptContext::QueryNodeByFlag(CXFA_Node* refNode,
if (ResolveObjects(refNode, propname, resolveRs, dwFlag) <= 0)
return false;
if (resolveRs.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) {
- FXJSE_HVALUE pValue = GetJSValueFromMap(resolveRs.nodes[0]);
- FXJSE_Value_Set(hValue, pValue);
+ FXJSE_Value_Set(pValue, GetJSValueFromMap(resolveRs.nodes[0]));
return true;
}
if (resolveRs.dwFlags == XFA_RESOVENODE_RSTYPE_Attribute) {
const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo = resolveRs.pScriptAttribute;
if (lpAttributeInfo) {
(resolveRs.nodes[0]->*(lpAttributeInfo->lpfnCallback))(
- hValue, bSetting, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
+ pValue, bSetting, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
}
}
return true;
}
-void CXFA_ScriptContext::GlobalPropertyGetter(FXJSE_HOBJECT hObject,
+void CXFA_ScriptContext::GlobalPropertyGetter(CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue) {
- CXFA_Object* pOrginalObject =
- (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL);
- CXFA_Document* pDoc = pOrginalObject->GetDocument();
+ CFXJSE_Value* pValue) {
+ CXFA_Object* pOriginalObject =
+ (CXFA_Object*)FXJSE_Value_ToObject(pObject, nullptr);
+ CXFA_Document* pDoc = pOriginalObject->GetDocument();
CXFA_ScriptContext* lpScriptContext =
(CXFA_ScriptContext*)pDoc->GetScriptContext();
- CXFA_Object* lpCurNode = lpScriptContext->GetVariablesThis(pOrginalObject);
+ CXFA_Object* lpCurNode = lpScriptContext->GetVariablesThis(pOriginalObject);
CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName);
if (lpScriptContext->GetType() == XFA_SCRIPTLANGTYPE_Formcalc) {
if (szPropName == FOXIT_XFA_FM2JS_FORMCALC_RUNTIME) {
- XFA_FM2JS_GlobalPropertyGetter(lpScriptContext->m_hFM2JSContext, hValue);
+ XFA_FM2JS_GlobalPropertyGetter(lpScriptContext->m_hFM2JSContext, pValue);
return;
}
XFA_HashCode uHashCode = static_cast<XFA_HashCode>(
@@ -177,7 +177,7 @@ void CXFA_ScriptContext::GlobalPropertyGetter(FXJSE_HOBJECT hObject,
CXFA_Object* pObject =
lpScriptContext->GetDocument()->GetXFAObject(uHashCode);
if (pObject) {
- FXJSE_Value_Set(hValue, lpScriptContext->GetJSValueFromMap(pObject));
+ FXJSE_Value_Set(pValue, lpScriptContext->GetJSValueFromMap(pObject));
return;
}
}
@@ -185,23 +185,23 @@ void CXFA_ScriptContext::GlobalPropertyGetter(FXJSE_HOBJECT hObject,
uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties |
XFA_RESOLVENODE_Attributes;
CXFA_Node* pRefNode = ToNode(lpScriptContext->GetThisObject());
- if (pOrginalObject->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) {
+ if (pOriginalObject->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) {
pRefNode = ToNode(lpCurNode);
}
- if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), hValue,
+ if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), pValue,
dwFlag, FALSE)) {
return;
}
dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings;
- if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), hValue,
+ if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), pValue,
dwFlag, FALSE)) {
return;
}
CXFA_Object* pScriptObject =
- lpScriptContext->GetVariablesThis(pOrginalObject, TRUE);
+ lpScriptContext->GetVariablesThis(pOriginalObject, TRUE);
if (pScriptObject &&
- lpScriptContext->QueryVariableHValue(pScriptObject->AsNode(), szPropName,
- hValue, TRUE)) {
+ lpScriptContext->QueryVariableValue(pScriptObject->AsNode(), szPropName,
+ pValue, TRUE)) {
return;
}
CXFA_FFNotify* pNotify = pDoc->GetNotify();
@@ -209,31 +209,31 @@ void CXFA_ScriptContext::GlobalPropertyGetter(FXJSE_HOBJECT hObject,
return;
}
pNotify->GetDocProvider()->GetGlobalProperty(pNotify->GetHDOC(), szPropName,
- hValue);
+ pValue);
}
-void CXFA_ScriptContext::NormalPropertyGetter(FXJSE_HOBJECT hObject,
+void CXFA_ScriptContext::NormalPropertyGetter(CFXJSE_Value* pOriginalValue,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue) {
- CXFA_Object* pOrginalObject =
- (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL);
- if (pOrginalObject == NULL) {
- FXJSE_Value_SetUndefined(hValue);
+ CFXJSE_Value* pReturnValue) {
+ CXFA_Object* pOriginalObject =
+ (CXFA_Object*)FXJSE_Value_ToObject(pOriginalValue, nullptr);
+ if (!pOriginalObject) {
+ FXJSE_Value_SetUndefined(pReturnValue);
return;
}
CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName);
CXFA_ScriptContext* lpScriptContext =
- (CXFA_ScriptContext*)pOrginalObject->GetDocument()->GetScriptContext();
- CXFA_Object* pObject = lpScriptContext->GetVariablesThis(pOrginalObject);
+ (CXFA_ScriptContext*)pOriginalObject->GetDocument()->GetScriptContext();
+ CXFA_Object* pObject = lpScriptContext->GetVariablesThis(pOriginalObject);
if (wsPropName == FX_WSTRC(L"xfa")) {
- FXJSE_HVALUE pValue = lpScriptContext->GetJSValueFromMap(
+ CFXJSE_Value* pValue = lpScriptContext->GetJSValueFromMap(
lpScriptContext->GetDocument()->GetRoot());
- FXJSE_Value_Set(hValue, pValue);
+ FXJSE_Value_Set(pReturnValue, pValue);
return;
}
uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties |
XFA_RESOLVENODE_Attributes;
FX_BOOL bRet = lpScriptContext->QueryNodeByFlag(
- ToNode(pObject), wsPropName.AsStringC(), hValue, dwFlag, FALSE);
+ ToNode(pObject), wsPropName.AsStringC(), pReturnValue, dwFlag, FALSE);
if (bRet) {
return;
}
@@ -242,38 +242,38 @@ void CXFA_ScriptContext::NormalPropertyGetter(FXJSE_HOBJECT hObject,
!lpScriptContext->IsStrictScopeInJavaScript())) {
dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings;
bRet = lpScriptContext->QueryNodeByFlag(
- ToNode(pObject), wsPropName.AsStringC(), hValue, dwFlag, FALSE);
+ ToNode(pObject), wsPropName.AsStringC(), pReturnValue, dwFlag, FALSE);
}
if (bRet) {
return;
}
CXFA_Object* pScriptObject =
- lpScriptContext->GetVariablesThis(pOrginalObject, TRUE);
+ lpScriptContext->GetVariablesThis(pOriginalObject, TRUE);
if (pScriptObject) {
- bRet = lpScriptContext->QueryVariableHValue(ToNode(pScriptObject),
- szPropName, hValue, TRUE);
+ bRet = lpScriptContext->QueryVariableValue(ToNode(pScriptObject),
+ szPropName, pReturnValue, TRUE);
}
if (!bRet) {
- FXJSE_Value_SetUndefined(hValue);
+ FXJSE_Value_SetUndefined(pReturnValue);
}
}
-void CXFA_ScriptContext::NormalPropertySetter(FXJSE_HOBJECT hObject,
+void CXFA_ScriptContext::NormalPropertySetter(CFXJSE_Value* pOriginalValue,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue) {
- CXFA_Object* pOrginalObject =
- (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL);
- if (pOrginalObject == NULL) {
+ CFXJSE_Value* pReturnValue) {
+ CXFA_Object* pOriginalObject =
+ (CXFA_Object*)FXJSE_Value_ToObject(pOriginalValue, nullptr);
+ if (!pOriginalObject)
return;
- }
+
CXFA_ScriptContext* lpScriptContext =
- (CXFA_ScriptContext*)pOrginalObject->GetDocument()->GetScriptContext();
- CXFA_Object* pObject = lpScriptContext->GetVariablesThis(pOrginalObject);
+ (CXFA_ScriptContext*)pOriginalObject->GetDocument()->GetScriptContext();
+ CXFA_Object* pObject = lpScriptContext->GetVariablesThis(pOriginalObject);
CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName);
const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo = XFA_GetScriptAttributeByName(
pObject->GetClassID(), wsPropName.AsStringC());
if (lpAttributeInfo) {
(pObject->*(lpAttributeInfo->lpfnCallback))(
- hValue, TRUE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
+ pReturnValue, TRUE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
} else {
if (pObject->IsNode()) {
if (wsPropName.GetAt(0) == '#') {
@@ -295,27 +295,28 @@ void CXFA_ScriptContext::NormalPropertySetter(FXJSE_HOBJECT hObject,
wsDefaultName.AsStringC());
if (lpAttributeInfo) {
(pPropOrChild->*(lpAttributeInfo->lpfnCallback))(
- hValue, TRUE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
+ pReturnValue, TRUE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
return;
}
}
}
CXFA_Object* pScriptObject =
- lpScriptContext->GetVariablesThis(pOrginalObject, TRUE);
+ lpScriptContext->GetVariablesThis(pOriginalObject, TRUE);
if (pScriptObject) {
- lpScriptContext->QueryVariableHValue(ToNode(pScriptObject), szPropName,
- hValue, FALSE);
+ lpScriptContext->QueryVariableValue(ToNode(pScriptObject), szPropName,
+ pReturnValue, FALSE);
}
}
}
int32_t CXFA_ScriptContext::NormalPropTypeGetter(
- FXJSE_HOBJECT hObject,
+ CFXJSE_Value* pOriginalValue,
const CFX_ByteStringC& szPropName,
FX_BOOL bQueryIn) {
- CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL);
- if (pObject == NULL) {
+ CXFA_Object* pObject =
+ (CXFA_Object*)FXJSE_Value_ToObject(pOriginalValue, nullptr);
+ if (!pObject)
return FXJSE_ClassPropType_None;
- }
+
CXFA_ScriptContext* lpScriptContext =
(CXFA_ScriptContext*)pObject->GetDocument()->GetScriptContext();
pObject = lpScriptContext->GetVariablesThis(pObject);
@@ -331,13 +332,14 @@ int32_t CXFA_ScriptContext::NormalPropTypeGetter(
return FXJSE_ClassPropType_Property;
}
int32_t CXFA_ScriptContext::GlobalPropTypeGetter(
- FXJSE_HOBJECT hObject,
+ CFXJSE_Value* pOriginalValue,
const CFX_ByteStringC& szPropName,
FX_BOOL bQueryIn) {
- CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL);
- if (pObject == NULL) {
+ CXFA_Object* pObject =
+ (CXFA_Object*)FXJSE_Value_ToObject(pOriginalValue, nullptr);
+ if (!pObject)
return FXJSE_ClassPropType_None;
- }
+
CXFA_ScriptContext* lpScriptContext =
(CXFA_ScriptContext*)pObject->GetDocument()->GetScriptContext();
pObject = lpScriptContext->GetVariablesThis(pObject);
@@ -348,22 +350,22 @@ int32_t CXFA_ScriptContext::GlobalPropTypeGetter(
}
return FXJSE_ClassPropType_Property;
}
-void CXFA_ScriptContext::NormalMethodCall(FXJSE_HOBJECT hThis,
+void CXFA_ScriptContext::NormalMethodCall(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
- CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(hThis, NULL);
- if (pObject == NULL) {
+ CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(pThis, nullptr);
+ if (!pObject)
return;
- }
+
CXFA_ScriptContext* lpScriptContext =
(CXFA_ScriptContext*)pObject->GetDocument()->GetScriptContext();
pObject = lpScriptContext->GetVariablesThis(pObject);
CFX_WideString wsFunName = CFX_WideString::FromUTF8(szFuncName);
const XFA_METHODINFO* lpMethodInfo =
XFA_GetMethodByName(pObject->GetClassID(), wsFunName.AsStringC());
- if (NULL == lpMethodInfo) {
+ if (!lpMethodInfo)
return;
- }
+
(pObject->*(lpMethodInfo->lpfnCallback))(&args);
}
FX_BOOL CXFA_ScriptContext::IsStrictScopeInJavaScript() {
@@ -455,7 +457,7 @@ FX_BOOL CXFA_ScriptContext::RunVariablesScript(CXFA_Node* pScriptNode) {
CFX_ByteString btScript =
FX_UTF8Encode(wsScript.c_str(), wsScript.GetLength());
- FXJSE_HVALUE hRetValue = FXJSE_Value_Create(m_pIsolate);
+ CFXJSE_Value* hRetValue = FXJSE_Value_Create(m_pIsolate);
CXFA_Node* pThisObject = pParent->GetNodeItem(XFA_NODEITEM_Parent);
CFXJSE_Context* pVariablesContext =
CreateVariablesContext(pScriptNode, pThisObject);
@@ -468,10 +470,10 @@ FX_BOOL CXFA_ScriptContext::RunVariablesScript(CXFA_Node* pScriptNode) {
return bRet;
}
-FX_BOOL CXFA_ScriptContext::QueryVariableHValue(
+FX_BOOL CXFA_ScriptContext::QueryVariableValue(
CXFA_Node* pScriptNode,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bGetter) {
if (!pScriptNode || pScriptNode->GetClassID() != XFA_ELEMENT_Script)
return FALSE;
@@ -486,23 +488,23 @@ FX_BOOL CXFA_ScriptContext::QueryVariableHValue(
FX_BOOL bRes = FALSE;
CFXJSE_Context* pVariableContext = static_cast<CFXJSE_Context*>(lpVariables);
- FXJSE_HVALUE hObject = FXJSE_Context_GetGlobalObject(pVariableContext);
- FXJSE_HVALUE hVariableValue = FXJSE_Value_Create(m_pIsolate);
+ CFXJSE_Value* pObject = FXJSE_Context_GetGlobalObject(pVariableContext);
+ CFXJSE_Value* hVariableValue = FXJSE_Value_Create(m_pIsolate);
if (!bGetter) {
- FXJSE_Value_SetObjectOwnProp(hObject, szPropName, hValue);
+ FXJSE_Value_SetObjectOwnProp(pObject, szPropName, pValue);
bRes = TRUE;
- } else if (FXJSE_Value_ObjectHasOwnProp(hObject, szPropName, FALSE)) {
- FXJSE_Value_GetObjectProp(hObject, szPropName, hVariableValue);
+ } else if (FXJSE_Value_ObjectHasOwnProp(pObject, szPropName, FALSE)) {
+ FXJSE_Value_GetObjectProp(pObject, szPropName, hVariableValue);
if (FXJSE_Value_IsFunction(hVariableValue))
- FXJSE_Value_SetFunctionBind(hValue, hVariableValue, hObject);
+ FXJSE_Value_SetFunctionBind(pValue, hVariableValue, pObject);
else if (bGetter)
- FXJSE_Value_Set(hValue, hVariableValue);
+ FXJSE_Value_Set(pValue, hVariableValue);
else
- FXJSE_Value_Set(hVariableValue, hValue);
+ FXJSE_Value_Set(hVariableValue, pValue);
bRes = TRUE;
}
FXJSE_Value_Release(hVariableValue);
- FXJSE_Value_Release(hObject);
+ FXJSE_Value_Release(pObject);
return bRes;
}
@@ -512,9 +514,9 @@ void CXFA_ScriptContext::ReleaseVariablesMap() {
CXFA_Object* pScriptNode;
CFXJSE_Context* pVariableContext = nullptr;
m_mapVariableToContext.GetNextAssoc(ps, pScriptNode, pVariableContext);
- FXJSE_HVALUE hObject = FXJSE_Context_GetGlobalObject(pVariableContext);
- delete static_cast<CXFA_ThisProxy*>(FXJSE_Value_ToObject(hObject, nullptr));
- FXJSE_Value_Release(hObject);
+ CFXJSE_Value* pObject = FXJSE_Context_GetGlobalObject(pVariableContext);
+ delete static_cast<CXFA_ThisProxy*>(FXJSE_Value_ToObject(pObject, nullptr));
+ FXJSE_Value_Release(pObject);
FXJSE_Context_Release(pVariableContext);
}
m_mapVariableToContext.RemoveAll();
@@ -536,14 +538,14 @@ void CXFA_ScriptContext::DefineJsClass() {
}
void CXFA_ScriptContext::RemoveBuiltInObjs(CFXJSE_Context* pContext) const {
static const CFX_ByteStringC OBJ_NAME[2] = {"Number", "Date"};
- FXJSE_HVALUE hObject = FXJSE_Context_GetGlobalObject(pContext);
- FXJSE_HVALUE hProp = FXJSE_Value_Create(m_pIsolate);
+ CFXJSE_Value* pObject = FXJSE_Context_GetGlobalObject(pContext);
+ CFXJSE_Value* hProp = FXJSE_Value_Create(m_pIsolate);
for (int i = 0; i < 2; ++i) {
- if (FXJSE_Value_GetObjectProp(hObject, OBJ_NAME[i], hProp))
- FXJSE_Value_DeleteObjectProp(hObject, OBJ_NAME[i]);
+ if (FXJSE_Value_GetObjectProp(pObject, OBJ_NAME[i], hProp))
+ FXJSE_Value_DeleteObjectProp(pObject, OBJ_NAME[i]);
}
FXJSE_Value_Release(hProp);
- FXJSE_Value_Release(hObject);
+ FXJSE_Value_Release(pObject);
}
CFXJSE_Class* CXFA_ScriptContext::GetJseNormalClass() {
return m_pJsClass;
@@ -643,13 +645,13 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode,
}
if (rndFind.m_dwFlag == XFA_RESOVENODE_RSTYPE_Attribute &&
rndFind.m_pScriptAttribute && nStart < wsExpression.GetLength()) {
- FXJSE_HVALUE hValue = FXJSE_Value_Create(m_pIsolate);
+ CFXJSE_Value* pValue = FXJSE_Value_Create(m_pIsolate);
(rndFind.m_Nodes[0]->*(rndFind.m_pScriptAttribute->lpfnCallback))(
- hValue, FALSE,
+ pValue, FALSE,
(XFA_ATTRIBUTE)rndFind.m_pScriptAttribute->eAttribute);
- rndFind.m_Nodes.SetAt(0,
- (CXFA_Object*)FXJSE_Value_ToObject(hValue, NULL));
- FXJSE_Value_Release(hValue);
+ rndFind.m_Nodes.SetAt(
+ 0, (CXFA_Object*)FXJSE_Value_ToObject(pValue, nullptr));
+ FXJSE_Value_Release(pValue);
}
int32_t iSize = m_upObjectArray.GetSize();
if (iSize) {
@@ -712,21 +714,20 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode,
}
return nNodes;
}
-FXJSE_HVALUE CXFA_ScriptContext::GetJSValueFromMap(CXFA_Object* pObject) {
- if (!pObject) {
- return NULL;
- }
- if (pObject->IsNode()) {
+CFXJSE_Value* CXFA_ScriptContext::GetJSValueFromMap(CXFA_Object* pObject) {
+ if (!pObject)
+ return nullptr;
+ if (pObject->IsNode())
RunVariablesScript(pObject->AsNode());
- }
- void* pValue = m_mapXFAToHValue.GetValueAt(pObject);
- if (pValue == NULL) {
- FXJSE_HVALUE jsHvalue = FXJSE_Value_Create(m_pIsolate);
- FXJSE_Value_SetObject(jsHvalue, pObject, m_pJsClass);
- m_mapXFAToHValue.SetAt(pObject, jsHvalue);
- pValue = jsHvalue;
- }
- return (FXJSE_HVALUE)pValue;
+
+ void* pValue = m_mapXFAToValue.GetValueAt(pObject);
+ if (!pValue) {
+ CFXJSE_Value* jsValue = FXJSE_Value_Create(m_pIsolate);
+ FXJSE_Value_SetObject(jsValue, pObject, m_pJsClass);
+ m_mapXFAToValue.SetAt(pObject, jsValue);
+ pValue = jsValue;
+ }
+ return static_cast<CFXJSE_Value*>(pValue);
}
int32_t CXFA_ScriptContext::GetIndexByName(CXFA_Node* refNode) {
CXFA_NodeHelper* lpNodeHelper = m_pResolveProcessor->GetNodeHelper();
diff --git a/xfa/fxfa/parser/xfa_script_imp.h b/xfa/fxfa/parser/xfa_script_imp.h
index 5d1269b767..1060911e88 100644
--- a/xfa/fxfa/parser/xfa_script_imp.h
+++ b/xfa/fxfa/parser/xfa_script_imp.h
@@ -28,7 +28,7 @@ class CXFA_ScriptContext {
CXFA_EventParam* GetEventParam() { return &m_eventParam; }
FX_BOOL RunScript(XFA_SCRIPTLANGTYPE eScriptType,
const CFX_WideStringC& wsScript,
- FXJSE_HVALUE hRetValue,
+ CFXJSE_Value* pRetValue,
CXFA_Object* pThisObject = NULL);
int32_t ResolveObjects(CXFA_Object* refNode,
@@ -36,7 +36,7 @@ class CXFA_ScriptContext {
XFA_RESOLVENODE_RS& resolveNodeRS,
uint32_t dwStyles = XFA_RESOLVENODE_Children,
CXFA_Node* bindNode = NULL);
- FXJSE_HVALUE GetJSValueFromMap(CXFA_Object* pObject);
+ CFXJSE_Value* GetJSValueFromMap(CXFA_Object* pObject);
void CacheList(CXFA_NodeList* pList) { m_CacheListArray.Add(pList); }
CXFA_Object* GetThisObject() const { return m_pThisObject; }
v8::Isolate* GetRuntime() const { return m_pIsolate; }
@@ -54,34 +54,34 @@ class CXFA_ScriptContext {
FX_BOOL IsRunAtClient() { return m_eRunAtType != XFA_ATTRIBUTEENUM_Server; }
FX_BOOL QueryNodeByFlag(CXFA_Node* refNode,
const CFX_WideStringC& propname,
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
uint32_t dwFlag,
FX_BOOL bSetting);
- FX_BOOL QueryVariableHValue(CXFA_Node* pScriptNode,
- const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue,
- FX_BOOL bGetter);
- FX_BOOL QueryBuiltinHValue(const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue);
- static void GlobalPropertyGetter(FXJSE_HOBJECT hObject,
+ FX_BOOL QueryVariableValue(CXFA_Node* pScriptNode,
+ const CFX_ByteStringC& szPropName,
+ CFXJSE_Value* pValue,
+ FX_BOOL bGetter);
+ FX_BOOL QueryBuiltinValue(const CFX_ByteStringC& szPropName,
+ CFXJSE_Value* pValue);
+ static void GlobalPropertyGetter(CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue);
- static void GlobalPropertySetter(FXJSE_HOBJECT hObject,
+ CFXJSE_Value* pValue);
+ static void GlobalPropertySetter(CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue);
- static void NormalPropertyGetter(FXJSE_HOBJECT hObject,
+ CFXJSE_Value* pValue);
+ static void NormalPropertyGetter(CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue);
- static void NormalPropertySetter(FXJSE_HOBJECT hObject,
+ CFXJSE_Value* pValue);
+ static void NormalPropertySetter(CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue);
- static void NormalMethodCall(FXJSE_HOBJECT hThis,
+ CFXJSE_Value* pValue);
+ static void NormalMethodCall(CFXJSE_Value* hThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static int32_t NormalPropTypeGetter(FXJSE_HOBJECT hObject,
+ static int32_t NormalPropTypeGetter(CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
FX_BOOL bQueryIn);
- static int32_t GlobalPropTypeGetter(FXJSE_HOBJECT hObject,
+ static int32_t GlobalPropTypeGetter(CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
FX_BOOL bQueryIn);
FX_BOOL RunVariablesScript(CXFA_Node* pScriptNode);
@@ -107,7 +107,7 @@ class CXFA_ScriptContext {
XFA_SCRIPTLANGTYPE m_eScriptType;
FXJSE_CLASS m_JsGlobalClass;
FXJSE_CLASS m_JsNormalClass;
- CFX_MapPtrTemplate<CXFA_Object*, FXJSE_HVALUE> m_mapXFAToHValue;
+ CFX_MapPtrTemplate<CXFA_Object*, CFXJSE_Value*> m_mapXFAToValue;
FXJSE_CLASS m_JsGlobalVariablesClass;
CFX_MapPtrTemplate<CXFA_Object*, CFXJSE_Context*> m_mapVariableToContext;
CXFA_EventParam m_eventParam;
diff --git a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp
index ffb3a9e588..1720d7350a 100644
--- a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp
@@ -30,7 +30,7 @@ CScript_LayoutPseudoModel::CScript_LayoutPseudoModel(CXFA_Document* pDocument)
}
CScript_LayoutPseudoModel::~CScript_LayoutPseudoModel() {}
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Ready(
- FXJSE_HVALUE hValue,
+ CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify();
@@ -42,7 +42,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Ready(
return;
}
int32_t iStatus = pNotify->GetLayoutStatus();
- FXJSE_Value_SetBoolean(hValue, iStatus >= 2);
+ FXJSE_Value_SetBoolean(pValue, iStatus >= 2);
}
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_HWXY(
CFXJSE_Arguments* pArguments,
@@ -99,9 +99,9 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_HWXY(
pLayoutItem = pLayoutItem->GetNext();
iIndex--;
}
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
if (!pLayoutItem) {
- FXJSE_Value_SetFloat(hValue, 0);
+ FXJSE_Value_SetFloat(pValue, 0);
return;
}
pLayoutItem->GetRect(rtRect, TRUE);
@@ -122,8 +122,8 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_HWXY(
XFA_UNIT unit = measure.GetUnit(wsUnit.AsStringC());
FX_FLOAT fValue = measure.ToUnit(unit);
fValue = FXSYS_round(fValue * 1000) / 1000.0f;
- if (hValue) {
- FXJSE_Value_SetFloat(hValue, fValue);
+ if (pValue) {
+ FXJSE_Value_SetFloat(pValue, fValue);
}
}
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_H(
@@ -165,9 +165,9 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_NumberedPageCount(
} else {
iPageCount = iPageNum;
}
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetInteger(hValue, iPageCount);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetInteger(pValue, iPageCount);
}
}
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageCount(
@@ -192,17 +192,17 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageSpan(
if (!pDocLayout) {
return;
}
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode);
if (!pLayoutItem) {
- FXJSE_Value_SetInteger(hValue, -1);
+ FXJSE_Value_SetInteger(pValue, -1);
return;
}
int32_t iLast = pLayoutItem->GetLast()->GetPage()->GetPageIndex();
int32_t iFirst = pLayoutItem->GetFirst()->GetPage()->GetPageIndex();
int32_t iPageSpan = iLast - iFirst + 1;
- if (hValue) {
- FXJSE_Value_SetInteger(hValue, iPageSpan);
+ if (pValue) {
+ FXJSE_Value_SetInteger(pValue, iPageSpan);
}
}
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Page(
@@ -395,9 +395,9 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageCountInBatch(
}
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
int32_t iPageCount = pNotify->GetDocProvider()->AbsPageCountInBatch(hDoc);
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetInteger(hValue, iPageCount);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetInteger(pValue, iPageCount);
}
}
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetCountInBatch(
@@ -408,9 +408,9 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetCountInBatch(
}
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
int32_t iPageCount = pNotify->GetDocProvider()->SheetCountInBatch(hDoc);
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetInteger(hValue, iPageCount);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetInteger(pValue, iPageCount);
}
}
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Relayout(
@@ -459,9 +459,9 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageInBatch(
}
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
int32_t iPageCount = pNotify->GetDocProvider()->AbsPageInBatch(hDoc, hWidget);
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetInteger(hValue, iPageCount);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetInteger(pValue, iPageCount);
}
}
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetInBatch(
@@ -494,9 +494,9 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetInBatch(
}
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
int32_t iPageCount = pNotify->GetDocProvider()->SheetInBatch(hDoc, hWidget);
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetInteger(hValue, iPageCount);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetInteger(pValue, iPageCount);
}
}
void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Sheet(
@@ -532,9 +532,9 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageImp(
pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0));
}
int32_t iPage = 0;
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (!pNode && hValue) {
- FXJSE_Value_SetInteger(hValue, iPage);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (!pNode && pValue) {
+ FXJSE_Value_SetInteger(pValue, iPage);
}
CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout();
if (!pDocLayout) {
@@ -542,11 +542,11 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageImp(
}
CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode);
if (!pLayoutItem) {
- FXJSE_Value_SetInteger(hValue, -1);
+ FXJSE_Value_SetInteger(pValue, -1);
return;
}
iPage = pLayoutItem->GetFirst()->GetPage()->GetPageIndex();
- if (hValue) {
- FXJSE_Value_SetInteger(hValue, bAbsPage ? iPage : iPage + 1);
+ if (pValue) {
+ FXJSE_Value_SetInteger(pValue, bAbsPage ? iPage : iPage + 1);
}
}
diff --git a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.h b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.h
index 7473bc0fe1..5063153767 100644
--- a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.h
+++ b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.h
@@ -23,7 +23,7 @@ class CScript_LayoutPseudoModel : public CXFA_OrdinaryObject {
explicit CScript_LayoutPseudoModel(CXFA_Document* pDocument);
~CScript_LayoutPseudoModel();
- void Script_LayoutPseudoModel_Ready(FXJSE_HVALUE hValue,
+ void Script_LayoutPseudoModel_Ready(CFXJSE_Value* pValue,
FX_BOOL bSetting,
XFA_ATTRIBUTE eAttribute);
diff --git a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp
index 138ac66165..aa2fa87c4a 100644
--- a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp
+++ b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp
@@ -709,7 +709,7 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_DoPredicateFilter(
for (int32_t i = iFoundCount - 1; i >= 0; i--) {
CXFA_Object* node = findNodes[i];
FX_BOOL bRet = FALSE;
- FXJSE_HVALUE pRetValue = FXJSE_Value_Create(rnd.m_pSC->GetRuntime());
+ CFXJSE_Value* pRetValue = FXJSE_Value_Create(rnd.m_pSC->GetRuntime());
bRet = pContext->RunScript(eLangType, wsExpression.AsStringC(), pRetValue,
node);
if (!bRet || !FXJSE_Value_ToBoolean(pRetValue)) {
diff --git a/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp b/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp
index 913269fd80..2a397541da 100644
--- a/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp
@@ -42,9 +42,9 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Verify(
pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0));
}
int32_t bVerify = pNotify->GetDocProvider()->Verify(hDoc, pNode);
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetInteger(hValue, bVerify);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetInteger(pValue, bVerify);
}
}
void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Sign(
@@ -75,9 +75,9 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Sign(
}
FX_BOOL bSign = pNotify->GetDocProvider()->Sign(
hDoc, pNodeList, wsExpression.AsStringC(), wsXMLIdent.AsStringC());
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetBoolean(hValue, bSign);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetBoolean(pValue, bSign);
}
}
void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Enumerate(
@@ -119,8 +119,8 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Clear(
bClear = pArguments->GetInt32(1) == 0 ? FALSE : TRUE;
}
FX_BOOL bFlag = pNotify->GetDocProvider()->Clear(hDoc, pNode, bClear);
- FXJSE_HVALUE hValue = pArguments->GetReturnValue();
- if (hValue) {
- FXJSE_Value_SetBoolean(hValue, bFlag);
+ CFXJSE_Value* pValue = pArguments->GetReturnValue();
+ if (pValue) {
+ FXJSE_Value_SetBoolean(pValue, bFlag);
}
}
diff --git a/xfa/fxjse/cfxjse_arguments.h b/xfa/fxjse/cfxjse_arguments.h
index d86ec0f1f8..9a20c7c4a3 100644
--- a/xfa/fxjse/cfxjse_arguments.h
+++ b/xfa/fxjse/cfxjse_arguments.h
@@ -13,13 +13,13 @@ class CFXJSE_Arguments {
public:
v8::Isolate* GetRuntime() const;
int32_t GetLength() const;
- FXJSE_HVALUE GetValue(int32_t index) const;
+ CFXJSE_Value* GetValue(int32_t index) const;
FX_BOOL GetBoolean(int32_t index) const;
int32_t GetInt32(int32_t index) const;
FX_FLOAT GetFloat(int32_t index) const;
CFX_ByteString GetUTF8String(int32_t index) const;
- void* GetObject(int32_t index, CFXJSE_Class* hClass = nullptr) const;
- FXJSE_HVALUE GetReturnValue();
+ void* GetObject(int32_t index, CFXJSE_Class* pClass = nullptr) const;
+ CFXJSE_Value* GetReturnValue();
};
#endif // XFA_FXJSE_CFXJSE_ARGUMENTS_H_
diff --git a/xfa/fxjse/class.cpp b/xfa/fxjse/class.cpp
index 6d0a719821..a2f4146208 100644
--- a/xfa/fxjse/class.cpp
+++ b/xfa/fxjse/class.cpp
@@ -42,8 +42,7 @@ static void FXJSE_V8FunctionCallback_Wrapper(
lpThisValue->ForceSetValue(info.This());
CFXJSE_Value* lpRetValue = CFXJSE_Value::Create(info.GetIsolate());
CFXJSE_ArgumentsImpl impl = {&info, lpRetValue};
- lpFunctionInfo->callbackProc(reinterpret_cast<FXJSE_HOBJECT>(lpThisValue),
- szFunctionName,
+ lpFunctionInfo->callbackProc(lpThisValue, szFunctionName,
reinterpret_cast<CFXJSE_Arguments&>(impl));
if (!lpRetValue->DirectGetValue().IsEmpty()) {
info.GetReturnValue().Set(lpRetValue->DirectGetValue());
@@ -66,8 +65,7 @@ static void FXJSE_V8ClassGlobalConstructorCallback_Wrapper(
lpThisValue->ForceSetValue(info.This());
CFXJSE_Value* lpRetValue = CFXJSE_Value::Create(info.GetIsolate());
CFXJSE_ArgumentsImpl impl = {&info, lpRetValue};
- lpClassDefinition->constructor(reinterpret_cast<FXJSE_HOBJECT>(lpThisValue),
- szFunctionName,
+ lpClassDefinition->constructor(lpThisValue, szFunctionName,
reinterpret_cast<CFXJSE_Arguments&>(impl));
if (!lpRetValue->DirectGetValue().IsEmpty()) {
info.GetReturnValue().Set(lpRetValue->DirectGetValue());
@@ -90,9 +88,7 @@ static void FXJSE_V8GetterCallback_Wrapper(
CFXJSE_Value* lpThisValue = CFXJSE_Value::Create(info.GetIsolate());
CFXJSE_Value* lpPropValue = CFXJSE_Value::Create(info.GetIsolate());
lpThisValue->ForceSetValue(info.This());
- lpPropertyInfo->getProc(reinterpret_cast<FXJSE_HOBJECT>(lpThisValue),
- szPropertyName,
- reinterpret_cast<FXJSE_HVALUE>(lpPropValue));
+ lpPropertyInfo->getProc(lpThisValue, szPropertyName, lpPropValue);
info.GetReturnValue().Set(lpPropValue->DirectGetValue());
delete lpThisValue;
lpThisValue = NULL;
@@ -114,9 +110,7 @@ static void FXJSE_V8SetterCallback_Wrapper(
CFXJSE_Value* lpPropValue = CFXJSE_Value::Create(info.GetIsolate());
lpThisValue->ForceSetValue(info.This());
lpPropValue->ForceSetValue(value);
- lpPropertyInfo->setProc(reinterpret_cast<FXJSE_HOBJECT>(lpThisValue),
- szPropertyName,
- reinterpret_cast<FXJSE_HVALUE>(lpPropValue));
+ lpPropertyInfo->setProc(lpThisValue, szPropertyName, lpPropValue);
delete lpThisValue;
lpThisValue = NULL;
delete lpPropValue;
@@ -146,13 +140,13 @@ int32_t CFXJSE_Arguments::GetLength() const {
return lpArguments->m_pInfo->Length();
}
-FXJSE_HVALUE CFXJSE_Arguments::GetValue(int32_t index) const {
+CFXJSE_Value* CFXJSE_Arguments::GetValue(int32_t index) const {
const CFXJSE_ArgumentsImpl* lpArguments =
reinterpret_cast<const CFXJSE_ArgumentsImpl* const>(this);
CFXJSE_Value* lpArgValue = CFXJSE_Value::Create(v8::Isolate::GetCurrent());
ASSERT(lpArgValue);
lpArgValue->ForceSetValue((*lpArguments->m_pInfo)[index]);
- return reinterpret_cast<FXJSE_HVALUE>(lpArgValue);
+ return lpArgValue;
}
FX_BOOL CFXJSE_Arguments::GetBoolean(int32_t index) const {
@@ -192,10 +186,10 @@ void* CFXJSE_Arguments::GetObject(int32_t index, CFXJSE_Class* pClass) const {
return FXJSE_RetrieveObjectBinding(hValue.As<v8::Object>(), pClass);
}
-FXJSE_HVALUE CFXJSE_Arguments::GetReturnValue() {
+CFXJSE_Value* CFXJSE_Arguments::GetReturnValue() {
const CFXJSE_ArgumentsImpl* lpArguments =
reinterpret_cast<const CFXJSE_ArgumentsImpl* const>(this);
- return reinterpret_cast<FXJSE_HVALUE>(lpArguments->m_pRetValue);
+ return lpArguments->m_pRetValue;
}
static void FXJSE_Context_GlobalObjToString(
const v8::FunctionCallbackInfo<v8::Value>& info) {
diff --git a/xfa/fxjse/context.cpp b/xfa/fxjse/context.cpp
index 76df5616e5..bdc31e4594 100644
--- a/xfa/fxjse/context.cpp
+++ b/xfa/fxjse/context.cpp
@@ -21,14 +21,14 @@ void FXJSE_Context_Release(CFXJSE_Context* pContext) {
delete pContext;
}
-FXJSE_HVALUE FXJSE_Context_GetGlobalObject(CFXJSE_Context* pContext) {
+CFXJSE_Value* FXJSE_Context_GetGlobalObject(CFXJSE_Context* pContext) {
if (!pContext)
return nullptr;
CFXJSE_Value* lpValue = CFXJSE_Value::Create(pContext->GetRuntime());
ASSERT(lpValue);
pContext->GetGlobalObject(lpValue);
- return reinterpret_cast<FXJSE_HVALUE>(lpValue);
+ return lpValue;
}
static const FX_CHAR* szCompatibleModeScripts[] = {
@@ -68,11 +68,9 @@ void FXJSE_Context_EnableCompatibleMode(CFXJSE_Context* pContext,
FX_BOOL FXJSE_ExecuteScript(CFXJSE_Context* pContext,
const FX_CHAR* szScript,
- FXJSE_HVALUE hRetValue,
- FXJSE_HVALUE hNewThisObject) {
- return pContext->ExecuteScript(
- szScript, reinterpret_cast<CFXJSE_Value*>(hRetValue),
- reinterpret_cast<CFXJSE_Value*>(hNewThisObject));
+ CFXJSE_Value* pRetValue,
+ CFXJSE_Value* pNewThisObject) {
+ return pContext->ExecuteScript(szScript, pRetValue, pNewThisObject);
}
v8::Local<v8::Object> FXJSE_CreateReturnValue(v8::Isolate* pIsolate,
diff --git a/xfa/fxjse/dynprop.cpp b/xfa/fxjse/dynprop.cpp
index 498c6608cf..514f1b3a9d 100644
--- a/xfa/fxjse/dynprop.cpp
+++ b/xfa/fxjse/dynprop.cpp
@@ -22,8 +22,7 @@ static void FXJSE_DynPropGetterAdapter_MethodCallback(
lpThisValue->ForceSetValue(info.This());
CFXJSE_Value* lpRetValue = CFXJSE_Value::Create(info.GetIsolate());
CFXJSE_ArgumentsImpl impl = {&info, lpRetValue};
- lpClass->dynMethodCall(reinterpret_cast<FXJSE_HOBJECT>(lpThisValue),
- szFxPropName,
+ lpClass->dynMethodCall(lpThisValue, szFxPropName,
reinterpret_cast<CFXJSE_Arguments&>(impl));
if (!lpRetValue->DirectGetValue().IsEmpty()) {
info.GetReturnValue().Set(lpRetValue->DirectGetValue());
@@ -35,22 +34,21 @@ static void FXJSE_DynPropGetterAdapter_MethodCallback(
}
static void FXJSE_DynPropGetterAdapter(const FXJSE_CLASS* lpClass,
- FXJSE_HOBJECT hObject,
+ CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue) {
+ CFXJSE_Value* pValue) {
ASSERT(lpClass);
int32_t nPropType =
lpClass->dynPropTypeGetter == nullptr
? FXJSE_ClassPropType_Property
- : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE);
+ : lpClass->dynPropTypeGetter(pObject, szPropName, FALSE);
if (nPropType == FXJSE_ClassPropType_Property) {
if (lpClass->dynPropGetter) {
- lpClass->dynPropGetter(hObject, szPropName, hValue);
+ lpClass->dynPropGetter(pObject, szPropName, pValue);
}
} else if (nPropType == FXJSE_ClassPropType_Method) {
- if (lpClass->dynMethodCall && hValue) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- v8::Isolate* pIsolate = lpValue->GetIsolate();
+ if (lpClass->dynMethodCall && pValue) {
+ v8::Isolate* pIsolate = pValue->GetIsolate();
v8::HandleScope hscope(pIsolate);
v8::Local<v8::ObjectTemplate> hCallBackInfoTemplate =
v8::ObjectTemplate::New(pIsolate);
@@ -63,51 +61,51 @@ static void FXJSE_DynPropGetterAdapter(const FXJSE_CLASS* lpClass,
1, v8::String::NewFromUtf8(
pIsolate, reinterpret_cast<const char*>(szPropName.raw_str()),
v8::String::kNormalString, szPropName.GetLength()));
- lpValue->ForceSetValue(v8::Function::New(
- lpValue->GetIsolate(), FXJSE_DynPropGetterAdapter_MethodCallback,
+ pValue->ForceSetValue(v8::Function::New(
+ pValue->GetIsolate(), FXJSE_DynPropGetterAdapter_MethodCallback,
hCallBackInfo));
}
}
}
static void FXJSE_DynPropSetterAdapter(const FXJSE_CLASS* lpClass,
- FXJSE_HOBJECT hObject,
+ CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue) {
+ CFXJSE_Value* pValue) {
ASSERT(lpClass);
int32_t nPropType =
lpClass->dynPropTypeGetter == nullptr
? FXJSE_ClassPropType_Property
- : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE);
+ : lpClass->dynPropTypeGetter(pObject, szPropName, FALSE);
if (nPropType != FXJSE_ClassPropType_Method) {
if (lpClass->dynPropSetter) {
- lpClass->dynPropSetter(hObject, szPropName, hValue);
+ lpClass->dynPropSetter(pObject, szPropName, pValue);
}
}
}
static FX_BOOL FXJSE_DynPropQueryAdapter(const FXJSE_CLASS* lpClass,
- FXJSE_HOBJECT hObject,
+ CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName) {
ASSERT(lpClass);
int32_t nPropType =
lpClass->dynPropTypeGetter == nullptr
? FXJSE_ClassPropType_Property
- : lpClass->dynPropTypeGetter(hObject, szPropName, TRUE);
+ : lpClass->dynPropTypeGetter(pObject, szPropName, TRUE);
return nPropType != FXJSE_ClassPropType_None;
}
static FX_BOOL FXJSE_DynPropDeleterAdapter(const FXJSE_CLASS* lpClass,
- FXJSE_HOBJECT hObject,
+ CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName) {
ASSERT(lpClass);
int32_t nPropType =
lpClass->dynPropTypeGetter == nullptr
? FXJSE_ClassPropType_Property
- : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE);
+ : lpClass->dynPropTypeGetter(pObject, szPropName, FALSE);
if (nPropType != FXJSE_ClassPropType_Method) {
if (lpClass->dynPropDeleter) {
- return lpClass->dynPropDeleter(hObject, szPropName);
+ return lpClass->dynPropDeleter(pObject, szPropName);
} else {
return nPropType == FXJSE_ClassPropType_Property ? FALSE : TRUE;
}
@@ -127,9 +125,7 @@ static void FXJSE_V8_GenericNamedPropertyQueryCallback(
CFX_ByteStringC szFxPropName(*szPropName, szPropName.length());
CFXJSE_Value* lpThisValue = CFXJSE_Value::Create(info.GetIsolate());
lpThisValue->ForceSetValue(thisObject);
- if (FXJSE_DynPropQueryAdapter(lpClass,
- reinterpret_cast<FXJSE_HOBJECT>(lpThisValue),
- szFxPropName)) {
+ if (FXJSE_DynPropQueryAdapter(lpClass, lpThisValue, szFxPropName)) {
info.GetReturnValue().Set(v8::DontDelete);
} else {
const int32_t iV8Absent = 64;
@@ -152,10 +148,7 @@ static void FXJSE_V8_GenericNamedPropertyDeleterCallback(
CFXJSE_Value* lpThisValue = CFXJSE_Value::Create(info.GetIsolate());
lpThisValue->ForceSetValue(thisObject);
info.GetReturnValue().Set(
- FXJSE_DynPropDeleterAdapter(
- lpClass, reinterpret_cast<FXJSE_HOBJECT>(lpThisValue), szFxPropName)
- ? true
- : false);
+ !!FXJSE_DynPropDeleterAdapter(lpClass, lpThisValue, szFxPropName));
delete lpThisValue;
lpThisValue = nullptr;
}
@@ -171,9 +164,7 @@ static void FXJSE_V8_GenericNamedPropertyGetterCallback(
CFXJSE_Value* lpThisValue = CFXJSE_Value::Create(info.GetIsolate());
lpThisValue->ForceSetValue(thisObject);
CFXJSE_Value* lpNewValue = CFXJSE_Value::Create(info.GetIsolate());
- FXJSE_DynPropGetterAdapter(
- lpClass, reinterpret_cast<FXJSE_HOBJECT>(lpThisValue), szFxPropName,
- reinterpret_cast<FXJSE_HVALUE>(lpNewValue));
+ FXJSE_DynPropGetterAdapter(lpClass, lpThisValue, szFxPropName, lpNewValue);
info.GetReturnValue().Set(lpNewValue->DirectGetValue());
delete lpThisValue;
lpThisValue = nullptr;
@@ -192,9 +183,7 @@ static void FXJSE_V8_GenericNamedPropertySetterCallback(
lpThisValue->ForceSetValue(thisObject);
CFXJSE_Value* lpNewValue = CFXJSE_Value::Create(info.GetIsolate());
lpNewValue->ForceSetValue(value);
- FXJSE_DynPropSetterAdapter(
- lpClass, reinterpret_cast<FXJSE_HOBJECT>(lpThisValue), szFxPropName,
- reinterpret_cast<FXJSE_HVALUE>(lpNewValue));
+ FXJSE_DynPropSetterAdapter(lpClass, lpThisValue, szFxPropName, lpNewValue);
info.GetReturnValue().Set(value);
delete lpThisValue;
lpThisValue = nullptr;
diff --git a/xfa/fxjse/include/fxjse.h b/xfa/fxjse/include/fxjse.h
index 5cf2d2abb7..4484303046 100644
--- a/xfa/fxjse/include/fxjse.h
+++ b/xfa/fxjse/include/fxjse.h
@@ -14,21 +14,18 @@
class CFXJSE_Arguments;
class CFXJSE_Class;
class CFXJSE_Context;
+class CFXJSE_Value;
-typedef struct FXJSE_HVALUE_ { void* pData; } * FXJSE_HVALUE;
-// NOLINTNEXTLINE
-typedef struct FXJSE_HOBJECT_ : public FXJSE_HVALUE_{} * FXJSE_HOBJECT;
-
-typedef void (*FXJSE_FuncCallback)(FXJSE_HOBJECT hThis,
+typedef void (*FXJSE_FuncCallback)(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
-typedef void (*FXJSE_PropAccessor)(FXJSE_HOBJECT hObject,
+typedef void (*FXJSE_PropAccessor)(CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hValue);
-typedef int32_t (*FXJSE_PropTypeGetter)(FXJSE_HOBJECT hObject,
+ CFXJSE_Value* pValue);
+typedef int32_t (*FXJSE_PropTypeGetter)(CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
FX_BOOL bQueryIn);
-typedef FX_BOOL (*FXJSE_PropDeleter)(FXJSE_HOBJECT hObject,
+typedef FX_BOOL (*FXJSE_PropDeleter)(CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName);
enum FXJSE_ClassPropTypes {
@@ -77,7 +74,7 @@ CFXJSE_Context* FXJSE_Context_Create(v8::Isolate* pIsolate,
const FXJSE_CLASS* lpGlobalClass = nullptr,
void* lpGlobalObject = nullptr);
void FXJSE_Context_Release(CFXJSE_Context* pContext);
-FXJSE_HVALUE FXJSE_Context_GetGlobalObject(CFXJSE_Context* pContext);
+CFXJSE_Value* FXJSE_Context_GetGlobalObject(CFXJSE_Context* pContext);
void FXJSE_Context_EnableCompatibleMode(CFXJSE_Context* pContext,
uint32_t dwCompatibleFlags);
@@ -85,67 +82,68 @@ void FXJSE_Context_EnableCompatibleMode(CFXJSE_Context* pContext,
CFXJSE_Class* FXJSE_DefineClass(CFXJSE_Context* pContext,
const FXJSE_CLASS* lpClass);
-FXJSE_HVALUE FXJSE_Value_Create(v8::Isolate* pIsolate);
-void FXJSE_Value_Release(FXJSE_HVALUE hValue);
-
-FX_BOOL FXJSE_Value_IsUndefined(FXJSE_HVALUE hValue);
-FX_BOOL FXJSE_Value_IsNull(FXJSE_HVALUE hValue);
-FX_BOOL FXJSE_Value_IsBoolean(FXJSE_HVALUE hValue);
-FX_BOOL FXJSE_Value_IsUTF8String(FXJSE_HVALUE hValue);
-FX_BOOL FXJSE_Value_IsNumber(FXJSE_HVALUE hValue);
-FX_BOOL FXJSE_Value_IsObject(FXJSE_HVALUE hValue);
-FX_BOOL FXJSE_Value_IsArray(FXJSE_HVALUE hValue);
-FX_BOOL FXJSE_Value_IsFunction(FXJSE_HVALUE hValue);
-
-FX_BOOL FXJSE_Value_ToBoolean(FXJSE_HVALUE hValue);
-FX_FLOAT FXJSE_Value_ToFloat(FXJSE_HVALUE hValue);
-double FXJSE_Value_ToDouble(FXJSE_HVALUE hValue);
-int32_t FXJSE_Value_ToInteger(FXJSE_HVALUE hValue);
-void FXJSE_Value_ToUTF8String(FXJSE_HVALUE hValue, CFX_ByteString& szStrOutput);
-void* FXJSE_Value_ToObject(FXJSE_HVALUE hValue, CFXJSE_Class* hClass);
-
-void FXJSE_Value_SetUndefined(FXJSE_HVALUE hValue);
-void FXJSE_Value_SetNull(FXJSE_HVALUE hValue);
-void FXJSE_Value_SetBoolean(FXJSE_HVALUE hValue, FX_BOOL bBoolean);
-void FXJSE_Value_SetUTF8String(FXJSE_HVALUE hValue,
+CFXJSE_Value* FXJSE_Value_Create(v8::Isolate* pIsolate);
+void FXJSE_Value_Release(CFXJSE_Value* pValue);
+
+FX_BOOL FXJSE_Value_IsUndefined(CFXJSE_Value* pValue);
+FX_BOOL FXJSE_Value_IsNull(CFXJSE_Value* pValue);
+FX_BOOL FXJSE_Value_IsBoolean(CFXJSE_Value* pValue);
+FX_BOOL FXJSE_Value_IsUTF8String(CFXJSE_Value* pValue);
+FX_BOOL FXJSE_Value_IsNumber(CFXJSE_Value* pValue);
+FX_BOOL FXJSE_Value_IsObject(CFXJSE_Value* pValue);
+FX_BOOL FXJSE_Value_IsArray(CFXJSE_Value* pValue);
+FX_BOOL FXJSE_Value_IsFunction(CFXJSE_Value* pValue);
+
+FX_BOOL FXJSE_Value_ToBoolean(CFXJSE_Value* pValue);
+FX_FLOAT FXJSE_Value_ToFloat(CFXJSE_Value* pValue);
+double FXJSE_Value_ToDouble(CFXJSE_Value* pValue);
+int32_t FXJSE_Value_ToInteger(CFXJSE_Value* pValue);
+void FXJSE_Value_ToUTF8String(CFXJSE_Value* pValue,
+ CFX_ByteString& szStrOutput);
+void* FXJSE_Value_ToObject(CFXJSE_Value* pValue, CFXJSE_Class* pClass);
+
+void FXJSE_Value_SetUndefined(CFXJSE_Value* pValue);
+void FXJSE_Value_SetNull(CFXJSE_Value* pValue);
+void FXJSE_Value_SetBoolean(CFXJSE_Value* pValue, FX_BOOL bBoolean);
+void FXJSE_Value_SetUTF8String(CFXJSE_Value* pValue,
const CFX_ByteStringC& szString);
-void FXJSE_Value_SetInteger(FXJSE_HVALUE hValue, int32_t nInteger);
-void FXJSE_Value_SetFloat(FXJSE_HVALUE hValue, FX_FLOAT fFloat);
-void FXJSE_Value_SetDouble(FXJSE_HVALUE hValue, double dDouble);
-void FXJSE_Value_SetObject(FXJSE_HVALUE hValue,
+void FXJSE_Value_SetInteger(CFXJSE_Value* pValue, int32_t nInteger);
+void FXJSE_Value_SetFloat(CFXJSE_Value* pValue, FX_FLOAT fFloat);
+void FXJSE_Value_SetDouble(CFXJSE_Value* pValue, double dDouble);
+void FXJSE_Value_SetObject(CFXJSE_Value* pValue,
void* lpObject,
CFXJSE_Class* pClass);
-void FXJSE_Value_SetArray(FXJSE_HVALUE hValue,
+void FXJSE_Value_SetArray(CFXJSE_Value* pValue,
uint32_t uValueCount,
- FXJSE_HVALUE* rgValues);
-void FXJSE_Value_Set(FXJSE_HVALUE hValue, FXJSE_HVALUE hOriginalValue);
+ CFXJSE_Value** rgValues);
+void FXJSE_Value_Set(CFXJSE_Value* pValue, CFXJSE_Value* pOriginalValue);
-FX_BOOL FXJSE_Value_GetObjectProp(FXJSE_HVALUE hValue,
+FX_BOOL FXJSE_Value_GetObjectProp(CFXJSE_Value* pValue,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hPropValue);
-FX_BOOL FXJSE_Value_SetObjectProp(FXJSE_HVALUE hValue,
+ CFXJSE_Value* pPropValue);
+FX_BOOL FXJSE_Value_SetObjectProp(CFXJSE_Value* pValue,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hPropValue);
-FX_BOOL FXJSE_Value_GetObjectPropByIdx(FXJSE_HVALUE hValue,
+ CFXJSE_Value* pPropValue);
+FX_BOOL FXJSE_Value_GetObjectPropByIdx(CFXJSE_Value* pValue,
uint32_t uPropIdx,
- FXJSE_HVALUE hPropValue);
-FX_BOOL FXJSE_Value_DeleteObjectProp(FXJSE_HVALUE hValue,
+ CFXJSE_Value* pPropValue);
+FX_BOOL FXJSE_Value_DeleteObjectProp(CFXJSE_Value* pValue,
const CFX_ByteStringC& szPropName);
-FX_BOOL FXJSE_Value_ObjectHasOwnProp(FXJSE_HVALUE hValue,
+FX_BOOL FXJSE_Value_ObjectHasOwnProp(CFXJSE_Value* pValue,
const CFX_ByteStringC& szPropName,
FX_BOOL bUseTypeGetter);
-FX_BOOL FXJSE_Value_SetObjectOwnProp(FXJSE_HVALUE hValue,
+FX_BOOL FXJSE_Value_SetObjectOwnProp(CFXJSE_Value* pValue,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hPropValue);
+ CFXJSE_Value* pPropValue);
-FX_BOOL FXJSE_Value_SetFunctionBind(FXJSE_HVALUE hValue,
- FXJSE_HVALUE hOldFunction,
- FXJSE_HVALUE hNewThis);
+FX_BOOL FXJSE_Value_SetFunctionBind(CFXJSE_Value* pValue,
+ CFXJSE_Value* pOldFunction,
+ CFXJSE_Value* pNewThis);
FX_BOOL FXJSE_ExecuteScript(CFXJSE_Context* pContext,
const FX_CHAR* szScript,
- FXJSE_HVALUE hRetValue,
- FXJSE_HVALUE hNewThisObject = nullptr);
+ CFXJSE_Value* pRetValue,
+ CFXJSE_Value* pNewThisObject = nullptr);
void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name,
const CFX_ByteStringC& utf8Message);
diff --git a/xfa/fxjse/value.cpp b/xfa/fxjse/value.cpp
index a9f73b2755..e7a3463f28 100644
--- a/xfa/fxjse/value.cpp
+++ b/xfa/fxjse/value.cpp
@@ -11,193 +11,166 @@
#include "xfa/fxjse/class.h"
#include "xfa/fxjse/util_inline.h"
-FX_BOOL FXJSE_Value_IsUndefined(FXJSE_HVALUE hValue) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- return lpValue && lpValue->IsUndefined();
+FX_BOOL FXJSE_Value_IsUndefined(CFXJSE_Value* pValue) {
+ return pValue && pValue->IsUndefined();
}
-FX_BOOL FXJSE_Value_IsNull(FXJSE_HVALUE hValue) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- return lpValue && lpValue->IsNull();
+FX_BOOL FXJSE_Value_IsNull(CFXJSE_Value* pValue) {
+ return pValue && pValue->IsNull();
}
-FX_BOOL FXJSE_Value_IsBoolean(FXJSE_HVALUE hValue) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- return lpValue && lpValue->IsBoolean();
+FX_BOOL FXJSE_Value_IsBoolean(CFXJSE_Value* pValue) {
+ return pValue && pValue->IsBoolean();
}
-FX_BOOL FXJSE_Value_IsUTF8String(FXJSE_HVALUE hValue) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- return lpValue && lpValue->IsString();
+FX_BOOL FXJSE_Value_IsUTF8String(CFXJSE_Value* pValue) {
+ return pValue && pValue->IsString();
}
-FX_BOOL FXJSE_Value_IsNumber(FXJSE_HVALUE hValue) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- return lpValue && lpValue->IsNumber();
+FX_BOOL FXJSE_Value_IsNumber(CFXJSE_Value* pValue) {
+ return pValue && pValue->IsNumber();
}
-FX_BOOL FXJSE_Value_IsObject(FXJSE_HVALUE hValue) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- return lpValue && lpValue->IsObject();
+FX_BOOL FXJSE_Value_IsObject(CFXJSE_Value* pValue) {
+ return pValue && pValue->IsObject();
}
-FX_BOOL FXJSE_Value_IsArray(FXJSE_HVALUE hValue) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- return lpValue && lpValue->IsArray();
+FX_BOOL FXJSE_Value_IsArray(CFXJSE_Value* pValue) {
+ return pValue && pValue->IsArray();
}
-FX_BOOL FXJSE_Value_IsFunction(FXJSE_HVALUE hValue) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- return lpValue && lpValue->IsFunction();
+FX_BOOL FXJSE_Value_IsFunction(CFXJSE_Value* pValue) {
+ return pValue && pValue->IsFunction();
}
-FX_BOOL FXJSE_Value_ToBoolean(FXJSE_HVALUE hValue) {
- return reinterpret_cast<CFXJSE_Value*>(hValue)->ToBoolean();
+FX_BOOL FXJSE_Value_ToBoolean(CFXJSE_Value* pValue) {
+ return pValue->ToBoolean();
}
-FX_FLOAT FXJSE_Value_ToFloat(FXJSE_HVALUE hValue) {
- return reinterpret_cast<CFXJSE_Value*>(hValue)->ToFloat();
+FX_FLOAT FXJSE_Value_ToFloat(CFXJSE_Value* pValue) {
+ return pValue->ToFloat();
}
-double FXJSE_Value_ToDouble(FXJSE_HVALUE hValue) {
- return reinterpret_cast<CFXJSE_Value*>(hValue)->ToDouble();
+double FXJSE_Value_ToDouble(CFXJSE_Value* pValue) {
+ return pValue->ToDouble();
}
-void FXJSE_Value_ToUTF8String(FXJSE_HVALUE hValue,
+void FXJSE_Value_ToUTF8String(CFXJSE_Value* pValue,
CFX_ByteString& szStrOutput) {
- return reinterpret_cast<CFXJSE_Value*>(hValue)->ToString(szStrOutput);
+ pValue->ToString(szStrOutput);
}
-int32_t FXJSE_Value_ToInteger(FXJSE_HVALUE hValue) {
- return reinterpret_cast<CFXJSE_Value*>(hValue)->ToInteger();
+int32_t FXJSE_Value_ToInteger(CFXJSE_Value* pValue) {
+ return pValue->ToInteger();
}
-void* FXJSE_Value_ToObject(FXJSE_HVALUE hValue, CFXJSE_Class* pClass) {
- return reinterpret_cast<CFXJSE_Value*>(hValue)->ToObject(pClass);
+void* FXJSE_Value_ToObject(CFXJSE_Value* pValue, CFXJSE_Class* pClass) {
+ return pValue->ToObject(pClass);
}
-void FXJSE_Value_SetUndefined(FXJSE_HVALUE hValue) {
- reinterpret_cast<CFXJSE_Value*>(hValue)->SetUndefined();
+void FXJSE_Value_SetUndefined(CFXJSE_Value* pValue) {
+ pValue->SetUndefined();
}
-void FXJSE_Value_SetNull(FXJSE_HVALUE hValue) {
- reinterpret_cast<CFXJSE_Value*>(hValue)->SetNull();
+void FXJSE_Value_SetNull(CFXJSE_Value* pValue) {
+ pValue->SetNull();
}
-void FXJSE_Value_SetBoolean(FXJSE_HVALUE hValue, FX_BOOL bBoolean) {
- reinterpret_cast<CFXJSE_Value*>(hValue)->SetBoolean(bBoolean);
+void FXJSE_Value_SetBoolean(CFXJSE_Value* pValue, FX_BOOL bBoolean) {
+ pValue->SetBoolean(bBoolean);
}
-void FXJSE_Value_SetUTF8String(FXJSE_HVALUE hValue,
+void FXJSE_Value_SetUTF8String(CFXJSE_Value* pValue,
const CFX_ByteStringC& szString) {
- reinterpret_cast<CFXJSE_Value*>(hValue)->SetString(szString);
+ pValue->SetString(szString);
}
-void FXJSE_Value_SetInteger(FXJSE_HVALUE hValue, int32_t nInteger) {
- reinterpret_cast<CFXJSE_Value*>(hValue)->SetInteger(nInteger);
+void FXJSE_Value_SetInteger(CFXJSE_Value* pValue, int32_t nInteger) {
+ pValue->SetInteger(nInteger);
}
-void FXJSE_Value_SetFloat(FXJSE_HVALUE hValue, FX_FLOAT fFloat) {
- reinterpret_cast<CFXJSE_Value*>(hValue)->SetFloat(fFloat);
+void FXJSE_Value_SetFloat(CFXJSE_Value* pValue, FX_FLOAT fFloat) {
+ pValue->SetFloat(fFloat);
}
-void FXJSE_Value_SetDouble(FXJSE_HVALUE hValue, double dDouble) {
- reinterpret_cast<CFXJSE_Value*>(hValue)->SetDouble(dDouble);
+void FXJSE_Value_SetDouble(CFXJSE_Value* pValue, double dDouble) {
+ pValue->SetDouble(dDouble);
}
-void FXJSE_Value_SetObject(FXJSE_HVALUE hValue,
+void FXJSE_Value_SetObject(CFXJSE_Value* pValue,
void* lpObject,
CFXJSE_Class* pClass) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
if (!pClass) {
ASSERT(!lpObject);
- lpValue->SetJSObject();
+ pValue->SetJSObject();
} else {
- lpValue->SetHostObject(lpObject, pClass);
+ pValue->SetHostObject(lpObject, pClass);
}
}
-void FXJSE_Value_SetArray(FXJSE_HVALUE hValue,
+void FXJSE_Value_SetArray(CFXJSE_Value* pValue,
uint32_t uValueCount,
- FXJSE_HVALUE* rgValues) {
- reinterpret_cast<CFXJSE_Value*>(hValue)
- ->SetArray(uValueCount, reinterpret_cast<CFXJSE_Value**>(rgValues));
+ CFXJSE_Value** rgValues) {
+ pValue->SetArray(uValueCount, rgValues);
}
-void FXJSE_Value_Set(FXJSE_HVALUE hValue, FXJSE_HVALUE hOriginalValue) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- CFXJSE_Value* lpOriginalValue =
- reinterpret_cast<CFXJSE_Value*>(hOriginalValue);
- ASSERT(lpValue && lpOriginalValue);
- lpValue->Assign(lpOriginalValue);
+void FXJSE_Value_Set(CFXJSE_Value* pValue, CFXJSE_Value* pOriginalValue) {
+ ASSERT(pOriginalValue);
+ pValue->Assign(pOriginalValue);
}
-FX_BOOL FXJSE_Value_GetObjectProp(FXJSE_HVALUE hValue,
+FX_BOOL FXJSE_Value_GetObjectProp(CFXJSE_Value* pValue,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hPropValue) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- CFXJSE_Value* lpPropValue = reinterpret_cast<CFXJSE_Value*>(hPropValue);
- ASSERT(lpValue && lpPropValue);
- return lpValue->GetObjectProperty(szPropName, lpPropValue);
+ CFXJSE_Value* pPropValue) {
+ ASSERT(pPropValue);
+ return pValue->GetObjectProperty(szPropName, pPropValue);
}
-FX_BOOL FXJSE_Value_SetObjectProp(FXJSE_HVALUE hValue,
+FX_BOOL FXJSE_Value_SetObjectProp(CFXJSE_Value* pValue,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hPropValue) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- CFXJSE_Value* lpPropValue = reinterpret_cast<CFXJSE_Value*>(hPropValue);
- ASSERT(lpValue && lpPropValue);
- return lpValue->SetObjectProperty(szPropName, lpPropValue);
+ CFXJSE_Value* pPropValue) {
+ ASSERT(pPropValue);
+ return pValue->SetObjectProperty(szPropName, pPropValue);
}
-FX_BOOL FXJSE_Value_GetObjectPropByIdx(FXJSE_HVALUE hValue,
+FX_BOOL FXJSE_Value_GetObjectPropByIdx(CFXJSE_Value* pValue,
uint32_t uPropIdx,
- FXJSE_HVALUE hPropValue) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- CFXJSE_Value* lpPropValue = reinterpret_cast<CFXJSE_Value*>(hPropValue);
- ASSERT(lpValue && lpPropValue);
- return lpValue->GetObjectProperty(uPropIdx, lpPropValue);
+ CFXJSE_Value* pPropValue) {
+ ASSERT(pPropValue);
+ return pValue->GetObjectProperty(uPropIdx, pPropValue);
}
-FX_BOOL FXJSE_Value_DeleteObjectProp(FXJSE_HVALUE hValue,
+FX_BOOL FXJSE_Value_DeleteObjectProp(CFXJSE_Value* pValue,
const CFX_ByteStringC& szPropName) {
- return reinterpret_cast<CFXJSE_Value*>(hValue)
- ->DeleteObjectProperty(szPropName);
+ return pValue->DeleteObjectProperty(szPropName);
}
-FX_BOOL FXJSE_Value_ObjectHasOwnProp(FXJSE_HVALUE hValue,
+FX_BOOL FXJSE_Value_ObjectHasOwnProp(CFXJSE_Value* pValue,
const CFX_ByteStringC& szPropName,
FX_BOOL bUseTypeGetter) {
- return reinterpret_cast<CFXJSE_Value*>(hValue)
- ->HasObjectOwnProperty(szPropName, bUseTypeGetter);
+ return pValue->HasObjectOwnProperty(szPropName, bUseTypeGetter);
}
-FX_BOOL FXJSE_Value_SetObjectOwnProp(FXJSE_HVALUE hValue,
+FX_BOOL FXJSE_Value_SetObjectOwnProp(CFXJSE_Value* pValue,
const CFX_ByteStringC& szPropName,
- FXJSE_HVALUE hPropValue) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- CFXJSE_Value* lpPropValue = reinterpret_cast<CFXJSE_Value*>(hPropValue);
- ASSERT(lpValue && lpPropValue);
- return lpValue->SetObjectOwnProperty(szPropName, lpPropValue);
+ CFXJSE_Value* pPropValue) {
+ ASSERT(pPropValue);
+ return pValue->SetObjectOwnProperty(szPropName, pPropValue);
}
-FX_BOOL FXJSE_Value_SetFunctionBind(FXJSE_HVALUE hValue,
- FXJSE_HVALUE hOldFunction,
- FXJSE_HVALUE hNewThis) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- CFXJSE_Value* lpOldFunction = reinterpret_cast<CFXJSE_Value*>(hOldFunction);
- CFXJSE_Value* lpNewThis = reinterpret_cast<CFXJSE_Value*>(hNewThis);
- ASSERT(lpValue && lpOldFunction && lpNewThis);
- return lpValue->SetFunctionBind(lpOldFunction, lpNewThis);
+FX_BOOL FXJSE_Value_SetFunctionBind(CFXJSE_Value* pValue,
+ CFXJSE_Value* pOldFunction,
+ CFXJSE_Value* pNewThis) {
+ ASSERT(pOldFunction && pNewThis);
+ return pValue->SetFunctionBind(pOldFunction, pNewThis);
}
-FXJSE_HVALUE FXJSE_Value_Create(v8::Isolate* pIsolate) {
- return reinterpret_cast<FXJSE_HVALUE>(CFXJSE_Value::Create(pIsolate));
+CFXJSE_Value* FXJSE_Value_Create(v8::Isolate* pIsolate) {
+ return CFXJSE_Value::Create(pIsolate);
}
-void FXJSE_Value_Release(FXJSE_HVALUE hValue) {
- CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
- delete lpValue;
+void FXJSE_Value_Release(CFXJSE_Value* pValue) {
+ delete pValue;
}
void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name,
@@ -240,13 +213,13 @@ void* CFXJSE_Value::ToObject(CFXJSE_Class* lpClass) const {
ASSERT(!m_hValue.IsEmpty());
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
- v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
- ASSERT(!hValue.IsEmpty());
+ v8::Local<v8::Value> pValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
+ ASSERT(!pValue.IsEmpty());
- if (!hValue->IsObject())
+ if (!pValue->IsObject())
return nullptr;
- return FXJSE_RetrieveObjectBinding(hValue.As<v8::Object>(), lpClass);
+ return FXJSE_RetrieveObjectBinding(pValue.As<v8::Object>(), lpClass);
}
V8_INLINE static double FXJSE_ftod(FX_FLOAT fNumber) {
@@ -291,8 +264,8 @@ V8_INLINE static double FXJSE_ftod(FX_FLOAT fNumber) {
void CFXJSE_Value::SetFloat(FX_FLOAT fFloat) {
CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate);
- v8::Local<v8::Value> hValue = v8::Number::New(m_pIsolate, FXJSE_ftod(fFloat));
- m_hValue.Reset(m_pIsolate, hValue);
+ v8::Local<v8::Value> pValue = v8::Number::New(m_pIsolate, FXJSE_ftod(fFloat));
+ m_hValue.Reset(m_pIsolate, pValue);
}
void CFXJSE_Value::SetHostObject(void* lpObject, CFXJSE_Class* lpClass) {
@@ -423,7 +396,7 @@ FX_BOOL CFXJSE_Value::SetObjectOwnProperty(const CFX_ByteStringC& szPropName,
if (!hObject->IsObject())
return FALSE;
- v8::Local<v8::Value> hValue =
+ v8::Local<v8::Value> pValue =
v8::Local<v8::Value>::New(m_pIsolate, lpPropValue->m_hValue);
return hObject.As<v8::Object>()
->DefineOwnProperty(
@@ -431,7 +404,7 @@ FX_BOOL CFXJSE_Value::SetObjectOwnProperty(const CFX_ByteStringC& szPropName,
v8::String::NewFromUtf8(m_pIsolate, szPropName.c_str(),
v8::String::kNormalString,
szPropName.GetLength()),
- hValue)
+ pValue)
.FromMaybe(false);
}
@@ -470,7 +443,7 @@ FX_BOOL CFXJSE_Value::SetFunctionBind(CFXJSE_Value* lpOldFunction,
FX_BOOL CFXJSE_Value::Call(CFXJSE_Value* lpReceiver,
CFXJSE_Value* lpRetValue,
uint32_t nArgCount,
- FXJSE_HVALUE* lpArgs) {
+ CFXJSE_Value** lpArgs) {
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hFunctionValue =
v8::Local<v8::Value>::New(m_pIsolate, DirectGetValue());
@@ -492,7 +465,7 @@ FX_BOOL CFXJSE_Value::Call(CFXJSE_Value* lpReceiver,
lpLocalArgs = FX_Alloc(v8::Local<v8::Value>, nArgCount);
for (uint32_t i = 0; i < nArgCount; i++) {
new (lpLocalArgs + i) v8::Local<v8::Value>;
- CFXJSE_Value* lpArg = (CFXJSE_Value*)lpArgs[i];
+ CFXJSE_Value* lpArg = lpArgs[i];
if (lpArg) {
lpLocalArgs[i] =
v8::Local<v8::Value>::New(m_pIsolate, lpArg->DirectGetValue());
diff --git a/xfa/fxjse/value.h b/xfa/fxjse/value.h
index 576d092bce..65b5fa8e3d 100644
--- a/xfa/fxjse/value.h
+++ b/xfa/fxjse/value.h
@@ -201,7 +201,7 @@ class CFXJSE_Value {
FX_BOOL Call(CFXJSE_Value* lpReceiver,
CFXJSE_Value* lpRetValue,
uint32_t nArgCount,
- FXJSE_HVALUE* lpArgs);
+ CFXJSE_Value** lpArgs);
V8_INLINE v8::Isolate* GetIsolate() const { return m_pIsolate; }
V8_INLINE const v8::Global<v8::Value>& DirectGetValue() const {