From 799468b2917eab7ea5752b7db6b9ace9da96f4c3 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 5 Jun 2018 17:33:52 +0000 Subject: Move CPDF_PageObjectHolder::m_pFormStream to CPDF_Form. This member variable is only used in the CPDF_Form subclass. Change-Id: Ib922228e51f5c3b370027e565d04ffe47374a320 Reviewed-on: https://pdfium-review.googlesource.com/33830 Reviewed-by: Henrique Nakashima Commit-Queue: Lei Zhang --- core/fpdfapi/page/cpdf_contentparser.cpp | 2 +- core/fpdfapi/page/cpdf_form.cpp | 4 ++++ core/fpdfapi/page/cpdf_form.h | 4 ++++ core/fpdfapi/page/cpdf_pageobjectholder.h | 2 -- 4 files changed, 9 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/fpdfapi/page/cpdf_contentparser.cpp b/core/fpdfapi/page/cpdf_contentparser.cpp index c74a889ff6..82f288f22b 100644 --- a/core/fpdfapi/page/cpdf_contentparser.cpp +++ b/core/fpdfapi/page/cpdf_contentparser.cpp @@ -106,7 +106,7 @@ CPDF_ContentParser::CPDF_ContentParser(CPDF_Form* pForm, pState->SetSoftMask(nullptr); } RetainPtr pSingleStream = - pdfium::MakeRetain(pForm->m_pFormStream.Get()); + pdfium::MakeRetain(pForm->GetStream()); pSingleStream->LoadAllDataFiltered(); m_StreamArray.push_back(pSingleStream); } diff --git a/core/fpdfapi/page/cpdf_form.cpp b/core/fpdfapi/page/cpdf_form.cpp index a63d3ce96d..5132029072 100644 --- a/core/fpdfapi/page/cpdf_form.cpp +++ b/core/fpdfapi/page/cpdf_form.cpp @@ -50,3 +50,7 @@ void CPDF_Form::ParseContent(CPDF_AllStates* pGraphicStates, ContinueParse(nullptr); } + +const CPDF_Stream* CPDF_Form::GetStream() const { + return m_pFormStream.Get(); +} diff --git a/core/fpdfapi/page/cpdf_form.h b/core/fpdfapi/page/cpdf_form.h index 9f2987ddb6..155a6ae50f 100644 --- a/core/fpdfapi/page/cpdf_form.h +++ b/core/fpdfapi/page/cpdf_form.h @@ -32,8 +32,12 @@ class CPDF_Form : public CPDF_PageObjectHolder { CPDF_Type3Char* pType3Char, std::set* parsedSet); + const CPDF_Stream* GetStream() const; + private: std::unique_ptr> m_ParsedSet; + + UnownedPtr m_pFormStream; }; #endif // CORE_FPDFAPI_PAGE_CPDF_FORM_H_ diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.h b/core/fpdfapi/page/cpdf_pageobjectholder.h index 61004444c0..816a294149 100644 --- a/core/fpdfapi/page/cpdf_pageobjectholder.h +++ b/core/fpdfapi/page/cpdf_pageobjectholder.h @@ -84,8 +84,6 @@ class CPDF_PageObjectHolder { void Transform(const CFX_Matrix& matrix); CFX_FloatRect CalcBoundingBox() const; - // TODO(thestig): Move |m_pFormStream| into CPDF_Form. - UnownedPtr m_pFormStream; UnownedPtr m_pPageResources; UnownedPtr m_pResources; std::map m_GraphicsMap; -- cgit v1.2.3