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

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

Issue 1520063002: Get rid of most instance of 'foo == NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@bstr_isnull
Patch Set: rebase Created 5 years 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/src/formfiller/FFL_CBA_Fontmap.cpp ('k') | fpdfsdk/src/fpdf_sysfontinfo.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 8
9 #include "fpdfsdk/include/fsdk_define.h" 9 #include "fpdfsdk/include/fsdk_define.h"
10 #include "public/fpdf_formfill.h" 10 #include "public/fpdf_formfill.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 DLLEXPORT int STDCALL 115 DLLEXPORT int STDCALL
116 FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints) { 116 FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints) {
117 if (!avail || !hints) 117 if (!avail || !hints)
118 return PDF_DATA_ERROR; 118 return PDF_DATA_ERROR;
119 CFPDF_DownloadHintsWrap hints_wrap(hints); 119 CFPDF_DownloadHintsWrap hints_wrap(hints);
120 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsDocAvail(&hints_wrap); 120 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsDocAvail(&hints_wrap);
121 } 121 }
122 122
123 DLLEXPORT FPDF_DOCUMENT STDCALL 123 DLLEXPORT FPDF_DOCUMENT STDCALL
124 FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password) { 124 FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password) {
125 if (avail == NULL) 125 if (!avail)
126 return NULL; 126 return NULL;
127 CPDF_Parser* pParser = new CPDF_Parser; 127 CPDF_Parser* pParser = new CPDF_Parser;
128 pParser->SetPassword(password); 128 pParser->SetPassword(password);
129 129
130 FX_DWORD err_code = pParser->StartAsynParse( 130 FX_DWORD err_code = pParser->StartAsynParse(
131 ((CFPDF_DataAvail*)avail)->m_pDataAvail->GetFileRead()); 131 ((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;
(...skipping 24 matching lines...) Expand all
160 return PDF_FORM_ERROR; 160 return PDF_FORM_ERROR;
161 CFPDF_DownloadHintsWrap hints_wrap(hints); 161 CFPDF_DownloadHintsWrap hints_wrap(hints);
162 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap); 162 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap);
163 } 163 }
164 164
165 DLLEXPORT int STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) { 165 DLLEXPORT int STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) {
166 if (!avail) 166 if (!avail)
167 return PDF_LINEARIZATION_UNKNOWN; 167 return PDF_LINEARIZATION_UNKNOWN;
168 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF(); 168 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF();
169 } 169 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp ('k') | fpdfsdk/src/fpdf_sysfontinfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698