OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "core/fpdfapi/fpdf_page/cpdf_form.h" | 7 #include "core/fpdfapi/page/cpdf_form.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" | |
10 #include "core/fpdfapi/fpdf_page/cpdf_pageobjectholder.h" | |
11 #include "core/fpdfapi/fpdf_page/pageint.h" | |
12 #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" | 9 #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" |
13 #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" | 10 #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" |
| 11 #include "core/fpdfapi/page/cpdf_pageobject.h" |
| 12 #include "core/fpdfapi/page/cpdf_pageobjectholder.h" |
| 13 #include "core/fpdfapi/page/pageint.h" |
14 | 14 |
15 CPDF_Form::CPDF_Form(CPDF_Document* pDoc, | 15 CPDF_Form::CPDF_Form(CPDF_Document* pDoc, |
16 CPDF_Dictionary* pPageResources, | 16 CPDF_Dictionary* pPageResources, |
17 CPDF_Stream* pFormStream, | 17 CPDF_Stream* pFormStream, |
18 CPDF_Dictionary* pParentResources) { | 18 CPDF_Dictionary* pParentResources) { |
19 m_pDocument = pDoc; | 19 m_pDocument = pDoc; |
20 m_pFormStream = pFormStream; | 20 m_pFormStream = pFormStream; |
21 m_pFormDict = pFormStream ? pFormStream->GetDict() : nullptr; | 21 m_pFormDict = pFormStream ? pFormStream->GetDict() : nullptr; |
22 m_pResources = m_pFormDict->GetDictFor("Resources"); | 22 m_pResources = m_pFormDict->GetDictFor("Resources"); |
23 m_pPageResources = pPageResources; | 23 m_pPageResources = pPageResources; |
(...skipping 28 matching lines...) Expand all Loading... |
52 } | 52 } |
53 | 53 |
54 CPDF_Form* CPDF_Form::Clone() const { | 54 CPDF_Form* CPDF_Form::Clone() const { |
55 CPDF_Form* pCloneForm = | 55 CPDF_Form* pCloneForm = |
56 new CPDF_Form(m_pDocument, m_pPageResources, m_pFormStream, m_pResources); | 56 new CPDF_Form(m_pDocument, m_pPageResources, m_pFormStream, m_pResources); |
57 for (const auto& pObj : m_PageObjectList) | 57 for (const auto& pObj : m_PageObjectList) |
58 pCloneForm->m_PageObjectList.emplace_back(pObj->Clone()); | 58 pCloneForm->m_PageObjectList.emplace_back(pObj->Clone()); |
59 | 59 |
60 return pCloneForm; | 60 return pCloneForm; |
61 } | 61 } |
OLD | NEW |