diff options
author | Jane Liu <janeliulwq@google.com> | 2017-06-26 13:24:23 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-06-27 17:31:27 +0000 |
commit | 22eb7ae54e4351f70a5a01b0130c8b0dc713586c (patch) | |
tree | 7e2db8f7220b8c643cf3dd5c62281508155f8780 /core/fpdfapi/edit/cpdf_pagecontentgenerator.h | |
parent | 62d5076d33ab2bbe0d70047ef98526cad427e631 (diff) | |
download | pdfium-22eb7ae54e4351f70a5a01b0130c8b0dc713586c.tar.xz |
Modified CPDF_PageContentGenerator to work with both Form and Page
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 <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/edit/cpdf_pagecontentgenerator.h')
-rw-r--r-- | core/fpdfapi/edit/cpdf_pagecontentgenerator.h | 8 |
1 files changed, 4 insertions, 4 deletions
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<CPDF_Page> const m_pPage; + CFX_UnownedPtr<CPDF_PageObjectHolder> const m_pObjHolder; CFX_UnownedPtr<CPDF_Document> const m_pDocument; std::vector<CFX_UnownedPtr<CPDF_PageObject>> m_pageObjects; }; |