summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_utils.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-30 21:56:00 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-30 21:56:00 +0000
commitf65f1d398804ec4702a3de691398902a0347461c (patch)
treea38ce902fa1181e9d00f4010a4abea8cf114c926 /xfa/fxfa/parser/xfa_utils.cpp
parente06c542ffdc7325cb3c430e59bd0d9df4ddb7776 (diff)
downloadpdfium-f65f1d398804ec4702a3de691398902a0347461c.tar.xz
Move packet information into simple parser
This CL moves the packet information into the anonymous namespace of the simple parser. There is slight duplication in that two of the namespace URIs have been copied into other files but this duplication allows for a bunch of simplification. Change-Id: I33092424ff4cb57eaf85da97a92fa6cf7b11f2ef Reviewed-on: https://pdfium-review.googlesource.com/20050 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/xfa_utils.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_utils.cpp24
1 files changed, 0 insertions, 24 deletions
diff --git a/xfa/fxfa/parser/xfa_utils.cpp b/xfa/fxfa/parser/xfa_utils.cpp
index a7b31aebec..529420a93a 100644
--- a/xfa/fxfa/parser/xfa_utils.cpp
+++ b/xfa/fxfa/parser/xfa_utils.cpp
@@ -185,27 +185,3 @@ const XFA_SCRIPTATTRIBUTEINFO* XFA_GetScriptAttributeByName(
}
return nullptr;
}
-
-const XFA_PACKETINFO* XFA_GetPacketByIndex(XFA_PacketType ePacket) {
- return g_XFAPacketData + static_cast<uint8_t>(ePacket);
-}
-
-const XFA_PACKETINFO* XFA_GetPacketByName(const WideStringView& wsName) {
- if (wsName.IsEmpty())
- return nullptr;
-
- uint32_t uHash = FX_HashCode_GetW(wsName, false);
- int32_t iStart = 0;
- int32_t iEnd = g_iXFAPacketCount - 1;
- do {
- int32_t iMid = (iStart + iEnd) / 2;
- const XFA_PACKETINFO* pInfo = g_XFAPacketData + iMid;
- if (uHash == pInfo->uHash)
- return pInfo;
- if (uHash < pInfo->uHash)
- iEnd = iMid - 1;
- else
- iStart = iMid + 1;
- } while (iStart <= iEnd);
- return nullptr;
-}