From ddcb6e7f47e2769fb4565bd4430ecb465a1f5417 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 5 Apr 2017 10:30:33 -0400 Subject: Add option to pdfium_test to dump structure elements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This Cl adds a --show-structure to pdfium_test which will dump out the StructElement items for the selected pages. Bug: pdfium:672 Change-Id: I90aceda71c13c54abfe4ac242a62375643cdfd9d Reviewed-on: https://pdfium-review.googlesource.com/3750 Reviewed-by: Nicolás Peña Commit-Queue: dsinclair --- public/cpp/fpdf_deleters.h | 5 +++++ public/fpdf_structtree.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'public') diff --git a/public/cpp/fpdf_deleters.h b/public/cpp/fpdf_deleters.h index 6754902a77..d56daf5c55 100644 --- a/public/cpp/fpdf_deleters.h +++ b/public/cpp/fpdf_deleters.h @@ -7,6 +7,7 @@ #include "public/fpdf_dataavail.h" #include "public/fpdf_formfill.h" +#include "public/fpdf_structtree.h" #include "public/fpdf_text.h" #include "public/fpdfview.h" @@ -38,4 +39,8 @@ struct FPDFPageDeleter { inline void operator()(FPDF_PAGE page) { FPDF_ClosePage(page); } }; +struct FPDFStructTreeDeleter { + inline void operator()(FPDF_STRUCTTREE tree) { FPDF_StructTree_Close(tree); } +}; + #endif // PUBLIC_CPP_FPDF_DELETERS_H_ diff --git a/public/fpdf_structtree.h b/public/fpdf_structtree.h index 82156365d9..6f85d4222e 100644 --- a/public/fpdf_structtree.h +++ b/public/fpdf_structtree.h @@ -117,7 +117,7 @@ FPDF_StructElement_GetChildAtIndex(FPDF_STRUCTELEMENT struct_element, int index); #ifdef __cplusplus -} +} // extern "C" #endif #endif // PUBLIC_FPDF_STRUCTTREE_H_ -- cgit v1.2.3