From a3843c99e7a631b2fbf87bbc12834e61bfb7b6f2 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 12 Jun 2018 19:21:46 +0000 Subject: Remove some #ifdef XFA in favor of runtime checks. Make LoadDocumentImpl() logic match FPDFAvail_GetDocument() logic, so that the XFA extension is loaded before checking unsupported features. Add some comments along the way. Change-Id: I040e40fcca872f7c0a46e921bce1146f0fe42588 Reviewed-on: https://pdfium-review.googlesource.com/34931 Reviewed-by: dsinclair Commit-Queue: Tom Sepez --- core/fpdfapi/page/ipdf_page.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/fpdfapi') diff --git a/core/fpdfapi/page/ipdf_page.h b/core/fpdfapi/page/ipdf_page.h index 7c9fce7726..9b28559a94 100644 --- a/core/fpdfapi/page/ipdf_page.h +++ b/core/fpdfapi/page/ipdf_page.h @@ -20,6 +20,11 @@ class CPDFXFA_Page; // Interface implemented by both page types (CPDF_Page and CPDFXFA_Page). class IPDF_Page : public Retainable { public: + // There are actually 3 cases: a PDF page, an XFA page backed by a PDF page, + // and an XFA page not backed by a PDF page. AsPDFPage() will return the + // PDF page in either of the first two cases. AsXFAPage() is a straight + // downcast and is null if not either of the last two cases. Hence, both + // of these may return non-null on a given page. virtual CPDF_Page* AsPDFPage() = 0; virtual CPDFXFA_Page* AsXFAPage() = 0; -- cgit v1.2.3