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

Unified Diff: fpdfsdk/src/fpdf_dataavail.cpp

Issue 1366593002: Support linearized loading (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/parser_int.h ('k') | fpdfsdk/src/fpdf_dataavail_embeddertest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdf_dataavail.cpp
diff --git a/fpdfsdk/src/fpdf_dataavail.cpp b/fpdfsdk/src/fpdf_dataavail.cpp
index 9ce298d0c545256d7c5abda89d8d31c660a9b05d..d901d1790ae279ce5178a2566daa8602eff8da98 100644
--- a/fpdfsdk/src/fpdf_dataavail.cpp
+++ b/fpdfsdk/src/fpdf_dataavail.cpp
@@ -86,10 +86,10 @@ DLLEXPORT void STDCALL FPDFAvail_Destroy(FPDF_AVAIL avail) {
delete (CFPDF_DataAvail*)avail;
}
-DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail,
- FX_DOWNLOADHINTS* hints) {
- if (avail == NULL || hints == NULL)
- return 0;
+DLLEXPORT FX_BOOL STDCALL
+FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints) {
+ if (!avail || !hints)
+ return true;
CFPDF_DownloadHintsWrap hints_wrap(hints);
return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsDocAvail(&hints_wrap);
}
@@ -120,11 +120,11 @@ DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc) {
return ((CPDF_Parser*)pDoc->GetParser())->GetFirstPageNo();
}
-DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail,
- int page_index,
- FX_DOWNLOADHINTS* hints) {
- if (avail == NULL || hints == NULL)
- return 0;
+DLLEXPORT FX_BOOL STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail,
+ int page_index,
+ FX_DOWNLOADHINTS* hints) {
+ if (!avail || !hints)
+ return true;
CFPDF_DownloadHintsWrap hints_wrap(hints);
return ((CFPDF_DataAvail*)avail)
->m_pDataAvail->IsPageAvail(page_index, &hints_wrap);
@@ -132,14 +132,14 @@ DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail,
DLLEXPORT int STDCALL FPDFAvail_IsFormAvail(FPDF_AVAIL avail,
FX_DOWNLOADHINTS* hints) {
- if (avail == NULL || hints == NULL)
- return -1;
+ if (!avail || !hints)
+ return PDFFORM_AVAIL;
CFPDF_DownloadHintsWrap hints_wrap(hints);
return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap);
}
-DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) {
- if (avail == NULL)
- return -1;
+DLLEXPORT int STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) {
+ if (!avail)
+ return PDF_FILE_UNKNOW;
return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF();
}
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/parser_int.h ('k') | fpdfsdk/src/fpdf_dataavail_embeddertest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698