diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-10-16 14:16:18 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-17 13:57:00 +0000 |
commit | f9068a5c08e55c1c16b14863abd8a089a327bc4d (patch) | |
tree | f8dc58642256506eb9051add027d06696836b811 /fpdfsdk/cpdfsdk_widget.cpp | |
parent | 90fffb31e2ec6cf66fe1b85b466cd2f12ee9c87f (diff) | |
download | pdfium-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 'fpdfsdk/cpdfsdk_widget.cpp')
-rw-r--r-- | fpdfsdk/cpdfsdk_widget.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp index c8bd4eaf08..0e121e8596 100644 --- a/fpdfsdk/cpdfsdk_widget.cpp +++ b/fpdfsdk/cpdfsdk_widget.cpp @@ -72,7 +72,7 @@ CPDFSDK_Widget::~CPDFSDK_Widget() {} #ifdef PDF_ENABLE_XFA CXFA_FFWidget* CPDFSDK_Widget::GetMixXFAWidget() const { CPDFXFA_Context* pContext = m_pPageView->GetFormFillEnv()->GetXFAContext(); - if (pContext->GetDocType() == XFA_DocType::Static) { + if (pContext->GetDocType() == XFA_DocType::kForegroundOnly) { if (!m_hMixXFAWidget) { if (CXFA_FFDocView* pDocView = pContext->GetXFADocView()) { WideString sName; @@ -95,7 +95,7 @@ CXFA_FFWidget* CPDFSDK_Widget::GetMixXFAWidget() const { CXFA_FFWidget* CPDFSDK_Widget::GetGroupMixXFAWidget() { CPDFXFA_Context* pContext = m_pPageView->GetFormFillEnv()->GetXFAContext(); - if (pContext->GetDocType() != XFA_DocType::Static) + if (pContext->GetDocType() != XFA_DocType::kForegroundOnly) return nullptr; CXFA_FFDocView* pDocView = pContext->GetXFADocView(); @@ -108,7 +108,7 @@ CXFA_FFWidget* CPDFSDK_Widget::GetGroupMixXFAWidget() { CXFA_FFWidgetHandler* CPDFSDK_Widget::GetXFAWidgetHandler() const { CPDFXFA_Context* pContext = m_pPageView->GetFormFillEnv()->GetXFAContext(); - if (pContext->GetDocType() != XFA_DocType::Static) + if (pContext->GetDocType() != XFA_DocType::kForegroundOnly) return nullptr; if (!m_pWidgetHandler) { @@ -507,7 +507,8 @@ bool CPDFSDK_Widget::IsAppearanceValid() { #ifdef PDF_ENABLE_XFA CPDFXFA_Context* pContext = m_pPageView->GetFormFillEnv()->GetXFAContext(); XFA_DocType nDocType = pContext->GetDocType(); - if (nDocType != XFA_DocType::PDF && nDocType != XFA_DocType::Static) + if (nDocType != XFA_DocType::kNone && + nDocType != XFA_DocType::kForegroundOnly) return true; #endif // PDF_ENABLE_XFA return CPDFSDK_BAAnnot::IsAppearanceValid(); |