From 168c763539e70bea450701470c47a8991f578336 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 4 Jun 2018 18:07:47 +0000 Subject: Revert "Make common page base class for XFA and non-XFA." This reverts commit d06cc38b76685b002c51b227ae43b8314d926ad8. Reason for revert: blocking previous revert Change-Id: I74f8b80852c671440cca5fabef30e69cde9e2063 Reviewed-on: https://pdfium-review.googlesource.com/33713 Reviewed-by: Tom Sepez Commit-Queue: Tom Sepez --- fpdfsdk/cpdfsdk_helpers.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'fpdfsdk/cpdfsdk_helpers.h') diff --git a/fpdfsdk/cpdfsdk_helpers.h b/fpdfsdk/cpdfsdk_helpers.h index 98d7e45e5f..fae7ef0782 100644 --- a/fpdfsdk/cpdfsdk_helpers.h +++ b/fpdfsdk/cpdfsdk_helpers.h @@ -7,7 +7,6 @@ #ifndef FPDFSDK_CPDFSDK_HELPERS_H_ #define FPDFSDK_CPDFSDK_HELPERS_H_ -#include "core/fpdfapi/page/cpdf_page.h" #include "core/fpdfapi/parser/cpdf_parser.h" #include "core/fxge/dib/cfx_dibitmap.h" #include "core/fxge/fx_dib.h" @@ -30,6 +29,7 @@ class CPDF_ContentMarkItem; class CPDF_Object; class CPDF_Font; class CPDF_LinkExtract; +class CPDF_Page; class CPDF_PageObject; class CPDF_PageRenderContext; class CPDF_PathObject; @@ -47,9 +47,18 @@ class CPDFXFA_Page; class CXFA_FFWidget; #endif // PDF_ENABLE_XFA +// Object types for public FPDF_ types; these correspond to next layer down +// from fpdfsdk. For master, these are CPDF_ types, but for XFA, these are +// CPDFXFA_ types. +#ifdef PDF_ENABLE_XFA +using UnderlyingPageType = CPDFXFA_Page; +#else // PDF_ENABLE_XFA +using UnderlyingPageType = CPDF_Page; +#endif // PDF_ENABLE_XFA + // Conversions to/from underlying types. -IPDF_Page* IPDFPageFromFPDFPage(FPDF_PAGE page); -FPDF_PAGE FPDFPageFromIPDFPage(IPDF_Page* page); +UnderlyingPageType* UnderlyingFromFPDFPage(FPDF_PAGE page); +FPDF_PAGE FPDFPageFromUnderlying(UnderlyingPageType* page); CPDF_Page* CPDFPageFromFPDFPage(FPDF_PAGE page); FPDF_DOCUMENT FPDFDocumentFromCPDFDocument(CPDF_Document* doc); CPDF_Document* CPDFDocumentFromFPDFDocument(FPDF_DOCUMENT doc); -- cgit v1.2.3