| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/cxfa_validate.h" | 7 #include "xfa/fxfa/parser/cxfa_validate.h" |
| 8 | 8 |
| 9 #include "xfa/fxfa/parser/xfa_object.h" | 9 #include "xfa/fxfa/parser/xfa_object.h" |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 void CXFA_Validate::GetMessageText(CFX_WideString& wsMessage, | 42 void CXFA_Validate::GetMessageText(CFX_WideString& wsMessage, |
| 43 const CFX_WideString& wsMessageType) { | 43 const CFX_WideString& wsMessageType) { |
| 44 CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Message, FALSE); | 44 CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Message, FALSE); |
| 45 if (!pNode) | 45 if (!pNode) |
| 46 return; | 46 return; |
| 47 | 47 |
| 48 CXFA_Node* pItemNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); | 48 CXFA_Node* pItemNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); |
| 49 for (; pItemNode; | 49 for (; pItemNode; |
| 50 pItemNode = pItemNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { | 50 pItemNode = pItemNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { |
| 51 if (pItemNode->GetClassID() != XFA_Element::Text) | 51 if (pItemNode->GetElementType() != XFA_Element::Text) |
| 52 continue; | 52 continue; |
| 53 | 53 |
| 54 CFX_WideStringC wsName; | 54 CFX_WideStringC wsName; |
| 55 pItemNode->TryCData(XFA_ATTRIBUTE_Name, wsName); | 55 pItemNode->TryCData(XFA_ATTRIBUTE_Name, wsName); |
| 56 if (wsName.IsEmpty() || wsName == wsMessageType) { | 56 if (wsName.IsEmpty() || wsName == wsMessageType) { |
| 57 pItemNode->TryContent(wsMessage); | 57 pItemNode->TryContent(wsMessage); |
| 58 return; | 58 return; |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 } | 61 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 78 | 78 |
| 79 void CXFA_Validate::SetMessageText(CFX_WideString& wsMessage, | 79 void CXFA_Validate::SetMessageText(CFX_WideString& wsMessage, |
| 80 const CFX_WideString& wsMessageType) { | 80 const CFX_WideString& wsMessageType) { |
| 81 CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Message, TRUE); | 81 CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Message, TRUE); |
| 82 if (!pNode) | 82 if (!pNode) |
| 83 return; | 83 return; |
| 84 | 84 |
| 85 CXFA_Node* pItemNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); | 85 CXFA_Node* pItemNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); |
| 86 for (; pItemNode; | 86 for (; pItemNode; |
| 87 pItemNode = pItemNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { | 87 pItemNode = pItemNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { |
| 88 if (pItemNode->GetClassID() != XFA_Element::Text) | 88 if (pItemNode->GetElementType() != XFA_Element::Text) |
| 89 continue; | 89 continue; |
| 90 | 90 |
| 91 CFX_WideStringC wsName; | 91 CFX_WideStringC wsName; |
| 92 pItemNode->TryCData(XFA_ATTRIBUTE_Name, wsName); | 92 pItemNode->TryCData(XFA_ATTRIBUTE_Name, wsName); |
| 93 if (wsName.IsEmpty() || wsName == wsMessageType) { | 93 if (wsName.IsEmpty() || wsName == wsMessageType) { |
| 94 pItemNode->SetContent(wsMessage, wsMessage, FALSE); | 94 pItemNode->SetContent(wsMessage, wsMessage, FALSE); |
| 95 return; | 95 return; |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 CXFA_Node* pTextNode = pNode->CreateSamePacketNode(XFA_Element::Text); | 98 CXFA_Node* pTextNode = pNode->CreateSamePacketNode(XFA_Element::Text); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 110 } | 110 } |
| 111 | 111 |
| 112 void CXFA_Validate::GetPicture(CFX_WideString& wsPicture) { | 112 void CXFA_Validate::GetPicture(CFX_WideString& wsPicture) { |
| 113 if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Picture)) | 113 if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Picture)) |
| 114 pNode->TryContent(wsPicture); | 114 pNode->TryContent(wsPicture); |
| 115 } | 115 } |
| 116 | 116 |
| 117 CXFA_Script CXFA_Validate::GetScript() { | 117 CXFA_Script CXFA_Validate::GetScript() { |
| 118 return CXFA_Script(m_pNode->GetChild(0, XFA_Element::Script)); | 118 return CXFA_Script(m_pNode->GetChild(0, XFA_Element::Script)); |
| 119 } | 119 } |
| OLD | NEW |