diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-30 20:50:20 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-30 20:50:20 +0000 |
commit | 0ae8e03cc2d310ba0ba19b878ea448f17a577cdb (patch) | |
tree | e52a04144fd4945e3c90aadaeb11f4892f52baa2 /xfa/fxfa/parser/cxfa_validatedata.cpp | |
parent | 9a2267d2531f4e75a6bcafb48abacfefe8a4a555 (diff) | |
download | pdfium-0ae8e03cc2d310ba0ba19b878ea448f17a577cdb.tar.xz |
Create CXFA_Node::NameToAttributeEnum
This CL removes XFA_GetAttributeEnumByName and moves the functionality
into CXFA_Node::NameToAttriuteEnum.
Change-Id: Id1484103c62bf7728d5406c22fb9d83fc0e032e1
Reviewed-on: https://pdfium-review.googlesource.com/19791
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_validatedata.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_validatedata.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/xfa/fxfa/parser/cxfa_validatedata.cpp b/xfa/fxfa/parser/cxfa_validatedata.cpp index 8b3f539d48..dd45b5295b 100644 --- a/xfa/fxfa/parser/cxfa_validatedata.cpp +++ b/xfa/fxfa/parser/cxfa_validatedata.cpp @@ -24,11 +24,10 @@ XFA_ATTRIBUTEENUM CXFA_ValidateData::GetFormatTest() const { } void CXFA_ValidateData::SetNullTest(const WideString& wsValue) { - const XFA_ATTRIBUTEENUMINFO* pInfo = - XFA_GetAttributeEnumByName(wsValue.AsStringView()); + pdfium::Optional<XFA_ATTRIBUTEENUM> item = + CXFA_Node::NameToAttributeEnum(wsValue.AsStringView()); m_pNode->JSNode()->SetEnum(XFA_Attribute::NullTest, - pInfo ? pInfo->eName : XFA_ATTRIBUTEENUM_Disabled, - false); + item ? *item : XFA_ATTRIBUTEENUM_Disabled, false); } XFA_ATTRIBUTEENUM CXFA_ValidateData::GetNullTest() const { |