OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |