summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorJun Fang <jun_fang@foxitsoftware.com>2015-11-10 18:29:18 +0800
committerJun Fang <jun_fang@foxitsoftware.com>2015-11-10 18:29:18 +0800
commitdf7f3663364fd4d6148d658c5bdb98ab2532fb8d (patch)
tree2f803bc57c5bcad8c1aa5e12122962e38e3adbe5 /fpdfsdk
parent956168fc8abf4046e94eef9ee76b0705a6248ac0 (diff)
downloadpdfium-df7f3663364fd4d6148d658c5bdb98ab2532fb8d.tar.xz
Merge to XFA: Support linearized loading
BUG=446715 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1353093003 . Conflicts: core/include/fpdfapi/fpdf_parser.h core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp samples/pdfium_test.cc testing/embedder_test.cpp testing/embedder_test.h Review URL: https://codereview.chromium.org/1412083010 .
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 4d96a7ca26..b8eca30315 100644
--- a/fpdfsdk/src/fpdf_dataavail.cpp
+++ b/fpdfsdk/src/fpdf_dataavail.cpp
@@ -90,10 +90,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);
}
@@ -125,8 +125,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);
@@ -134,14 +134,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();
}