summaryrefslogtreecommitdiff
path: root/xfa
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 /xfa
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 'xfa')
-rw-r--r--xfa/fxfa/cxfa_ffdoc.cpp6
-rw-r--r--xfa/fxfa/cxfa_ffdocview.cpp2
-rw-r--r--xfa/fxfa/fxfa.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp
index ee31a46f50..23b3df638e 100644
--- a/xfa/fxfa/cxfa_ffdoc.cpp
+++ b/xfa/fxfa/cxfa_ffdoc.cpp
@@ -160,7 +160,7 @@ CXFA_FFDoc::CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocEnvironment* pDocEnvironment)
m_pApp(pApp),
m_pNotify(nullptr),
m_pPDFDoc(nullptr),
- m_dwDocType(XFA_DocType::Static) {}
+ m_dwDocType(XFA_DocType::kForegroundOnly) {}
CXFA_FFDoc::~CXFA_FFDoc() {
CloseDoc();
@@ -244,7 +244,7 @@ void CXFA_FFDoc::StopLoad() {
m_pPDFFontMgr = pdfium::MakeUnique<CFGAS_PDFFontMgr>(
GetPDFDoc(), GetApp()->GetFDEFontMgr());
- m_dwDocType = XFA_DocType::Static;
+ m_dwDocType = XFA_DocType::kForegroundOnly;
CXFA_Node* pConfig = ToNode(
m_pDocumentParser->GetDocument()->GetXFAObject(XFA_HASHCODE_Config));
if (!pConfig)
@@ -265,7 +265,7 @@ void CXFA_FFDoc::StopLoad() {
WideString wsType;
if (pDynamicRender->TryContent(wsType) && wsType == L"required")
- m_dwDocType = XFA_DocType::Dynamic;
+ m_dwDocType = XFA_DocType::kFull;
}
CXFA_FFDocView* CXFA_FFDoc::CreateDocView() {
diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp
index 56dfeed3ca..0e895b676e 100644
--- a/xfa/fxfa/cxfa_ffdocview.cpp
+++ b/xfa/fxfa/cxfa_ffdocview.cpp
@@ -622,7 +622,7 @@ void CXFA_FFDocView::DestroyDocView() {
}
bool CXFA_FFDocView::IsStaticNotify() {
- return m_pDoc->GetDocType() == XFA_DocType::Static;
+ return m_pDoc->GetDocType() == XFA_DocType::kForegroundOnly;
}
void CXFA_FFDocView::AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc) {
diff --git a/xfa/fxfa/fxfa.h b/xfa/fxfa/fxfa.h
index 929594ff38..9f5432e3ad 100644
--- a/xfa/fxfa/fxfa.h
+++ b/xfa/fxfa/fxfa.h
@@ -40,8 +40,8 @@ class IXFA_WidgetIterator;
#define XFA_IDNo 3
#define XFA_IDYes 4
-// Note, values match fpdf_formfill.h DOCTYPE_* flags.
-enum class XFA_DocType { PDF = 0, Dynamic = 1, Static = 2 };
+// Note, values match fpdf_formfill.h XFADOCTYPE_* flags.
+enum class XFA_DocType { kNone = 0, kFull = 1, kForegroundOnly = 2 };
#define XFA_PARSESTATUS_StatusErr -3
#define XFA_PARSESTATUS_StreamErr -2