diff options
author | Lei Zhang <thestig@chromium.org> | 2017-08-28 18:09:38 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-31 15:35:08 +0000 |
commit | af59cf16b40b6243a2194ced3e5f476ec655edb3 (patch) | |
tree | b88fac856dd70edb25d21e14b61b434f5e17cefa /core/fpdfapi/page | |
parent | d120920fe18bcfa3c102ecd0c7502c00d5f0425a (diff) | |
download | pdfium-af59cf16b40b6243a2194ced3e5f476ec655edb3.tar.xz |
Change CPDF_Form::ParseContent() to ParseContentWithParams().
Add a new ParseContent() method as a convenience to call
ParseContentWithParams() with the default parameters.
Change-Id: I274682845a72e125c3fc6299289edb760104ac4d
Reviewed-on: https://pdfium-review.googlesource.com/12250
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fpdfapi/page')
-rw-r--r-- | core/fpdfapi/page/cpdf_form.cpp | 12 | ||||
-rw-r--r-- | core/fpdfapi/page/cpdf_form.h | 11 | ||||
-rw-r--r-- | core/fpdfapi/page/cpdf_streamcontentparser.cpp | 3 | ||||
-rw-r--r-- | core/fpdfapi/page/cpdf_tilingpattern.cpp | 2 |
4 files changed, 17 insertions, 11 deletions
diff --git a/core/fpdfapi/page/cpdf_form.cpp b/core/fpdfapi/page/cpdf_form.cpp index c2170ac4e7..c5d9cbffcf 100644 --- a/core/fpdfapi/page/cpdf_form.cpp +++ b/core/fpdfapi/page/cpdf_form.cpp @@ -44,10 +44,14 @@ void CPDF_Form::StartParse(CPDF_AllStates* pGraphicStates, m_ParseState = CONTENT_PARSING; } -void CPDF_Form::ParseContent(CPDF_AllStates* pGraphicStates, - const CFX_Matrix* pParentMatrix, - CPDF_Type3Char* pType3Char, - int level) { +void CPDF_Form::ParseContent() { + ParseContentWithParams(nullptr, nullptr, nullptr, 0); +} + +void CPDF_Form::ParseContentWithParams(CPDF_AllStates* pGraphicStates, + const CFX_Matrix* pParentMatrix, + CPDF_Type3Char* pType3Char, + int level) { StartParse(pGraphicStates, pParentMatrix, pType3Char, level); ContinueParse(nullptr); } diff --git a/core/fpdfapi/page/cpdf_form.h b/core/fpdfapi/page/cpdf_form.h index 910f38fd08..2cce800f23 100644 --- a/core/fpdfapi/page/cpdf_form.h +++ b/core/fpdfapi/page/cpdf_form.h @@ -24,16 +24,17 @@ class CPDF_Form : public CPDF_PageObjectHolder { CPDF_Dictionary* pParentResources = nullptr); ~CPDF_Form() override; - void ParseContent(CPDF_AllStates* pGraphicStates, - const CFX_Matrix* pParentMatrix, - CPDF_Type3Char* pType3Char, - int level = 0); + void ParseContent(); + void ParseContentWithParams(CPDF_AllStates* pGraphicStates, + const CFX_Matrix* pParentMatrix, + CPDF_Type3Char* pType3Char, + int level); private: void StartParse(CPDF_AllStates* pGraphicStates, const CFX_Matrix* pParentMatrix, CPDF_Type3Char* pType3Char, - int level = 0); + int level); }; #endif // CORE_FPDFAPI_PAGE_CPDF_FORM_H_ diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp index a6af91d9ff..7bd6b50123 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp +++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp @@ -775,7 +775,8 @@ void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream) { status.m_GraphState = m_pCurStates->m_GraphState; status.m_ColorState = m_pCurStates->m_ColorState; status.m_TextState = m_pCurStates->m_TextState; - pFormObj->m_pForm->ParseContent(&status, nullptr, nullptr, m_Level + 1); + pFormObj->m_pForm->ParseContentWithParams(&status, nullptr, nullptr, + m_Level + 1); if (!m_pObjectHolder->BackgroundAlphaNeeded() && pFormObj->m_pForm->BackgroundAlphaNeeded()) { m_pObjectHolder->SetBackgroundAlphaNeeded(true); diff --git a/core/fpdfapi/page/cpdf_tilingpattern.cpp b/core/fpdfapi/page/cpdf_tilingpattern.cpp index 65542a27b5..a5252578a5 100644 --- a/core/fpdfapi/page/cpdf_tilingpattern.cpp +++ b/core/fpdfapi/page/cpdf_tilingpattern.cpp @@ -49,7 +49,7 @@ bool CPDF_TilingPattern::Load() { const CFX_Matrix& matrix = parent_matrix(); m_pForm = pdfium::MakeUnique<CPDF_Form>(document(), nullptr, pStream); - m_pForm->ParseContent(nullptr, &matrix, nullptr); + m_pForm->ParseContentWithParams(nullptr, &matrix, nullptr, 0); m_BBox = pDict->GetRectFor("BBox"); return true; } |