From 22eb7ae54e4351f70a5a01b0130c8b0dc713586c Mon Sep 17 00:00:00 2001 From: Jane Liu Date: Mon, 26 Jun 2017 13:24:23 -0400 Subject: Modified CPDF_PageContentGenerator to work with both Form and Page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CPDF_PageContentGenerator currently only works for CPDF_Page objects. However, CPDF_Form is also a CPDF_PageObjectHolder like CPDF_Page, and content streams can be generated for form objects too. This CL modifies the content generator to work with both forms and pages. The content generator will later be used on annotation objects' CPDF_Form to simplify the code for annotation AP stream generation. Change-Id: I1c50bdf0329d1f5788db23286ac72750355a10ed Reviewed-on: https://pdfium-review.googlesource.com/6837 Commit-Queue: Nicolás Peña Reviewed-by: dsinclair Reviewed-by: Nicolás Peña --- core/fpdfapi/edit/cpdf_pagecontentgenerator.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/fpdfapi/edit/cpdf_pagecontentgenerator.h') diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator.h b/core/fpdfapi/edit/cpdf_pagecontentgenerator.h index 19a2faa6bf..2d90eb4465 100644 --- a/core/fpdfapi/edit/cpdf_pagecontentgenerator.h +++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator.h @@ -16,22 +16,22 @@ class CPDF_Document; class CPDF_ImageObject; -class CPDF_Page; class CPDF_PageObject; +class CPDF_PageObjectHolder; class CPDF_PathObject; class CPDF_TextObject; class CPDF_PageContentGenerator { public: - explicit CPDF_PageContentGenerator(CPDF_Page* pPage); + explicit CPDF_PageContentGenerator(CPDF_PageObjectHolder* pObjHolder); ~CPDF_PageContentGenerator(); void GenerateContent(); + bool ProcessPageObjects(std::ostringstream* buf); private: friend class CPDF_PageContentGeneratorTest; - bool ProcessPageObjects(std::ostringstream* buf); void ProcessPath(std::ostringstream* buf, CPDF_PathObject* pPathObj); void ProcessImage(std::ostringstream* buf, CPDF_ImageObject* pImageObj); void ProcessGraphics(std::ostringstream* buf, CPDF_PageObject* pPageObj); @@ -39,7 +39,7 @@ class CPDF_PageContentGenerator { CFX_ByteString RealizeResource(uint32_t dwResourceObjNum, const CFX_ByteString& bsType); - CFX_UnownedPtr const m_pPage; + CFX_UnownedPtr const m_pObjHolder; CFX_UnownedPtr const m_pDocument; std::vector> m_pageObjects; }; -- cgit v1.2.3