summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdfview.cpp7
-rw-r--r--fpdfsdk/fpdfview_c_api_test.c2
2 files changed, 4 insertions, 5 deletions
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index af1d0db1af..47a92f1bca 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -39,6 +39,7 @@
#include "fpdfsdk/javascript/ijs_runtime.h"
#include "public/fpdf_edit.h"
#include "public/fpdf_ext.h"
+#include "public/fpdf_formfill.h"
#include "public/fpdf_progressive.h"
#include "third_party/base/allocator/partition_allocator/partition_alloc.h"
#include "third_party/base/numerics/safe_conversions_impl.h"
@@ -49,7 +50,6 @@
#include "fpdfsdk/fpdfxfa/cpdfxfa_page.h"
#include "fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h"
#include "fxbarcode/BC_Library.h"
-#include "public/fpdf_formfill.h"
#endif // PDF_ENABLE_XFA
#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_
@@ -565,14 +565,12 @@ FPDF_LoadDocument(FPDF_STRING file_path, FPDF_BYTESTRING password) {
password);
}
-#ifdef PDF_ENABLE_XFA
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_HasXFAField(FPDF_DOCUMENT document,
int* docType) {
if (!document)
return false;
- const CPDF_Document* pDoc =
- static_cast<CPDFXFA_Context*>(document)->GetPDFDoc();
+ const CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
if (!pDoc)
return false;
@@ -593,6 +591,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_HasXFAField(FPDF_DOCUMENT document,
return true;
}
+#ifdef PDF_ENABLE_XFA
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_LoadXFA(FPDF_DOCUMENT document) {
return document && static_cast<CPDFXFA_Context*>(document)->LoadXFADoc();
}
diff --git a/fpdfsdk/fpdfview_c_api_test.c b/fpdfsdk/fpdfview_c_api_test.c
index 996f48af16..211d7e0f6b 100644
--- a/fpdfsdk/fpdfview_c_api_test.c
+++ b/fpdfsdk/fpdfview_c_api_test.c
@@ -206,8 +206,8 @@ int CheckPDFiumCApi() {
CHK(FPDF_SetFormFieldHighlightAlpha);
CHK(FPDF_RemoveFormFieldHighlight);
CHK(FPDF_FFLDraw);
-#ifdef PDF_ENABLE_XFA
CHK(FPDF_HasXFAField);
+#ifdef PDF_ENABLE_XFA
CHK(FPDF_LoadXFA);
CHK(FPDF_Widget_Undo);
CHK(FPDF_Widget_Redo);