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