OLD | NEW |
---|---|
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_FXFA_PARSER_XFA_SCRIPT_H_ | 7 #ifndef XFA_FXFA_PARSER_XFA_SCRIPT_H_ |
8 #define XFA_FXFA_PARSER_XFA_SCRIPT_H_ | 8 #define XFA_FXFA_PARSER_XFA_SCRIPT_H_ |
9 | 9 |
10 #include "xfa/fxfa/include/fxfa.h" | 10 #include "xfa/fxfa/include/fxfa.h" |
(...skipping 20 matching lines...) Expand all Loading... | |
31 XFA_RESOVENODE_RSTYPE_Nodes, | 31 XFA_RESOVENODE_RSTYPE_Nodes, |
32 XFA_RESOVENODE_RSTYPE_Attribute, | 32 XFA_RESOVENODE_RSTYPE_Attribute, |
33 XFA_RESOLVENODE_RSTYPE_CreateNodeOne, | 33 XFA_RESOLVENODE_RSTYPE_CreateNodeOne, |
34 XFA_RESOLVENODE_RSTYPE_CreateNodeAll, | 34 XFA_RESOLVENODE_RSTYPE_CreateNodeAll, |
35 XFA_RESOLVENODE_RSTYPE_CreateNodeMidAll, | 35 XFA_RESOLVENODE_RSTYPE_CreateNodeMidAll, |
36 XFA_RESOVENODE_RSTYPE_ExistNodes, | 36 XFA_RESOVENODE_RSTYPE_ExistNodes, |
37 }; | 37 }; |
38 | 38 |
39 class CXFA_ValueArray : public CFX_ArrayTemplate<CFXJSE_Value*> { | 39 class CXFA_ValueArray : public CFX_ArrayTemplate<CFXJSE_Value*> { |
40 public: | 40 public: |
41 CXFA_ValueArray(v8::Isolate* pIsolate) : m_pIsolate(pIsolate) {} | 41 CXFA_ValueArray(v8::Isolate* pIsolate) : m_pIsolate(pIsolate) {} |
Tom Sepez
2016/06/02 18:20:23
nit: explicit
dsinclair
2016/06/02 18:58:05
Done.
| |
42 | 42 |
43 ~CXFA_ValueArray() { | 43 ~CXFA_ValueArray() { |
44 for (int32_t i = 0; i < GetSize(); i++) { | 44 for (int32_t i = 0; i < GetSize(); i++) |
45 delete GetAt(i); | 45 delete GetAt(i); |
46 } | |
47 } | 46 } |
48 | 47 |
49 void GetAttributeObject(CXFA_ObjArray& objArray) { | 48 void GetAttributeObject(CXFA_ObjArray& objArray) { |
50 for (int32_t i = 0; i < GetSize(); i++) { | 49 for (int32_t i = 0; i < GetSize(); i++) |
51 objArray.Add( | 50 objArray.Add(static_cast<CXFA_Object*>(GetAt(i)->ToHostObject(nullptr))); |
dsinclair
2016/06/02 15:27:52
Can't use CXFA_ScriptContext::ToObject here becaus
Tom Sepez
2016/06/02 18:20:22
That's usually a sign that the implementation shou
dsinclair
2016/06/02 18:58:05
Done.
| |
52 static_cast<CXFA_Object*>(FXJSE_Value_ToObject(GetAt(i), nullptr))); | |
53 } | |
54 } | 51 } |
55 | 52 |
56 v8::Isolate* m_pIsolate; | 53 v8::Isolate* m_pIsolate; |
57 }; | 54 }; |
58 | 55 |
59 struct XFA_RESOLVENODE_RS { | 56 struct XFA_RESOLVENODE_RS { |
60 XFA_RESOLVENODE_RS() | 57 XFA_RESOLVENODE_RS() |
61 : dwFlags(XFA_RESOVENODE_RSTYPE_Nodes), pScriptAttribute(NULL) {} | 58 : dwFlags(XFA_RESOVENODE_RSTYPE_Nodes), pScriptAttribute(NULL) {} |
62 | 59 |
63 ~XFA_RESOLVENODE_RS() { nodes.RemoveAll(); } | 60 ~XFA_RESOLVENODE_RS() { nodes.RemoveAll(); } |
(...skipping 10 matching lines...) Expand all Loading... | |
74 } | 71 } |
75 return valueArray.GetSize(); | 72 return valueArray.GetSize(); |
76 } | 73 } |
77 | 74 |
78 CXFA_ObjArray nodes; | 75 CXFA_ObjArray nodes; |
79 XFA_RESOVENODE_RSTYPE dwFlags; | 76 XFA_RESOVENODE_RSTYPE dwFlags; |
80 const XFA_SCRIPTATTRIBUTEINFO* pScriptAttribute; | 77 const XFA_SCRIPTATTRIBUTEINFO* pScriptAttribute; |
81 }; | 78 }; |
82 | 79 |
83 #endif // XFA_FXFA_PARSER_XFA_SCRIPT_H_ | 80 #endif // XFA_FXFA_PARSER_XFA_SCRIPT_H_ |
OLD | NEW |