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

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

Issue 1383933003: XFA: Remove checks for new returning NULL in fpdfsdk. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rebase Created 5 years, 2 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 | « no previous file | fpdfsdk/src/fpdf_flatten.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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 CPDF_Document* pPDFDoc = pParser->GetDocument();
117 CPDFXFA_App* pApp = CPDFXFA_App::GetInstance(); 117 CPDFXFA_App* pApp = CPDFXFA_App::GetInstance();
118 CPDFXFA_Document* pDocument = new CPDFXFA_Document(pPDFDoc, pApp); 118 return new CPDFXFA_Document(pPDFDoc, pApp);
119 return pDocument;
120 } 119 }
121 120
122 DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc) { 121 DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc) {
123 if (doc == NULL) 122 if (doc == NULL)
124 return 0; 123 return 0;
125 CPDF_Document* pDoc = ((CPDFXFA_Document*)doc)->GetPDFDoc(); 124 CPDF_Document* pDoc = ((CPDFXFA_Document*)doc)->GetPDFDoc();
126 return ((CPDF_Parser*)pDoc->GetParser())->GetFirstPageNo(); 125 return ((CPDF_Parser*)pDoc->GetParser())->GetFirstPageNo();
127 } 126 }
128 127
129 DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail, 128 DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail,
(...skipping 12 matching lines...) Expand all
142 return -1; 141 return -1;
143 CFPDF_DownloadHintsWrap hints_wrap(hints); 142 CFPDF_DownloadHintsWrap hints_wrap(hints);
144 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap); 143 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap);
145 } 144 }
146 145
147 DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) { 146 DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) {
148 if (avail == NULL) 147 if (avail == NULL)
149 return -1; 148 return -1;
150 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF(); 149 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF();
151 } 150 }
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/src/fpdf_flatten.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698