diff options
author | thestig <thestig@chromium.org> | 2016-04-26 22:41:36 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-26 22:41:36 -0700 |
commit | 12168d764be266a209bc3fd15dbe4223732ae319 (patch) | |
tree | e4a10cbf579ae2b5023474f995fdffbdb5ee9959 /core/fpdfapi/fpdf_page/cpdf_form.cpp | |
parent | 931bf37379db7274d0e42f68cf358749cb05ba89 (diff) | |
download | pdfium-12168d764be266a209bc3fd15dbe4223732ae319.tar.xz |
CPDF_Document::LoadPattern() and friends always have a valid matrix.
So pass by const-ref instead of by pointer.
Review URL: https://codereview.chromium.org/1923153002
Diffstat (limited to 'core/fpdfapi/fpdf_page/cpdf_form.cpp')
-rw-r--r-- | core/fpdfapi/fpdf_page/cpdf_form.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/core/fpdfapi/fpdf_page/cpdf_form.cpp b/core/fpdfapi/fpdf_page/cpdf_form.cpp index 54698c60b6..570419f58f 100644 --- a/core/fpdfapi/fpdf_page/cpdf_form.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_form.cpp @@ -18,15 +18,13 @@ CPDF_Form::CPDF_Form(CPDF_Document* pDoc, CPDF_Dictionary* pParentResources) { m_pDocument = pDoc; m_pFormStream = pFormStream; - m_pFormDict = pFormStream ? pFormStream->GetDict() : NULL; + m_pFormDict = pFormStream ? pFormStream->GetDict() : nullptr; m_pResources = m_pFormDict->GetDictBy("Resources"); m_pPageResources = pPageResources; - if (!m_pResources) { + if (!m_pResources) m_pResources = pParentResources; - } - if (!m_pResources) { + if (!m_pResources) m_pResources = pPageResources; - } m_Transparency = 0; LoadTransInfo(); } @@ -34,23 +32,23 @@ CPDF_Form::CPDF_Form(CPDF_Document* pDoc, CPDF_Form::~CPDF_Form() {} void CPDF_Form::StartParse(CPDF_AllStates* pGraphicStates, - CFX_Matrix* pParentMatrix, + const CFX_Matrix* pParentMatrix, CPDF_Type3Char* pType3Char, int level) { - if (m_ParseState == CONTENT_PARSED || m_ParseState == CONTENT_PARSING) { + if (m_ParseState == CONTENT_PARSED || m_ParseState == CONTENT_PARSING) return; - } + m_pParser.reset(new CPDF_ContentParser); m_pParser->Start(this, pGraphicStates, pParentMatrix, pType3Char, level); m_ParseState = CONTENT_PARSING; } void CPDF_Form::ParseContent(CPDF_AllStates* pGraphicStates, - CFX_Matrix* pParentMatrix, + const CFX_Matrix* pParentMatrix, CPDF_Type3Char* pType3Char, int level) { StartParse(pGraphicStates, pParentMatrix, pType3Char, level); - ContinueParse(NULL); + ContinueParse(nullptr); } CPDF_Form* CPDF_Form::Clone() const { |