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

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

Issue 1153553003: Make CPDFXFA_App / IXFA_AppProvider saner (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Address comments. Created 5 years, 6 months 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/fpdfxfa/fpdfxfa_app.h ('k') | fpdfsdk/src/fpdfeditpage.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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 FX_DWORD err_code = pParser->StartAsynParse(((CFPDF_DataAvail*)avail)->m _pDataAvail->GetFileRead()); 131 FX_DWORD err_code = pParser->StartAsynParse(((CFPDF_DataAvail*)avail)->m _pDataAvail->GetFileRead());
132 if (err_code) { 132 if (err_code) {
133 delete pParser; 133 delete pParser;
134 ProcessParseError(err_code); 134 ProcessParseError(err_code);
135 return NULL; 135 return NULL;
136 } 136 }
137 ((CFPDF_DataAvail*)avail)->m_pDataAvail->SetDocument(pParser->GetDocumen t()); 137 ((CFPDF_DataAvail*)avail)->m_pDataAvail->SetDocument(pParser->GetDocumen t());
138 CheckUnSupportError(pParser->GetDocument(), FPDF_ERR_SUCCESS); 138 CheckUnSupportError(pParser->GetDocument(), FPDF_ERR_SUCCESS);
139 CPDF_Document* pPDFDoc = pParser->GetDocument(); 139 CPDF_Document* pPDFDoc = pParser->GetDocument();
140 140 » CPDFXFA_App* pApp = CPDFXFA_App::GetInstance();
141 » CPDFXFA_App* pApp = FPDFXFA_GetApp();
142 CPDFXFA_Document* pDocument = FX_NEW CPDFXFA_Document(pPDFDoc, pApp); 141 CPDFXFA_Document* pDocument = FX_NEW CPDFXFA_Document(pPDFDoc, pApp);
143 //pDocument->LoadXFADoc();
144
145 return pDocument; 142 return pDocument;
146 } 143 }
147 144
148 DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc) 145 DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc)
149 { 146 {
150 if (doc == NULL) return 0; 147 if (doc == NULL) return 0;
151 CPDF_Document* pDoc = ((CPDFXFA_Document*)doc)->GetPDFDoc(); 148 CPDF_Document* pDoc = ((CPDFXFA_Document*)doc)->GetPDFDoc();
152 return ((CPDF_Parser*)pDoc->GetParser())->GetFirstPageNo(); 149 return ((CPDF_Parser*)pDoc->GetParser())->GetFirstPageNo();
153 } 150 }
154 151
(...skipping 10 matching lines...) Expand all
165 CFPDF_DownloadHintsWrap hints_wrap(hints); 162 CFPDF_DownloadHintsWrap hints_wrap(hints);
166 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap) ; 163 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap) ;
167 } 164 }
168 165
169 DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) 166 DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail)
170 { 167 {
171 if (avail == NULL) return -1; 168 if (avail == NULL) return -1;
172 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF(); 169 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF();
173 170
174 } 171 }
OLDNEW
« no previous file with comments | « fpdfsdk/include/fpdfxfa/fpdfxfa_app.h ('k') | fpdfsdk/src/fpdfeditpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698