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

Unified Diff: testing/embedder_test.cpp

Issue 973673002: Check whether a pdf has XFA fields before loading XFA fields (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 10 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 | « samples/pdfium_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/embedder_test.cpp
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp
index ffe51192afe88bc8a178496c8d0e1075150f0d8f..6ef7c43f092e2e58532540b55ae7b74203dbb801 100644
--- a/testing/embedder_test.cpp
+++ b/testing/embedder_test.cpp
@@ -256,7 +256,12 @@ bool EmbedderTest::OpenDocument(const std::string& filename) {
if (!document_) {
return false;
}
- (void) FPDF_LoadXFA(document_);
+ int docType = DOCTYPE_PDF;
+ if (FPDF_HasXFAField(document_, docType))
+ {
+ if (docType != DOCTYPE_PDF)
+ (void) FPDF_LoadXFA(document_);
+ }
(void) FPDF_GetDocPermissions(document_);
(void) FPDFAvail_IsFormAvail(avail_, &hints_);
« no previous file with comments | « samples/pdfium_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698