Use FPDF_StructElement_GetMarkedContentIdAtIndex() in pdfium_test
Change the --show-structure code to show all the MCIDs for a struct
element by using FPDF_StructElement_GetMarkedContentIdAtIndex() instead
of FPDF_StructElement_GetMarkedContentID().
Change-Id: I681939747e95666b56193a1e93c6dcba855d045c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/122030
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@google.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/testing/helpers/dump.cc b/testing/helpers/dump.cc
index a5b1645..f2ef62e 100644
--- a/testing/helpers/dump.cc
+++ b/testing/helpers/dump.cc
@@ -178,9 +178,12 @@
ConvertToWString(buf, len).c_str());
}
- int mcid = FPDF_StructElement_GetMarkedContentID(child);
- if (mcid != -1) {
- printf("%*s MCID: %d\n", indent * 2, "", mcid);
+ const int mcid_count = FPDF_StructElement_GetMarkedContentIdCount(child);
+ for (int i = 0; i < mcid_count; ++i) {
+ int mcid = FPDF_StructElement_GetMarkedContentIdAtIndex(child, i);
+ if (mcid != -1) {
+ printf("%*s MCID%d: %d\n", indent * 2, "", i, mcid);
+ }
}
FPDF_STRUCTELEMENT parent = FPDF_StructElement_GetParent(child);