diff options
author | dsinclair <dsinclair@chromium.org> | 2016-04-26 13:13:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-26 13:13:20 -0700 |
commit | d647a6b2e3fbd2711273637e5a56e659a113d2e9 (patch) | |
tree | 91c3a2865fe5abeed901d4a5c392afa95205eed4 /core/fpdfapi/fpdf_edit | |
parent | 518fd4c5ababbfbf28e010a9c27098e8f6669e4b (diff) | |
download | pdfium-d647a6b2e3fbd2711273637e5a56e659a113d2e9.tar.xz |
Remove several IPDF_ interfaces and CPDF_RenderModule.
This CL removes the interfaces:
* IPDF_ObjectRenderer
* IPDF_OCContext
* IPDF_RenderModule
* IPDF_PageModule
The CPDF_RenderModule was just wrapping new and delete calls. This Cl moves
those up to the callers and removes the CPDF_RenderModule class.
Review URL: https://codereview.chromium.org/1918323003
Diffstat (limited to 'core/fpdfapi/fpdf_edit')
-rw-r--r-- | core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp index addf9e2b0e..843c8f884b 100644 --- a/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp +++ b/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp @@ -17,33 +17,38 @@ #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_reference.h" +#include "core/fpdfapi/fpdf_render/render_int.h" #include "core/fpdfapi/include/cpdf_modulemgr.h" -#include "core/fpdfapi/ipdf_rendermodule.h" #include "third_party/base/stl_util.h" -CPDF_Document::CPDF_Document() : CPDF_IndirectObjectHolder(NULL) { - m_pRootDict = NULL; - m_pInfoDict = NULL; - m_bLinearized = FALSE; - m_dwFirstPageNo = 0; - m_dwFirstPageObjNum = 0; - m_pDocPage = CPDF_ModuleMgr::Get()->GetPageModule()->CreateDocData(this); - m_pDocRender = CPDF_ModuleMgr::Get()->GetRenderModule()->CreateDocData(this); -} +CPDF_Document::CPDF_Document() + : CPDF_IndirectObjectHolder(nullptr), + m_pRootDict(nullptr), + m_pInfoDict(nullptr), + m_bLinearized(FALSE), + m_dwFirstPageNo(0), + m_dwFirstPageObjNum(0), + m_pDocPage(new CPDF_DocPageData(this)), + m_pDocRender(new CPDF_DocRenderData(this)) {} + void CPDF_Document::CreateNewDoc() { ASSERT(!m_pRootDict && !m_pInfoDict); + m_pRootDict = new CPDF_Dictionary; m_pRootDict->SetAtName("Type", "Catalog"); int objnum = AddIndirectObject(m_pRootDict); + CPDF_Dictionary* pPages = new CPDF_Dictionary; pPages->SetAtName("Type", "Pages"); pPages->SetAtNumber("Count", 0); pPages->SetAt("Kids", new CPDF_Array); objnum = AddIndirectObject(pPages); m_pRootDict->SetAtReference("Pages", this, objnum); + m_pInfoDict = new CPDF_Dictionary; AddIndirectObject(m_pInfoDict); } + static const uint16_t g_FX_CP874Unicodes[128] = { 0x20AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x2026, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2018, |