From 84435fca8fb06feae5794eb9c8a1ac797708d069 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 12 Dec 2017 18:39:28 +0000 Subject: Move Script_Attribute_Integer to CJX_Object The CJX_Node isn't the root of the CJX hierarchy. This causes issues now that CJX_Object has child objects which don't inherit from CJX_Node. This CL moves Script_Attribute_Integer from CJX_Node to CJX_Object. Change-Id: Iec9d38440756827fa52561cb5938af4041738ad5 Reviewed-on: https://pdfium-review.googlesource.com/20951 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- fxjs/xfa/cjx_node.cpp | 10 ---------- fxjs/xfa/cjx_node.h | 3 --- fxjs/xfa/cjx_object.cpp | 10 ++++++++++ fxjs/xfa/cjx_object.h | 3 +++ 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'fxjs/xfa') diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp index d342604c11..8234fa6be7 100644 --- a/fxjs/xfa/cjx_node.cpp +++ b/fxjs/xfa/cjx_node.cpp @@ -595,16 +595,6 @@ void CJX_Node::Script_ModelClass_AliasNode(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) {} -void CJX_Node::Script_Attribute_Integer(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute) { - if (bSetting) { - SetInteger(eAttribute, pValue->ToInteger(), true); - return; - } - pValue->SetInteger(GetInteger(eAttribute)); -} - void CJX_Node::Script_Delta_CurrentValue(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) {} diff --git a/fxjs/xfa/cjx_node.h b/fxjs/xfa/cjx_node.h index 0b2a0b6f20..2cf41a0735 100644 --- a/fxjs/xfa/cjx_node.h +++ b/fxjs/xfa/cjx_node.h @@ -108,9 +108,6 @@ class CJX_Node : public CJX_Tree { void Script_Delta_Target(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); - void Script_Attribute_Integer(CFXJSE_Value* pValue, - bool bSetting, - XFA_Attribute eAttribute); void Script_Som_ValidationMessage(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp index 10c6078f17..4ba1d39394 100644 --- a/fxjs/xfa/cjx_object.cpp +++ b/fxjs/xfa/cjx_object.cpp @@ -883,3 +883,13 @@ void CJX_Object::Script_Attribute_BOOL(CFXJSE_Value* pValue, } pValue->SetString(GetBoolean(eAttribute) ? "1" : "0"); } + +void CJX_Object::Script_Attribute_Integer(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute) { + if (bSetting) { + SetInteger(eAttribute, pValue->ToInteger(), true); + return; + } + pValue->SetInteger(GetInteger(eAttribute)); +} diff --git a/fxjs/xfa/cjx_object.h b/fxjs/xfa/cjx_object.h index c16424fa3c..c191dcfd43 100644 --- a/fxjs/xfa/cjx_object.h +++ b/fxjs/xfa/cjx_object.h @@ -81,6 +81,9 @@ class CJX_Object { void Script_Attribute_BOOL(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); + void Script_Attribute_Integer(CFXJSE_Value* pValue, + bool bSetting, + XFA_Attribute eAttribute); pdfium::Optional TryInteger(XFA_Attribute eAttr, bool bUseDefault); bool SetInteger(XFA_Attribute eAttr, int32_t iValue, bool bNotify); -- cgit v1.2.3