| 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 3962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3973 } | 3973 } |
| 3974 FX_BOOL CXFA_Node::SetObject(XFA_ATTRIBUTE eAttr, | 3974 FX_BOOL CXFA_Node::SetObject(XFA_ATTRIBUTE eAttr, |
| 3975 void* pData, | 3975 void* pData, |
| 3976 XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) { | 3976 XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) { |
| 3977 void* pKey = XFA_GetMapKey_Element(GetElementType(), eAttr); | 3977 void* pKey = XFA_GetMapKey_Element(GetElementType(), eAttr); |
| 3978 return SetUserData(pKey, pData, pCallbackInfo); | 3978 return SetUserData(pKey, pData, pCallbackInfo); |
| 3979 } | 3979 } |
| 3980 FX_BOOL CXFA_Node::TryObject(XFA_ATTRIBUTE eAttr, void*& pData) { | 3980 FX_BOOL CXFA_Node::TryObject(XFA_ATTRIBUTE eAttr, void*& pData) { |
| 3981 void* pKey = XFA_GetMapKey_Element(GetElementType(), eAttr); | 3981 void* pKey = XFA_GetMapKey_Element(GetElementType(), eAttr); |
| 3982 pData = GetUserData(pKey); | 3982 pData = GetUserData(pKey); |
| 3983 return pData != nullptr; | 3983 return !!pData; |
| 3984 } | 3984 } |
| 3985 FX_BOOL CXFA_Node::SetValue(XFA_ATTRIBUTE eAttr, | 3985 FX_BOOL CXFA_Node::SetValue(XFA_ATTRIBUTE eAttr, |
| 3986 XFA_ATTRIBUTETYPE eType, | 3986 XFA_ATTRIBUTETYPE eType, |
| 3987 void* pValue, | 3987 void* pValue, |
| 3988 bool bNotify) { | 3988 bool bNotify) { |
| 3989 void* pKey = XFA_GetMapKey_Element(GetElementType(), eAttr); | 3989 void* pKey = XFA_GetMapKey_Element(GetElementType(), eAttr); |
| 3990 OnChanging(eAttr, bNotify); | 3990 OnChanging(eAttr, bNotify); |
| 3991 SetMapModuleValue(pKey, pValue); | 3991 SetMapModuleValue(pKey, pValue); |
| 3992 OnChanged(eAttr, bNotify, FALSE); | 3992 OnChanged(eAttr, bNotify, FALSE); |
| 3993 if (IsNeedSavingXMLNode()) { | 3993 if (IsNeedSavingXMLNode()) { |
| (...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5072 MoveBufferMapData(pSrcChild, pDstChild, pKey, TRUE); | 5072 MoveBufferMapData(pSrcChild, pDstChild, pKey, TRUE); |
| 5073 } | 5073 } |
| 5074 } | 5074 } |
| 5075 pSrcModule->MoveBufferMapData(pDstModule, pKey); | 5075 pSrcModule->MoveBufferMapData(pDstModule, pKey); |
| 5076 } | 5076 } |
| 5077 | 5077 |
| 5078 CXFA_ThisProxy::CXFA_ThisProxy(CXFA_Node* pThisNode, CXFA_Node* pScriptNode) | 5078 CXFA_ThisProxy::CXFA_ThisProxy(CXFA_Node* pThisNode, CXFA_Node* pScriptNode) |
| 5079 : CXFA_Object(pThisNode->GetDocument(), | 5079 : CXFA_Object(pThisNode->GetDocument(), |
| 5080 XFA_ObjectType::VariablesThis, | 5080 XFA_ObjectType::VariablesThis, |
| 5081 XFA_Element::Unknown), | 5081 XFA_Element::Unknown), |
| 5082 m_pThisNode(NULL), | 5082 m_pThisNode(nullptr), |
| 5083 m_pScriptNode(NULL) { | 5083 m_pScriptNode(nullptr) { |
| 5084 m_pThisNode = pThisNode; | 5084 m_pThisNode = pThisNode; |
| 5085 m_pScriptNode = pScriptNode; | 5085 m_pScriptNode = pScriptNode; |
| 5086 } | 5086 } |
| 5087 | 5087 |
| 5088 CXFA_ThisProxy::~CXFA_ThisProxy() {} | 5088 CXFA_ThisProxy::~CXFA_ThisProxy() {} |
| 5089 | 5089 |
| 5090 CXFA_Node* CXFA_ThisProxy::GetThisNode() const { | 5090 CXFA_Node* CXFA_ThisProxy::GetThisNode() const { |
| 5091 return m_pThisNode; | 5091 return m_pThisNode; |
| 5092 } | 5092 } |
| 5093 | 5093 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5267 return m_pAttachNode->InsertChild(pNewNode, pBeforeNode); | 5267 return m_pAttachNode->InsertChild(pNewNode, pBeforeNode); |
| 5268 } | 5268 } |
| 5269 FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) { | 5269 FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) { |
| 5270 return m_pAttachNode->RemoveChild(pNode); | 5270 return m_pAttachNode->RemoveChild(pNode); |
| 5271 } | 5271 } |
| 5272 CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) { | 5272 CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) { |
| 5273 return m_pAttachNode->GetChild( | 5273 return m_pAttachNode->GetChild( |
| 5274 iIndex, XFA_Element::Unknown, | 5274 iIndex, XFA_Element::Unknown, |
| 5275 m_pAttachNode->GetElementType() == XFA_Element::Subform); | 5275 m_pAttachNode->GetElementType() == XFA_Element::Subform); |
| 5276 } | 5276 } |
| OLD | NEW |