summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorJun Fang <jun_fang@foxitsoftware.com>2015-11-02 13:45:35 +0800
committerJun Fang <jun_fang@foxitsoftware.com>2015-11-02 13:45:35 +0800
commitd946f3011984755b14d7dcfb05d572e870f93f3f (patch)
tree86fd77c65b920bf3e606c9048761a8e73ec0c6a2 /fpdfsdk
parentc88c42f317c0e94c4c7b98949bfe1a495aef07a9 (diff)
downloadpdfium-d946f3011984755b14d7dcfb05d572e870f93f3f.tar.xz
Support linearized loading
BUG=446715 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1353093003 .
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/src/fpdf_dataavail.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/fpdfsdk/src/fpdf_dataavail.cpp b/fpdfsdk/src/fpdf_dataavail.cpp
index 04e246b17e..960e497e23 100644
--- a/fpdfsdk/src/fpdf_dataavail.cpp
+++ b/fpdfsdk/src/fpdf_dataavail.cpp
@@ -87,10 +87,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 int STDCALL
+FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints) {
+ if (!avail || !hints)
+ return PDF_DATA_ERROR;
CFPDF_DownloadHintsWrap hints_wrap(hints);
return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsDocAvail(&hints_wrap);
}
@@ -124,8 +124,8 @@ DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc) {
DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail,
int page_index,
FX_DOWNLOADHINTS* hints) {
- if (avail == NULL || hints == NULL)
- return 0;
+ if (!avail || !hints)
+ return PDF_DATA_ERROR;
CFPDF_DownloadHintsWrap hints_wrap(hints);
return ((CFPDF_DataAvail*)avail)
->m_pDataAvail->IsPageAvail(page_index, &hints_wrap);
@@ -133,14 +133,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 PDF_FORM_ERROR;
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_LINEARIZATION_UNKNOWN;
return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF();
}