Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: fpdfsdk/src/fpdf_dataavail.cpp

Issue 1415803002: XFA: add CPDFDocumentToFPDFDocument() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Address comments Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/include/fsdk_mgr.h ('k') | fpdfsdk/src/fpdfeditimg.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 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 "../../public/fpdf_dataavail.h" 7 #include "../../public/fpdf_dataavail.h"
8 #include "../../public/fpdf_formfill.h" 8 #include "../../public/fpdf_formfill.h"
9 #include "../include/fsdk_define.h" 9 #include "../include/fsdk_define.h"
10 #include "../include/fpdfxfa/fpdfxfa_doc.h" 10 #include "../include/fpdfxfa/fpdfxfa_doc.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 FX_DWORD err_code = pParser->StartAsynParse( 107 FX_DWORD err_code = pParser->StartAsynParse(
108 ((CFPDF_DataAvail*)avail)->m_pDataAvail->GetFileRead()); 108 ((CFPDF_DataAvail*)avail)->m_pDataAvail->GetFileRead());
109 if (err_code) { 109 if (err_code) {
110 delete pParser; 110 delete pParser;
111 ProcessParseError(err_code); 111 ProcessParseError(err_code);
112 return NULL; 112 return NULL;
113 } 113 }
114 ((CFPDF_DataAvail*)avail)->m_pDataAvail->SetDocument(pParser->GetDocument()); 114 ((CFPDF_DataAvail*)avail)->m_pDataAvail->SetDocument(pParser->GetDocument());
115 CheckUnSupportError(pParser->GetDocument(), FPDF_ERR_SUCCESS); 115 CheckUnSupportError(pParser->GetDocument(), FPDF_ERR_SUCCESS);
116 CPDF_Document* pPDFDoc = pParser->GetDocument(); 116 return FPDFDocumentFromCPDFDocument(pParser->GetDocument());
117 CPDFXFA_App* pApp = CPDFXFA_App::GetInstance();
118 return new CPDFXFA_Document(pPDFDoc, pApp);
119 } 117 }
120 118
121 DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc) { 119 DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc) {
122 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(doc); 120 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(doc);
123 return pDoc ? pDoc->GetParser()->GetFirstPageNo() : 0; 121 return pDoc ? pDoc->GetParser()->GetFirstPageNo() : 0;
124 } 122 }
125 123
126 DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail, 124 DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail,
127 int page_index, 125 int page_index,
128 FX_DOWNLOADHINTS* hints) { 126 FX_DOWNLOADHINTS* hints) {
(...skipping 10 matching lines...) Expand all
139 return -1; 137 return -1;
140 CFPDF_DownloadHintsWrap hints_wrap(hints); 138 CFPDF_DownloadHintsWrap hints_wrap(hints);
141 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap); 139 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap);
142 } 140 }
143 141
144 DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) { 142 DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) {
145 if (avail == NULL) 143 if (avail == NULL)
146 return -1; 144 return -1;
147 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF(); 145 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF();
148 } 146 }
OLDNEW
« no previous file with comments | « fpdfsdk/include/fsdk_mgr.h ('k') | fpdfsdk/src/fpdfeditimg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698