summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_fffield.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-30 22:06:40 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-30 22:06:40 +0000
commitd02c4d8b1199799340833ebfc79d7092f9b2d043 (patch)
tree46c5ad3489153bf600529314fdbcf8c772622a24 /xfa/fxfa/cxfa_fffield.cpp
parentf65f1d398804ec4702a3de691398902a0347461c (diff)
downloadpdfium-d02c4d8b1199799340833ebfc79d7092f9b2d043.tar.xz
Rename XFA_ATTRIBUTEENUM to XFA_AttributeEnum enum class
This CL changes the enum XFA_ATTRIBUTEENUM to an enum class XFA_AttributeEnum. Methods expecting an int32 have been updated to take or return the XFA_AttrbuteEnum type. Change-Id: I268453949545fe2dd3eae707be4d9cc7edeff763 Reviewed-on: https://pdfium-review.googlesource.com/20070 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_fffield.cpp')
-rw-r--r--xfa/fxfa/cxfa_fffield.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/xfa/fxfa/cxfa_fffield.cpp b/xfa/fxfa/cxfa_fffield.cpp
index 1f4cf56c1d..e377fe1d2d 100644
--- a/xfa/fxfa/cxfa_fffield.cpp
+++ b/xfa/fxfa/cxfa_fffield.cpp
@@ -185,14 +185,14 @@ void CXFA_FFField::CapPlacement() {
}
}
- XFA_ATTRIBUTEENUM iCapPlacement = XFA_ATTRIBUTEENUM_Unknown;
+ XFA_AttributeEnum iCapPlacement = XFA_AttributeEnum::Unknown;
float fCapReserve = 0;
CXFA_CaptionData captionData = m_pDataAcc->GetCaptionData();
if (captionData.HasValidNode() && !captionData.IsHidden()) {
iCapPlacement = captionData.GetPlacementType();
- if (iCapPlacement == XFA_ATTRIBUTEENUM_Top && GetPrev()) {
+ if (iCapPlacement == XFA_AttributeEnum::Top && GetPrev()) {
m_rtCaption.Reset();
- } else if (iCapPlacement == XFA_ATTRIBUTEENUM_Bottom && GetNext()) {
+ } else if (iCapPlacement == XFA_AttributeEnum::Bottom && GetNext()) {
m_rtCaption.Reset();
} else {
fCapReserve = captionData.GetReserve();
@@ -215,8 +215,8 @@ void CXFA_FFField::CapPlacement() {
CFX_SizeF minSize;
CFX_SizeF maxSize;
CFX_SizeF size = pCapTextLayout->CalcSize(minSize, maxSize);
- if (iCapPlacement == XFA_ATTRIBUTEENUM_Top ||
- iCapPlacement == XFA_ATTRIBUTEENUM_Bottom) {
+ if (iCapPlacement == XFA_AttributeEnum::Top ||
+ iCapPlacement == XFA_AttributeEnum::Bottom) {
fCapReserve = size.height;
} else {
fCapReserve = size.width;
@@ -227,7 +227,7 @@ void CXFA_FFField::CapPlacement() {
m_rtUI = rtWidget;
switch (iCapPlacement) {
- case XFA_ATTRIBUTEENUM_Left: {
+ case XFA_AttributeEnum::Left: {
m_rtCaption.width = fCapReserve;
CapLeftRightPlacement(captionData.GetMarginData(), rtWidget,
iCapPlacement);
@@ -235,7 +235,7 @@ void CXFA_FFField::CapPlacement() {
m_rtUI.left += fCapReserve;
break;
}
- case XFA_ATTRIBUTEENUM_Top: {
+ case XFA_AttributeEnum::Top: {
m_rtCaption.height = fCapReserve;
CapTopBottomPlacement(captionData.GetMarginData(), rtWidget,
iCapPlacement);
@@ -243,7 +243,7 @@ void CXFA_FFField::CapPlacement() {
m_rtUI.height -= fCapReserve;
break;
}
- case XFA_ATTRIBUTEENUM_Right: {
+ case XFA_AttributeEnum::Right: {
m_rtCaption.left = m_rtCaption.right() - fCapReserve;
m_rtCaption.width = fCapReserve;
CapLeftRightPlacement(captionData.GetMarginData(), rtWidget,
@@ -251,7 +251,7 @@ void CXFA_FFField::CapPlacement() {
m_rtUI.width -= fCapReserve;
break;
}
- case XFA_ATTRIBUTEENUM_Bottom: {
+ case XFA_AttributeEnum::Bottom: {
m_rtCaption.top = m_rtCaption.bottom() - fCapReserve;
m_rtCaption.height = fCapReserve;
CapTopBottomPlacement(captionData.GetMarginData(), rtWidget,
@@ -259,7 +259,7 @@ void CXFA_FFField::CapPlacement() {
m_rtUI.height -= fCapReserve;
break;
}
- case XFA_ATTRIBUTEENUM_Inline:
+ case XFA_AttributeEnum::Inline:
break;
default:
break;
@@ -276,7 +276,7 @@ void CXFA_FFField::CapPlacement() {
void CXFA_FFField::CapTopBottomPlacement(const CXFA_MarginData& marginData,
const CFX_RectF& rtWidget,
- int32_t iCapPlacement) {
+ XFA_AttributeEnum iCapPlacement) {
CFX_RectF rtUIMargin = m_pDataAcc->GetUIMargin();
m_rtCaption.left += rtUIMargin.left;
if (marginData.HasValidNode()) {
@@ -295,14 +295,14 @@ void CXFA_FFField::CapTopBottomPlacement(const CXFA_MarginData& marginData,
m_rtCaption.top += rtUIMargin.top + rtUIMargin.height;
} else if (fHeight > rtWidget.height) {
m_rtUI.height += fHeight - rtWidget.height;
- if (iCapPlacement == XFA_ATTRIBUTEENUM_Bottom)
+ if (iCapPlacement == XFA_AttributeEnum::Bottom)
m_rtCaption.top += fHeight - rtWidget.height;
}
}
void CXFA_FFField::CapLeftRightPlacement(const CXFA_MarginData& marginData,
const CFX_RectF& rtWidget,
- int32_t iCapPlacement) {
+ XFA_AttributeEnum iCapPlacement) {
CFX_RectF rtUIMargin = m_pDataAcc->GetUIMargin();
m_rtCaption.top += rtUIMargin.top;
m_rtCaption.height -= rtUIMargin.top;
@@ -316,7 +316,7 @@ void CXFA_FFField::CapLeftRightPlacement(const CXFA_MarginData& marginData,
float fHeight = rtUIMargin.top + rtUIMargin.height;
if (fWidth > rtWidget.width) {
m_rtUI.width += fWidth - rtWidget.width;
- if (iCapPlacement == XFA_ATTRIBUTEENUM_Right)
+ if (iCapPlacement == XFA_AttributeEnum::Right)
m_rtCaption.left += fWidth - rtWidget.width;
}
@@ -666,7 +666,7 @@ int32_t CXFA_FFField::CalculateWidgetAcc(CXFA_WidgetAcc* pAcc) {
XFA_VERSION version = pAcc->GetDoc()->GetXFADoc()->GetCurVersionMode();
switch (calcData.GetOverride()) {
- case XFA_ATTRIBUTEENUM_Error: {
+ case XFA_AttributeEnum::Error: {
if (version <= XFA_VERSION_204)
return 1;
@@ -678,7 +678,7 @@ int32_t CXFA_FFField::CalculateWidgetAcc(CXFA_WidgetAcc* pAcc) {
}
return 0;
}
- case XFA_ATTRIBUTEENUM_Warning: {
+ case XFA_AttributeEnum::Warning: {
if (version <= XFA_VERSION_204) {
CXFA_ScriptData scriptData = calcData.GetScriptData();
if (!scriptData.HasValidNode())
@@ -706,9 +706,9 @@ int32_t CXFA_FFField::CalculateWidgetAcc(CXFA_WidgetAcc* pAcc) {
}
return 0;
}
- case XFA_ATTRIBUTEENUM_Ignore:
+ case XFA_AttributeEnum::Ignore:
return 0;
- case XFA_ATTRIBUTEENUM_Disabled:
+ case XFA_AttributeEnum::Disabled:
pAcc->GetNode()->SetFlag(XFA_NodeFlag_UserInteractive, false);
return 1;
default:
@@ -738,22 +738,22 @@ void CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_MouseEnter;
eParam.m_pTarget = m_pDataAcc.Get();
- m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseEnter, &eParam);
+ m_pDataAcc->ProcessEvent(XFA_AttributeEnum::MouseEnter, &eParam);
} else if (event->m_dwCmd == FWL_MouseCommand::Leave) {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_MouseExit;
eParam.m_pTarget = m_pDataAcc.Get();
- m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseExit, &eParam);
+ m_pDataAcc->ProcessEvent(XFA_AttributeEnum::MouseExit, &eParam);
} else if (event->m_dwCmd == FWL_MouseCommand::LeftButtonDown) {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_MouseDown;
eParam.m_pTarget = m_pDataAcc.Get();
- m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseDown, &eParam);
+ m_pDataAcc->ProcessEvent(XFA_AttributeEnum::MouseDown, &eParam);
} else if (event->m_dwCmd == FWL_MouseCommand::LeftButtonUp) {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_MouseUp;
eParam.m_pTarget = m_pDataAcc.Get();
- m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseUp, &eParam);
+ m_pDataAcc->ProcessEvent(XFA_AttributeEnum::MouseUp, &eParam);
}
break;
}
@@ -761,7 +761,7 @@ void CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_Click;
eParam.m_pTarget = m_pDataAcc.Get();
- m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam);
+ m_pDataAcc->ProcessEvent(XFA_AttributeEnum::Click, &eParam);
break;
}
default: