summaryrefslogtreecommitdiff
path: root/fxjs
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-08 17:11:21 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-08 17:11:21 +0000
commit269ef77ccbb20db68c0b5049bb6a3a867623db64 (patch)
tree4e1437072ce86d4973d6d42e92a3c44b64016455 /fxjs
parent20f22a0a38a6c6d9ccd0ead2e65093e79f0bd051 (diff)
downloadpdfium-269ef77ccbb20db68c0b5049bb6a3a867623db64.tar.xz
Fix XFA_SCRIPTATTRIBUTEINFO attribute type
This CL changes XFA_SCRIPTATTRIBUTEINFO attribute field to be a XFA_ATTRIBUTE from an in32_t. This necessitated adding an XFA_ATTRIBUTE_Unknown and updating the various -1 values in the script data description. Change-Id: I837602e38b3785d7c8515830fae8dc427d449e9f Reviewed-on: https://pdfium-review.googlesource.com/18030 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs')
-rw-r--r--fxjs/cfxjse_engine.cpp15
-rw-r--r--fxjs/cjx_node.cpp4
2 files changed, 9 insertions, 10 deletions
diff --git a/fxjs/cfxjse_engine.cpp b/fxjs/cfxjse_engine.cpp
index 70ab95ae6a..40c874750d 100644
--- a/fxjs/cfxjse_engine.cpp
+++ b/fxjs/cfxjse_engine.cpp
@@ -228,8 +228,8 @@ bool CFXJSE_Engine::QueryNodeByFlag(CXFA_Node* refNode,
const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo = resolveRs.pScriptAttribute;
if (lpAttributeInfo) {
CJX_Object* jsObject = resolveRs.objects.front()->JSObject();
- (jsObject->*(lpAttributeInfo->callback))(
- pValue, bSetting, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
+ (jsObject->*(lpAttributeInfo->callback))(pValue, bSetting,
+ lpAttributeInfo->attribute);
}
}
return true;
@@ -354,8 +354,8 @@ void CFXJSE_Engine::NormalPropertySetter(CFXJSE_Value* pOriginalValue,
pObject->GetElementType(), wsPropName.AsStringView());
if (lpAttributeInfo) {
CJX_Object* jsObject = pObject->JSObject();
- (jsObject->*(lpAttributeInfo->callback))(
- pReturnValue, true, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
+ (jsObject->*(lpAttributeInfo->callback))(pReturnValue, true,
+ lpAttributeInfo->attribute);
return;
}
@@ -377,8 +377,8 @@ void CFXJSE_Engine::NormalPropertySetter(CFXJSE_Value* pOriginalValue,
pPropOrChild->GetElementType(), wsDefaultName.AsStringView());
if (lpAttrInfo) {
CJX_Node* jsObject = pPropOrChild->JSNode();
- (jsObject->*(lpAttrInfo->callback))(
- pReturnValue, true, (XFA_ATTRIBUTE)lpAttrInfo->eAttribute);
+ (jsObject->*(lpAttrInfo->callback))(pReturnValue, true,
+ lpAttrInfo->attribute);
return;
}
}
@@ -665,8 +665,7 @@ int32_t CFXJSE_Engine::ResolveObjects(CXFA_Object* refObject,
auto pValue = pdfium::MakeUnique<CFXJSE_Value>(m_pIsolate);
CJX_Object* jsObject = rndFind.m_Objects.front()->JSObject();
(jsObject->*(rndFind.m_pScriptAttribute->callback))(
- pValue.get(), false,
- (XFA_ATTRIBUTE)rndFind.m_pScriptAttribute->eAttribute);
+ pValue.get(), false, rndFind.m_pScriptAttribute->attribute);
rndFind.m_Objects.front() = ToObject(pValue.get(), nullptr);
}
if (!m_upObjectArray.empty())
diff --git a/fxjs/cjx_node.cpp b/fxjs/cjx_node.cpp
index 8bc54a7705..6933b5f14a 100644
--- a/fxjs/cjx_node.cpp
+++ b/fxjs/cjx_node.cpp
@@ -468,8 +468,8 @@ void CJX_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) {
auto pValue =
pdfium::MakeUnique<CFXJSE_Value>(pScriptContext->GetRuntime());
CJX_Object* jsObject = resolveNodeRS.objects.front()->JSObject();
- (jsObject->*(lpAttributeInfo->callback))(
- pValue.get(), false, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
+ (jsObject->*(lpAttributeInfo->callback))(pValue.get(), false,
+ lpAttributeInfo->attribute);
pArguments->GetReturnValue()->Assign(pValue.get());
} else {
pArguments->GetReturnValue()->SetNull();