diff options
author | spelchat <spelchat@chromium.org> | 2015-12-30 14:06:54 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-30 22:07:51 +0000 |
commit | a69e93f6ac1ee1a6e3554ea61e0461a83c75081d (patch) | |
tree | 02139a0f7f780e49c5802659e810dfae65515ed5 /pdf | |
parent | d6da931d8f49e4d4afc3272389ab71af75e75fc1 (diff) | |
download | chromium_src-a69e93f6ac1ee1a6e3554ea61e0461a83c75081d.zip chromium_src-a69e93f6ac1ee1a6e3554ea61e0461a83c75081d.tar.gz chromium_src-a69e93f6ac1ee1a6e3554ea61e0461a83c75081d.tar.bz2 |
Call FPDFAvail_IsFormAvail() before creating form.
FPDFAvail_IsFormAvail() must be called before the PDF form is
initialized if new data was downloaded since the document was created.
BUG=572943
Review URL: https://codereview.chromium.org/1556603002
Cr-Commit-Position: refs/heads/master@{#367191}
Diffstat (limited to 'pdf')
-rw-r--r-- | pdf/pdfium/pdfium_engine.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc index 90c4df5..6506d8c 100644 --- a/pdf/pdfium/pdfium_engine.cc +++ b/pdf/pdfium/pdfium_engine.cc @@ -2599,12 +2599,13 @@ void PDFiumEngine::ContinueLoadingDocument( permissions_handler_revision_ = FPDF_GetSecurityHandlerRevision(doc_); if (!form_) { - // Only returns 0 when data isn't available. If form data is downloaded, or - // if this isn't a form, returns positive values. - if (!doc_loader_.IsDocumentComplete() && - !FPDFAvail_IsFormAvail(fpdf_availability_, &download_hints_)) { + int form_status = + FPDFAvail_IsFormAvail(fpdf_availability_, &download_hints_); + bool doc_complete = doc_loader_.IsDocumentComplete(); + // Try again if the data is not available and the document hasn't finished + // downloading. + if (form_status == PDF_FORM_NOTAVAIL && !doc_complete) return; - } form_ = FPDFDOC_InitFormFillEnvironment( doc_, static_cast<FPDF_FORMFILLINFO*>(this)); |