diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-27 19:58:46 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-27 19:58:46 +0000 |
commit | 9b93815edae6687d79d73c153c30d27e280c7571 (patch) | |
tree | bf56d32e5cebd4b5611a221115342badab72aafc /xfa/fxfa/parser/xfa_utils.cpp | |
parent | 9a48fd1aabf105b168f5d8fc26549ae0d41d002e (diff) | |
download | pdfium-9b93815edae6687d79d73c153c30d27e280c7571.tar.xz |
Add helpers to get attribute information
This CL adds helpers to CXFA_Node to get the type of an attribute and
the default value for a given attribute.
Change-Id: I8bf41f568fe1da650fb3df4232b63d2e48038e07
Reviewed-on: https://pdfium-review.googlesource.com/19330
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/xfa_utils.cpp')
-rw-r--r-- | xfa/fxfa/parser/xfa_utils.cpp | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/xfa/fxfa/parser/xfa_utils.cpp b/xfa/fxfa/parser/xfa_utils.cpp index 7fb5ff573d..2f5b479166 100644 --- a/xfa/fxfa/parser/xfa_utils.cpp +++ b/xfa/fxfa/parser/xfa_utils.cpp @@ -243,31 +243,6 @@ const XFA_NOTSUREATTRIBUTE* XFA_GetNotsureAttribute(XFA_Element eElement, return nullptr; } -bool XFA_GetAttributeDefaultValue(void*& pValue, - XFA_Element eElement, - XFA_Attribute eAttribute, - XFA_AttributeType eType, - uint32_t dwPacket) { - const XFA_ATTRIBUTEINFO* pInfo = XFA_GetAttributeByID(eAttribute); - if (!pInfo) - return false; - if (dwPacket && (dwPacket & pInfo->dwPackets) == 0) - return false; - if (pInfo->eType == eType) { - pValue = pInfo->pDefValue; - return true; - } - if (pInfo->eType == XFA_AttributeType::NotSure) { - const XFA_NOTSUREATTRIBUTE* pAttr = - XFA_GetNotsureAttribute(eElement, eAttribute, eType); - if (pAttr) { - pValue = pAttr->pValue; - return true; - } - } - return false; -} - const XFA_ATTRIBUTEINFO* XFA_GetAttributeByID(XFA_Attribute eName) { ASSERT(static_cast<uint8_t>(eName) < g_iXFAAttributeCount); return g_XFAAttributeData + static_cast<uint8_t>(eName); |