summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-08 18:03:31 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-08 18:03:31 +0000
commit517807e01712c1d4400ec8dde0ab3d9b467bbf04 (patch)
tree002e1d0ecb9cf9bb138fda369509cd8fc46afdd3 /xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
parent6bccc1228ddfccae296f8f4236512caad7cbc1c9 (diff)
downloadpdfium-517807e01712c1d4400ec8dde0ab3d9b467bbf04.tar.xz
Convert XFA_UNIT to an enum class
This CL converts the XFA_UNIT enum to the XFA_Unit enum class. Change-Id: I6e0588f265e45b863ff1ecc170279f558fb6bd67 Reviewed-on: https://pdfium-review.googlesource.com/18090 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_layoutpagemgr.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_layoutpagemgr.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
index a982c5e17e..a24cce4979 100644
--- a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
+++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
@@ -330,13 +330,13 @@ bool CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) {
pPageArea->InsertChild(pContentArea, nullptr);
pContentArea->SetFlag(XFA_NodeFlag_Initialized, true);
pContentArea->JSNode()->SetMeasure(
- XFA_Attribute::X, CXFA_Measurement(0.25f, XFA_UNIT_In), false);
+ XFA_Attribute::X, CXFA_Measurement(0.25f, XFA_Unit::In), false);
pContentArea->JSNode()->SetMeasure(
- XFA_Attribute::Y, CXFA_Measurement(0.25f, XFA_UNIT_In), false);
+ XFA_Attribute::Y, CXFA_Measurement(0.25f, XFA_Unit::In), false);
pContentArea->JSNode()->SetMeasure(
- XFA_Attribute::W, CXFA_Measurement(8.0f, XFA_UNIT_In), false);
+ XFA_Attribute::W, CXFA_Measurement(8.0f, XFA_Unit::In), false);
pContentArea->JSNode()->SetMeasure(
- XFA_Attribute::H, CXFA_Measurement(10.5f, XFA_UNIT_In), false);
+ XFA_Attribute::H, CXFA_Measurement(10.5f, XFA_Unit::In), false);
}
CXFA_Node* pMedium = pPageArea->GetChild(0, XFA_Element::Medium, false);
if (!pMedium) {
@@ -348,9 +348,9 @@ bool CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) {
pPageArea->InsertChild(pMedium, nullptr);
pMedium->SetFlag(XFA_NodeFlag_Initialized, true);
pMedium->JSNode()->SetMeasure(XFA_Attribute::Short,
- CXFA_Measurement(8.5f, XFA_UNIT_In), false);
+ CXFA_Measurement(8.5f, XFA_Unit::In), false);
pMedium->JSNode()->SetMeasure(XFA_Attribute::Long,
- CXFA_Measurement(11.0f, XFA_UNIT_In), false);
+ CXFA_Measurement(11.0f, XFA_Unit::In), false);
}
return true;
}
@@ -472,7 +472,7 @@ float CXFA_LayoutPageMgr::GetAvailHeight() {
float fAvailHeight = pLayoutItem->m_pFormNode->JSNode()
->GetMeasure(XFA_Attribute::H)
- .ToUnit(XFA_UNIT_Pt);
+ .ToUnit(XFA_Unit::Pt);
if (fAvailHeight >= XFA_LAYOUT_FLOAT_PERCISION)
return fAvailHeight;
if (m_CurrentContainerRecordIter == m_ProposedContainerRecords.begin())
@@ -698,7 +698,7 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() {
if (rgUsedHeights[iCurContentAreaIndex] >
pContentAreaNode->JSNode()
->GetMeasure(XFA_Attribute::H)
- .ToUnit(XFA_UNIT_Pt) +
+ .ToUnit(XFA_Unit::Pt) +
XFA_LAYOUT_FLOAT_PERCISION) {
bUsable = false;
break;
@@ -1550,7 +1550,7 @@ bool CXFA_LayoutPageMgr::GetNextAvailContentHeight(float fChildHeight) {
if (pCurContentNode) {
float fNextContentHeight = pCurContentNode->JSNode()
->GetMeasure(XFA_Attribute::H)
- .ToUnit(XFA_UNIT_Pt);
+ .ToUnit(XFA_Unit::Pt);
return fNextContentHeight > fChildHeight;
}
@@ -1581,7 +1581,7 @@ bool CXFA_LayoutPageMgr::GetNextAvailContentHeight(float fChildHeight) {
if (pContentArea) {
float fNextContentHeight = pContentArea->JSNode()
->GetMeasure(XFA_Attribute::H)
- .ToUnit(XFA_UNIT_Pt);
+ .ToUnit(XFA_Unit::Pt);
if (fNextContentHeight > fChildHeight)
return true;
}
@@ -1593,7 +1593,7 @@ bool CXFA_LayoutPageMgr::GetNextAvailContentHeight(float fChildHeight) {
CXFA_Node* pContentArea =
pPageNode->GetFirstChildByClass(XFA_Element::ContentArea);
float fNextContentHeight =
- pContentArea->JSNode()->GetMeasure(XFA_Attribute::H).ToUnit(XFA_UNIT_Pt);
+ pContentArea->JSNode()->GetMeasure(XFA_Attribute::H).ToUnit(XFA_Unit::Pt);
if (fNextContentHeight < XFA_LAYOUT_FLOAT_PERCISION)
return true;
if (fNextContentHeight > fChildHeight)