Generate enum XFA_XDPPACKET from same table as XFA_PacketType.

Since the enum values in XFA_XDPPACKET are 1:1 with those in
XFA_PacketType, and XFA_PacketType is generated by inclusion,
then XFA_XDPPACKET can also be generated by inclusion.

-- Case of XDP changes to Xdp in two places.

Change-Id: I02608ad6a88ae858b991fd8bfd61a5c6b6a93b71
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/84110
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/xfa/fxfa/fxfa_basic.h b/xfa/fxfa/fxfa_basic.h
index b38d336..d954600 100644
--- a/xfa/fxfa/fxfa_basic.h
+++ b/xfa/fxfa/fxfa_basic.h
@@ -50,26 +50,11 @@
 
 enum XFA_XDPPACKET {
   XFA_XDPPACKET_UNKNOWN = 0,
-  XFA_XDPPACKET_Config = 1 << static_cast<uint8_t>(XFA_PacketType::Config),
-  XFA_XDPPACKET_Template = 1 << static_cast<uint8_t>(XFA_PacketType::Template),
-  XFA_XDPPACKET_Datasets = 1 << static_cast<uint8_t>(XFA_PacketType::Datasets),
-  XFA_XDPPACKET_Form = 1 << static_cast<uint8_t>(XFA_PacketType::Form),
-  XFA_XDPPACKET_LocaleSet = 1
-                            << static_cast<uint8_t>(XFA_PacketType::LocaleSet),
-  XFA_XDPPACKET_ConnectionSet =
-      1 << static_cast<uint8_t>(XFA_PacketType::ConnectionSet),
-  XFA_XDPPACKET_SourceSet = 1
-                            << static_cast<uint8_t>(XFA_PacketType::SourceSet),
-  XFA_XDPPACKET_Xdc = 1 << static_cast<uint8_t>(XFA_PacketType::Xdc),
-  XFA_XDPPACKET_Pdf = 1 << static_cast<uint8_t>(XFA_PacketType::Pdf),
-  XFA_XDPPACKET_Xfdf = 1 << static_cast<uint8_t>(XFA_PacketType::Xfdf),
-  XFA_XDPPACKET_Xmpmeta = 1 << static_cast<uint8_t>(XFA_PacketType::Xmpmeta),
-  XFA_XDPPACKET_Signature = 1
-                            << static_cast<uint8_t>(XFA_PacketType::Signature),
-  XFA_XDPPACKET_Stylesheet =
-      1 << static_cast<uint8_t>(XFA_PacketType::Stylesheet),
-  XFA_XDPPACKET_USER = 1 << static_cast<uint8_t>(XFA_PacketType::User),
-  XFA_XDPPACKET_XDP = 1 << static_cast<uint8_t>(XFA_PacketType::Xdp)
+#undef PCKT____
+#define PCKT____(a, b, c, d, e, f) \
+  XFA_XDPPACKET_##c = 1 << static_cast<uint8_t>(XFA_PacketType::c),
+#include "xfa/fxfa/parser/packets.inc"
+#undef PCKT____
 };
 
 enum XFA_XDPPACKET_FLAGS {
diff --git a/xfa/fxfa/parser/cxfa_packet.cpp b/xfa/fxfa/parser/cxfa_packet.cpp
index 141df4d..9514530 100644
--- a/xfa/fxfa/parser/cxfa_packet.cpp
+++ b/xfa/fxfa/parser/cxfa_packet.cpp
@@ -12,7 +12,7 @@
 CXFA_Packet::CXFA_Packet(CXFA_Document* doc, XFA_PacketType packet)
     : CXFA_Node(doc,
                 packet,
-                XFA_XDPPACKET_XDP,
+                XFA_XDPPACKET_Xdp,
                 XFA_ObjectType::NodeC,
                 XFA_Element::Packet,
                 {},
diff --git a/xfa/fxfa/parser/cxfa_xfa.cpp b/xfa/fxfa/parser/cxfa_xfa.cpp
index e38172c..b9abf40 100644
--- a/xfa/fxfa/parser/cxfa_xfa.cpp
+++ b/xfa/fxfa/parser/cxfa_xfa.cpp
@@ -21,7 +21,7 @@
 CXFA_Xfa::CXFA_Xfa(CXFA_Document* doc, XFA_PacketType packet)
     : CXFA_Node(doc,
                 packet,
-                XFA_XDPPACKET_XDP,
+                XFA_XDPPACKET_Xdp,
                 XFA_ObjectType::ModelNode,
                 XFA_Element::Xfa,
                 {},