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 #include "xfa/fxfa/parser/xfa_object.h" | 7 #include "xfa/fxfa/parser/xfa_object.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 void XFA_CopyWideString(void*& pData) { | 36 void XFA_CopyWideString(void*& pData) { |
37 if (pData) { | 37 if (pData) { |
38 CFX_WideString* pNewData = new CFX_WideString(*(CFX_WideString*)pData); | 38 CFX_WideString* pNewData = new CFX_WideString(*(CFX_WideString*)pData); |
39 pData = pNewData; | 39 pData = pNewData; |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 XFA_MAPDATABLOCKCALLBACKINFO deleteWideStringCallBack = {XFA_DeleteWideString, | 43 XFA_MAPDATABLOCKCALLBACKINFO deleteWideStringCallBack = {XFA_DeleteWideString, |
44 XFA_CopyWideString}; | 44 XFA_CopyWideString}; |
45 | 45 |
46 XFA_ObjectType XFA_GetElementObjectType(XFA_Element eType) { | |
47 return XFA_GetElementByID(eType)->eObjectType; | |
48 } | |
49 | |
50 void XFA_DataNodeDeleteBindItem(void* pData) { | 46 void XFA_DataNodeDeleteBindItem(void* pData) { |
51 delete static_cast<CXFA_NodeArray*>(pData); | 47 delete static_cast<CXFA_NodeArray*>(pData); |
52 } | 48 } |
53 | 49 |
54 XFA_MAPDATABLOCKCALLBACKINFO deleteBindItemCallBack = { | 50 XFA_MAPDATABLOCKCALLBACKINFO deleteBindItemCallBack = { |
55 XFA_DataNodeDeleteBindItem, nullptr}; | 51 XFA_DataNodeDeleteBindItem, nullptr}; |
56 | 52 |
57 } // namespace | 53 } // namespace |
58 | 54 |
59 CXFA_Object::CXFA_Object(CXFA_Document* pDocument, | 55 CXFA_Object::CXFA_Object(CXFA_Document* pDocument, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 wsMessage.FormatV(wsFormat.c_str(), arg_ptr); | 97 wsMessage.FormatV(wsFormat.c_str(), arg_ptr); |
102 va_end(arg_ptr); | 98 va_end(arg_ptr); |
103 FXJSE_ThrowMessage( | 99 FXJSE_ThrowMessage( |
104 FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC()); | 100 FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC()); |
105 } | 101 } |
106 | 102 |
107 XFA_MAPMODULEDATA::XFA_MAPMODULEDATA() {} | 103 XFA_MAPMODULEDATA::XFA_MAPMODULEDATA() {} |
108 | 104 |
109 XFA_MAPMODULEDATA::~XFA_MAPMODULEDATA() {} | 105 XFA_MAPMODULEDATA::~XFA_MAPMODULEDATA() {} |
110 | 106 |
111 CXFA_Node::CXFA_Node(CXFA_Document* pDoc, uint16_t ePacket, XFA_Element eType) | 107 CXFA_Node::CXFA_Node(CXFA_Document* pDoc, |
112 : CXFA_Object(pDoc, XFA_GetElementObjectType(eType), eType), | 108 uint16_t ePacket, |
| 109 XFA_ObjectType oType, |
| 110 XFA_Element eType) |
| 111 : CXFA_Object(pDoc, oType, eType), |
113 m_pNext(nullptr), | 112 m_pNext(nullptr), |
114 m_pChild(nullptr), | 113 m_pChild(nullptr), |
115 m_pLastChild(nullptr), | 114 m_pLastChild(nullptr), |
116 m_pParent(nullptr), | 115 m_pParent(nullptr), |
117 m_pXMLNode(nullptr), | 116 m_pXMLNode(nullptr), |
118 m_ePacket(ePacket), | 117 m_ePacket(ePacket), |
119 m_uNodeFlags(XFA_NodeFlag_None), | 118 m_uNodeFlags(XFA_NodeFlag_None), |
120 m_dwNameHash(0), | 119 m_dwNameHash(0), |
121 m_pAuxNode(nullptr), | 120 m_pAuxNode(nullptr), |
122 m_pMapModuleData(nullptr) { | 121 m_pMapModuleData(nullptr) { |
(...skipping 5141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5264 return m_pAttachNode->InsertChild(pNewNode, pBeforeNode); | 5263 return m_pAttachNode->InsertChild(pNewNode, pBeforeNode); |
5265 } | 5264 } |
5266 FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) { | 5265 FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) { |
5267 return m_pAttachNode->RemoveChild(pNode); | 5266 return m_pAttachNode->RemoveChild(pNode); |
5268 } | 5267 } |
5269 CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) { | 5268 CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) { |
5270 return m_pAttachNode->GetChild( | 5269 return m_pAttachNode->GetChild( |
5271 iIndex, XFA_Element::Unknown, | 5270 iIndex, XFA_Element::Unknown, |
5272 m_pAttachNode->GetElementType() == XFA_Element::Subform); | 5271 m_pAttachNode->GetElementType() == XFA_Element::Subform); |
5273 } | 5272 } |
OLD | NEW |