| 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 |
| 11 CXFA_Validate::CXFA_Validate(CXFA_Node* pNode) : CXFA_Data(pNode) {} | 11 CXFA_Validate::CXFA_Validate(CXFA_Node* pNode) : CXFA_Data(pNode) {} |
| 12 | 12 |
| 13 int32_t CXFA_Validate::GetFormatTest() { | 13 int32_t CXFA_Validate::GetFormatTest() { |
| 14 return m_pNode->GetEnum(XFA_ATTRIBUTE_FormatTest); | 14 return m_pNode->GetEnum(XFA_ATTRIBUTE_FormatTest); |
| 15 } | 15 } |
| 16 | 16 |
| 17 FX_BOOL CXFA_Validate::SetTestValue(int32_t iType, | 17 FX_BOOL CXFA_Validate::SetTestValue(int32_t iType, |
| 18 CFX_WideString& wsValue, | 18 CFX_WideString& wsValue, |
| 19 XFA_ATTRIBUTEENUM eName) { | 19 XFA_ATTRIBUTEENUM eName) { |
| 20 const XFA_ATTRIBUTEENUMINFO* pInfo = | 20 const XFA_ATTRIBUTEENUMINFO* pInfo = |
| 21 XFA_GetAttributeEnumByName(wsValue.AsWideStringC()); | 21 XFA_GetAttributeEnumByName(wsValue.AsStringC()); |
| 22 if (pInfo) | 22 if (pInfo) |
| 23 eName = pInfo->eName; | 23 eName = pInfo->eName; |
| 24 | 24 |
| 25 m_pNode->SetEnum((XFA_ATTRIBUTE)iType, eName, FALSE); | 25 m_pNode->SetEnum((XFA_ATTRIBUTE)iType, eName, FALSE); |
| 26 return TRUE; | 26 return TRUE; |
| 27 } | 27 } |
| 28 | 28 |
| 29 FX_BOOL CXFA_Validate::SetNullTest(CFX_WideString wsValue) { | 29 FX_BOOL CXFA_Validate::SetNullTest(CFX_WideString wsValue) { |
| 30 return SetTestValue(XFA_ATTRIBUTE_NullTest, wsValue, | 30 return SetTestValue(XFA_ATTRIBUTE_NullTest, wsValue, |
| 31 XFA_ATTRIBUTEENUM_Disabled); | 31 XFA_ATTRIBUTEENUM_Disabled); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |