summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_utils.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-27 18:10:47 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-27 18:10:47 +0000
commitf473672fd6305fe97c749bde3b92e3c9c90e88d0 (patch)
treefe1ec0af4f66a801c7a08fd762e61b065b89d4ec /xfa/fxfa/parser/xfa_utils.cpp
parent3636a854af15219fd679ed54207abcdad3283b9b (diff)
downloadpdfium-f473672fd6305fe97c749bde3b92e3c9c90e88d0.tar.xz
Generate XFA node classes
This CL adds concrete classes for each of the XFA Node types. Change-Id: Ieac8e2fcd5d13c61daa27fc63e3d80abb7aa7a29 Reviewed-on: https://pdfium-review.googlesource.com/18271 Reviewed-by: Tom Sepez <tsepez@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.cpp66
1 files changed, 0 insertions, 66 deletions
diff --git a/xfa/fxfa/parser/xfa_utils.cpp b/xfa/fxfa/parser/xfa_utils.cpp
index 588246fc55..b17a7535eb 100644
--- a/xfa/fxfa/parser/xfa_utils.cpp
+++ b/xfa/fxfa/parser/xfa_utils.cpp
@@ -243,72 +243,6 @@ const XFA_NOTSUREATTRIBUTE* XFA_GetNotsureAttribute(XFA_Element eElement,
return nullptr;
}
-const XFA_PROPERTY* XFA_GetPropertyOfElement(XFA_Element eElement,
- XFA_Element eProperty,
- uint32_t dwPacket) {
- int32_t iCount = 0;
- const XFA_PROPERTY* pProperties = XFA_GetElementProperties(eElement, iCount);
- if (!pProperties || iCount < 1)
- return nullptr;
-
- auto* it = std::find_if(pProperties, pProperties + iCount,
- [eProperty](const XFA_PROPERTY& prop) {
- return prop.eName == eProperty;
- });
- if (it == pProperties + iCount)
- return nullptr;
-
- const XFA_ELEMENTINFO* pInfo = XFA_GetElementByID(eProperty);
- ASSERT(pInfo);
- if (dwPacket != XFA_XDPPACKET_UNKNOWN && !(dwPacket & pInfo->dwPackets))
- return nullptr;
- return it;
-}
-
-const XFA_PROPERTY* XFA_GetElementProperties(XFA_Element eElement,
- int32_t& iCount) {
- if (eElement == XFA_Element::Unknown)
- return nullptr;
-
- const XFA_ELEMENTHIERARCHY* pElement =
- g_XFAElementPropertyIndex + static_cast<int32_t>(eElement);
- iCount = pElement->wCount;
- return g_XFAElementPropertyData + pElement->wStart;
-}
-
-const XFA_Attribute* XFA_GetElementAttributes(XFA_Element eElement,
- int32_t& iCount) {
- if (eElement == XFA_Element::Unknown)
- return nullptr;
-
- const XFA_ELEMENTHIERARCHY* pElement =
- g_XFAElementAttributeIndex + static_cast<int32_t>(eElement);
- iCount = pElement->wCount;
- return g_XFAElementAttributeData + pElement->wStart;
-}
-
-const XFA_ELEMENTINFO* XFA_GetElementByID(XFA_Element eName) {
- return eName != XFA_Element::Unknown
- ? g_XFAElementData + static_cast<int32_t>(eName)
- : nullptr;
-}
-
-XFA_Element XFA_GetElementTypeForName(const WideStringView& wsName) {
- if (wsName.IsEmpty())
- return XFA_Element::Unknown;
-
- uint32_t uHash = FX_HashCode_GetW(wsName, false);
- const XFA_ELEMENTINFO* pEnd = g_XFAElementData + g_iXFAElementCount;
- auto* pInfo =
- std::lower_bound(g_XFAElementData, pEnd, uHash,
- [](const XFA_ELEMENTINFO& info, uint32_t hash) {
- return info.uHash < hash;
- });
- if (pInfo < pEnd && pInfo->uHash == uHash)
- return pInfo->eName;
- return XFA_Element::Unknown;
-}
-
bool XFA_GetAttributeDefaultValue(void*& pValue,
XFA_Element eElement,
XFA_Attribute eAttribute,