summaryrefslogtreecommitdiff
path: root/samples/pdfium_test.cc
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-10-16 14:16:18 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-17 13:57:00 +0000
commitf9068a5c08e55c1c16b14863abd8a089a327bc4d (patch)
treef8dc58642256506eb9051add027d06696836b811 /samples/pdfium_test.cc
parent90fffb31e2ec6cf66fe1b85b466cd2f12ee9c87f (diff)
downloadpdfium-f9068a5c08e55c1c16b14863abd8a089a327bc4d.tar.xz
Convert XFA Doc Types to be more precise
The existing types are PDF, Dynamic & Static, which are poorly named since they don't really convey the fundamental differences between the types. "PDF" is confusing because PDFium only handles PDFs, and "Dynamic" & "Static" describe what a form may do, not how it is specified or some other fundamental difference. The terms "Dynamic" and "Static" were especially confusing, since XFAF documents must be static by definition, whereas full XFA documents can be either dynamic or static, depending on whether or not they change their layout. The types have been renamed to be clear that they are talking about the type of PDF document being described. "PDF" becomes "None", since this is used to indicate that there are no XFA forms in the document. "Dynamic" becomes "Full", since this indicates that the entire XFA spec is being used for the forms, specifically display layout is in the XML. "Static" has become "ForegroundOnly", since the form is specified using the XFAF (XFA Foreground) subset of the spec. The terms Full & Foreground come from the XFA spec. I would have preferred XFAF to have a different name, since it is the display/foreground layer that isn't XFA when using it. BUG=pdfium:917 Change-Id: I4335958c4a11d77d3bbe63b93602dd5bc14acb57 Reviewed-on: https://pdfium-review.googlesource.com/16010 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'samples/pdfium_test.cc')
-rw-r--r--samples/pdfium_test.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index 0c002a8c63..a638fd0822 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -1430,8 +1430,8 @@ void RenderPdf(const std::string& name,
form_callbacks.form_handle = form.get();
#ifdef PDF_ENABLE_XFA
- int doc_type = DOCTYPE_PDF;
- if (FPDF_HasXFAField(doc.get(), &doc_type) && doc_type != DOCTYPE_PDF &&
+ int doc_type = XFADOCTYPE_NONE;
+ if (FPDF_HasXFAField(doc.get(), &doc_type) && doc_type != XFADOCTYPE_NONE &&
!FPDF_LoadXFA(doc.get())) {
fprintf(stderr, "LoadXFA unsuccessful, continuing anyway.\n");
}