summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
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 /fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
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 'fpdfsdk/fpdfxfa/cpdfxfa_page.cpp')
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_page.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
index 87e003e147..fa10a925cd 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
@@ -65,10 +65,10 @@ bool CPDFXFA_Page::LoadPage() {
return false;
switch (m_pContext->GetDocType()) {
- case XFA_DocType::PDF:
- case XFA_DocType::Static:
+ case XFA_DocType::kNone:
+ case XFA_DocType::kForegroundOnly:
return LoadPDFPage();
- case XFA_DocType::Dynamic:
+ case XFA_DocType::kFull:
return LoadXFAPageView();
default:
return false;
@@ -90,13 +90,13 @@ float CPDFXFA_Page::GetPageWidth() const {
return 0.0f;
switch (m_pContext->GetDocType()) {
- case XFA_DocType::Dynamic: {
+ case XFA_DocType::kFull: {
if (m_pXFAPageView)
return m_pXFAPageView->GetPageViewRect().width;
break;
}
- case XFA_DocType::Static:
- case XFA_DocType::PDF: {
+ case XFA_DocType::kForegroundOnly:
+ case XFA_DocType::kNone: {
if (m_pPDFPage)
return m_pPDFPage->GetPageWidth();
break;
@@ -113,13 +113,13 @@ float CPDFXFA_Page::GetPageHeight() const {
return 0.0f;
switch (m_pContext->GetDocType()) {
- case XFA_DocType::PDF:
- case XFA_DocType::Static: {
+ case XFA_DocType::kNone:
+ case XFA_DocType::kForegroundOnly: {
if (m_pPDFPage)
return m_pPDFPage->GetPageHeight();
break;
}
- case XFA_DocType::Dynamic: {
+ case XFA_DocType::kFull: {
if (m_pXFAPageView)
return m_pXFAPageView->GetPageViewRect().height;
break;
@@ -183,15 +183,15 @@ CFX_Matrix CPDFXFA_Page::GetDisplayMatrix(int xPos,
return CFX_Matrix();
switch (m_pContext->GetDocType()) {
- case XFA_DocType::Dynamic: {
+ case XFA_DocType::kFull: {
if (m_pXFAPageView) {
return m_pXFAPageView->GetDisplayMatrix(
CFX_Rect(xPos, yPos, xSize, ySize), iRotate);
}
break;
}
- case XFA_DocType::PDF:
- case XFA_DocType::Static: {
+ case XFA_DocType::kNone:
+ case XFA_DocType::kForegroundOnly: {
if (m_pPDFPage)
return m_pPDFPage->GetDisplayMatrix(xPos, yPos, xSize, ySize, iRotate);
break;