diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-30 22:06:40 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-30 22:06:40 +0000 |
commit | d02c4d8b1199799340833ebfc79d7092f9b2d043 (patch) | |
tree | 46c5ad3489153bf600529314fdbcf8c772622a24 /xfa/fxfa | |
parent | f65f1d398804ec4702a3de691398902a0347461c (diff) | |
download | pdfium-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')
147 files changed, 1363 insertions, 1353 deletions
diff --git a/xfa/fxfa/cxfa_ffcheckbutton.cpp b/xfa/fxfa/cxfa_ffcheckbutton.cpp index 7d44c08107..c3ac7f6cd7 100644 --- a/xfa/fxfa/cxfa_ffcheckbutton.cpp +++ b/xfa/fxfa/cxfa_ffcheckbutton.cpp @@ -55,21 +55,21 @@ void CXFA_FFCheckButton::UpdateWidgetProperty() { pCheckBox->SetBoxSize(m_pDataAcc->GetCheckButtonSize()); uint32_t dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCross; switch (m_pDataAcc->GetCheckButtonMark()) { - case XFA_ATTRIBUTEENUM_Check: + case XFA_AttributeEnum::Check: dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCheck; break; - case XFA_ATTRIBUTEENUM_Circle: + case XFA_AttributeEnum::Circle: dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCircle; break; - case XFA_ATTRIBUTEENUM_Cross: + case XFA_AttributeEnum::Cross: break; - case XFA_ATTRIBUTEENUM_Diamond: + case XFA_AttributeEnum::Diamond: dwStyleEx = FWL_STYLEEXT_CKB_SignShapeDiamond; break; - case XFA_ATTRIBUTEENUM_Square: + case XFA_AttributeEnum::Square: dwStyleEx = FWL_STYLEEXT_CKB_SignShapeSquare; break; - case XFA_ATTRIBUTEENUM_Star: + case XFA_AttributeEnum::Star: dwStyleEx = FWL_STYLEEXT_CKB_SignShapeStar; break; default: { @@ -93,7 +93,7 @@ bool CXFA_FFCheckButton::PerformLayout() { if (marginData.HasValidNode()) XFA_RectWidthoutMargin(rtWidget, marginData); - 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.IsVisible()) { @@ -101,8 +101,8 @@ bool CXFA_FFCheckButton::PerformLayout() { iCapPlacement = captionData.GetPlacementType(); fCapReserve = captionData.GetReserve(); if (fCapReserve <= 0) { - if (iCapPlacement == XFA_ATTRIBUTEENUM_Top || - iCapPlacement == XFA_ATTRIBUTEENUM_Bottom) { + if (iCapPlacement == XFA_AttributeEnum::Top || + iCapPlacement == XFA_AttributeEnum::Bottom) { fCapReserve = rtWidget.height - fCheckSize; } else { fCapReserve = rtWidget.width - fCheckSize; @@ -110,8 +110,8 @@ bool CXFA_FFCheckButton::PerformLayout() { } } - XFA_ATTRIBUTEENUM iHorzAlign = XFA_ATTRIBUTEENUM_Left; - XFA_ATTRIBUTEENUM iVertAlign = XFA_ATTRIBUTEENUM_Top; + XFA_AttributeEnum iHorzAlign = XFA_AttributeEnum::Left; + XFA_AttributeEnum iVertAlign = XFA_AttributeEnum::Top; CXFA_ParaData paraData = m_pDataAcc->GetParaData(); if (paraData.HasValidNode()) { iHorzAlign = paraData.GetHorizontalAlign(); @@ -121,49 +121,49 @@ bool CXFA_FFCheckButton::PerformLayout() { m_rtUI = rtWidget; CXFA_MarginData captionMarginData = captionData.GetMarginData(); switch (iCapPlacement) { - case XFA_ATTRIBUTEENUM_Left: { + case XFA_AttributeEnum::Left: { m_rtCaption.width = fCapReserve; CapLeftRightPlacement(captionMarginData); m_rtUI.width -= fCapReserve; m_rtUI.left += fCapReserve; break; } - case XFA_ATTRIBUTEENUM_Top: { + case XFA_AttributeEnum::Top: { m_rtCaption.height = fCapReserve; XFA_RectWidthoutMargin(m_rtCaption, captionMarginData); m_rtUI.height -= fCapReserve; m_rtUI.top += fCapReserve; break; } - case XFA_ATTRIBUTEENUM_Right: { + case XFA_AttributeEnum::Right: { m_rtCaption.left = m_rtCaption.right() - fCapReserve; m_rtCaption.width = fCapReserve; CapLeftRightPlacement(captionMarginData); m_rtUI.width -= fCapReserve; break; } - case XFA_ATTRIBUTEENUM_Bottom: { + case XFA_AttributeEnum::Bottom: { m_rtCaption.top = m_rtCaption.bottom() - fCapReserve; m_rtCaption.height = fCapReserve; XFA_RectWidthoutMargin(m_rtCaption, captionMarginData); m_rtUI.height -= fCapReserve; break; } - case XFA_ATTRIBUTEENUM_Inline: + case XFA_AttributeEnum::Inline: break; default: - iHorzAlign = XFA_ATTRIBUTEENUM_Right; + iHorzAlign = XFA_AttributeEnum::Right; break; } - if (iHorzAlign == XFA_ATTRIBUTEENUM_Center) + if (iHorzAlign == XFA_AttributeEnum::Center) m_rtUI.left += (m_rtUI.width - fCheckSize) / 2; - else if (iHorzAlign == XFA_ATTRIBUTEENUM_Right) + else if (iHorzAlign == XFA_AttributeEnum::Right) m_rtUI.left = m_rtUI.right() - fCheckSize; - if (iVertAlign == XFA_ATTRIBUTEENUM_Middle) + if (iVertAlign == XFA_AttributeEnum::Middle) m_rtUI.top += (m_rtUI.height - fCheckSize) / 2; - else if (iVertAlign == XFA_ATTRIBUTEENUM_Bottom) + else if (iVertAlign == XFA_AttributeEnum::Bottom) m_rtUI.top = m_rtUI.bottom() - fCheckSize; m_rtUI.width = fCheckSize; @@ -197,15 +197,15 @@ void CXFA_FFCheckButton::CapLeftRightPlacement( } } -void CXFA_FFCheckButton::AddUIMargin(XFA_ATTRIBUTEENUM iCapPlacement) { +void CXFA_FFCheckButton::AddUIMargin(XFA_AttributeEnum iCapPlacement) { CFX_RectF rtUIMargin = m_pDataAcc->GetUIMargin(); m_rtUI.top -= rtUIMargin.top / 2 - rtUIMargin.height / 2; float fLeftAddRight = rtUIMargin.left + rtUIMargin.width; float fTopAddBottom = rtUIMargin.top + rtUIMargin.height; if (m_rtUI.width < fLeftAddRight) { - if (iCapPlacement == XFA_ATTRIBUTEENUM_Right || - iCapPlacement == XFA_ATTRIBUTEENUM_Left) { + if (iCapPlacement == XFA_AttributeEnum::Right || + iCapPlacement == XFA_AttributeEnum::Left) { m_rtUI.left -= fLeftAddRight - m_rtUI.width; } else { m_rtUI.left -= 2 * (fLeftAddRight - m_rtUI.width); @@ -213,7 +213,7 @@ void CXFA_FFCheckButton::AddUIMargin(XFA_ATTRIBUTEENUM iCapPlacement) { m_rtUI.width += 2 * (fLeftAddRight - m_rtUI.width); } if (m_rtUI.height < fTopAddBottom) { - if (iCapPlacement == XFA_ATTRIBUTEENUM_Right) + if (iCapPlacement == XFA_AttributeEnum::Right) m_rtUI.left -= fTopAddBottom - m_rtUI.height; m_rtUI.top -= fTopAddBottom - m_rtUI.height; @@ -312,19 +312,19 @@ void CXFA_FFCheckButton::OnProcessEvent(CFWL_Event* pEvent) { if (pFFExclGroup) { m_pDocView->AddValidateWidget(pFFExclGroup); m_pDocView->AddCalculateWidgetAcc(pFFExclGroup); - pFFExclGroup->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam); + pFFExclGroup->ProcessEvent(XFA_AttributeEnum::Change, &eParam); } eParam.m_pTarget = m_pDataAcc.Get(); - m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam); + m_pDataAcc->ProcessEvent(XFA_AttributeEnum::Change, &eParam); } else { SetFWLCheckState(m_pDataAcc->GetCheckState()); } if (pFFExclGroup) { eParam.m_pTarget = pFFExclGroup; - pFFExclGroup->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam); + pFFExclGroup->ProcessEvent(XFA_AttributeEnum::Click, &eParam); } eParam.m_pTarget = m_pDataAcc.Get(); - m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam); + m_pDataAcc->ProcessEvent(XFA_AttributeEnum::Click, &eParam); break; } default: diff --git a/xfa/fxfa/cxfa_ffcheckbutton.h b/xfa/fxfa/cxfa_ffcheckbutton.h index da772d3e6b..36d97d78a9 100644 --- a/xfa/fxfa/cxfa_ffcheckbutton.h +++ b/xfa/fxfa/cxfa_ffcheckbutton.h @@ -36,7 +36,7 @@ class CXFA_FFCheckButton : public CXFA_FFField { bool CommitData() override; bool IsDataChanged() override; void CapLeftRightPlacement(const CXFA_MarginData& captionMarginData); - void AddUIMargin(XFA_ATTRIBUTEENUM iCapPlacement); + void AddUIMargin(XFA_AttributeEnum iCapPlacement); XFA_CHECKSTATE FWLState2XFAState(); IFWL_WidgetDelegate* m_pOldDelegate; diff --git a/xfa/fxfa/cxfa_ffcombobox.cpp b/xfa/fxfa/cxfa_ffcombobox.cpp index f96ccb8b32..cc5569ea85 100644 --- a/xfa/fxfa/cxfa_ffcombobox.cpp +++ b/xfa/fxfa/cxfa_ffcombobox.cpp @@ -135,7 +135,7 @@ void CXFA_FFComboBox::FWLEventSelChange(CXFA_EventParam* pParam) { pParam->m_eType = XFA_EVENT_Change; pParam->m_pTarget = m_pDataAcc.Get(); pParam->m_wsNewText = ToComboBox(m_pNormalWidget.get())->GetEditText(); - m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, pParam); + m_pDataAcc->ProcessEvent(XFA_AttributeEnum::Change, pParam); } uint32_t CXFA_FFComboBox::GetAlignment() { @@ -145,18 +145,18 @@ uint32_t CXFA_FFComboBox::GetAlignment() { uint32_t dwExtendedStyle = 0; switch (paraData.GetHorizontalAlign()) { - case XFA_ATTRIBUTEENUM_Center: + case XFA_AttributeEnum::Center: dwExtendedStyle |= FWL_STYLEEXT_CMB_EditHCenter | FWL_STYLEEXT_CMB_ListItemCenterAlign; break; - case XFA_ATTRIBUTEENUM_Justify: + case XFA_AttributeEnum::Justify: dwExtendedStyle |= FWL_STYLEEXT_CMB_EditJustified; break; - case XFA_ATTRIBUTEENUM_JustifyAll: + case XFA_AttributeEnum::JustifyAll: break; - case XFA_ATTRIBUTEENUM_Radix: + case XFA_AttributeEnum::Radix: break; - case XFA_ATTRIBUTEENUM_Right: + case XFA_AttributeEnum::Right: break; default: dwExtendedStyle |= @@ -165,10 +165,10 @@ uint32_t CXFA_FFComboBox::GetAlignment() { } switch (paraData.GetVerticalAlign()) { - case XFA_ATTRIBUTEENUM_Middle: + case XFA_AttributeEnum::Middle: dwExtendedStyle |= FWL_STYLEEXT_CMB_EditVCenter; break; - case XFA_ATTRIBUTEENUM_Bottom: + case XFA_AttributeEnum::Bottom: dwExtendedStyle |= FWL_STYLEEXT_CMB_EditVFar; break; default: @@ -301,14 +301,14 @@ void CXFA_FFComboBox::OnPreOpen(CFWL_Widget* pWidget) { CXFA_EventParam eParam; eParam.m_eType = XFA_EVENT_PreOpen; eParam.m_pTarget = m_pDataAcc.Get(); - m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_PreOpen, &eParam); + m_pDataAcc->ProcessEvent(XFA_AttributeEnum::PreOpen, &eParam); } void CXFA_FFComboBox::OnPostOpen(CFWL_Widget* pWidget) { CXFA_EventParam eParam; eParam.m_eType = XFA_EVENT_PostOpen; eParam.m_pTarget = m_pDataAcc.Get(); - m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_PostOpen, &eParam); + m_pDataAcc->ProcessEvent(XFA_AttributeEnum::PostOpen, &eParam); } void CXFA_FFComboBox::OnProcessMessage(CFWL_Message* pMessage) { diff --git a/xfa/fxfa/cxfa_ffdatetimeedit.cpp b/xfa/fxfa/cxfa_ffdatetimeedit.cpp index 109b7e8228..2fab4c8738 100644 --- a/xfa/fxfa/cxfa_ffdatetimeedit.cpp +++ b/xfa/fxfa/cxfa_ffdatetimeedit.cpp @@ -104,16 +104,16 @@ uint32_t CXFA_FFDateTimeEdit::GetAlignment() { uint32_t dwExtendedStyle = 0; switch (paraData.GetHorizontalAlign()) { - case XFA_ATTRIBUTEENUM_Center: + case XFA_AttributeEnum::Center: dwExtendedStyle |= FWL_STYLEEXT_DTP_EditHCenter; break; - case XFA_ATTRIBUTEENUM_Justify: + case XFA_AttributeEnum::Justify: dwExtendedStyle |= FWL_STYLEEXT_DTP_EditJustified; break; - case XFA_ATTRIBUTEENUM_JustifyAll: - case XFA_ATTRIBUTEENUM_Radix: + case XFA_AttributeEnum::JustifyAll: + case XFA_AttributeEnum::Radix: break; - case XFA_ATTRIBUTEENUM_Right: + case XFA_AttributeEnum::Right: dwExtendedStyle |= FWL_STYLEEXT_DTP_EditHFar; break; default: @@ -122,10 +122,10 @@ uint32_t CXFA_FFDateTimeEdit::GetAlignment() { } switch (paraData.GetVerticalAlign()) { - case XFA_ATTRIBUTEENUM_Middle: + case XFA_AttributeEnum::Middle: dwExtendedStyle |= FWL_STYLEEXT_DTP_EditVCenter; break; - case XFA_ATTRIBUTEENUM_Bottom: + case XFA_AttributeEnum::Bottom: dwExtendedStyle |= FWL_STYLEEXT_DTP_EditVFar; break; default: @@ -198,7 +198,7 @@ void CXFA_FFDateTimeEdit::OnSelectChanged(CFWL_Widget* pWidget, eParam.m_eType = XFA_EVENT_Change; eParam.m_pTarget = m_pDataAcc.Get(); eParam.m_wsNewText = m_pDataAcc->GetValue(XFA_VALUEPICTURE_Raw); - m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam); + m_pDataAcc->ProcessEvent(XFA_AttributeEnum::Change, &eParam); } void CXFA_FFDateTimeEdit::OnProcessEvent(CFWL_Event* pEvent) { diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp index 62543943be..b3f5dab25c 100644 --- a/xfa/fxfa/cxfa_ffdocview.cpp +++ b/xfa/fxfa/cxfa_ffdocview.cpp @@ -33,21 +33,21 @@ #include "xfa/fxfa/parser/cxfa_layoutprocessor.h" #include "xfa/fxfa/parser/xfa_resolvenode_rs.h" -const XFA_ATTRIBUTEENUM gs_EventActivity[] = { - XFA_ATTRIBUTEENUM_Click, XFA_ATTRIBUTEENUM_Change, - XFA_ATTRIBUTEENUM_DocClose, XFA_ATTRIBUTEENUM_DocReady, - XFA_ATTRIBUTEENUM_Enter, XFA_ATTRIBUTEENUM_Exit, - XFA_ATTRIBUTEENUM_Full, XFA_ATTRIBUTEENUM_IndexChange, - XFA_ATTRIBUTEENUM_Initialize, XFA_ATTRIBUTEENUM_MouseDown, - XFA_ATTRIBUTEENUM_MouseEnter, XFA_ATTRIBUTEENUM_MouseExit, - XFA_ATTRIBUTEENUM_MouseUp, XFA_ATTRIBUTEENUM_PostExecute, - XFA_ATTRIBUTEENUM_PostOpen, XFA_ATTRIBUTEENUM_PostPrint, - XFA_ATTRIBUTEENUM_PostSave, XFA_ATTRIBUTEENUM_PostSign, - XFA_ATTRIBUTEENUM_PostSubmit, XFA_ATTRIBUTEENUM_PreExecute, - XFA_ATTRIBUTEENUM_PreOpen, XFA_ATTRIBUTEENUM_PrePrint, - XFA_ATTRIBUTEENUM_PreSave, XFA_ATTRIBUTEENUM_PreSign, - XFA_ATTRIBUTEENUM_PreSubmit, XFA_ATTRIBUTEENUM_Ready, - XFA_ATTRIBUTEENUM_Unknown, +const XFA_AttributeEnum gs_EventActivity[] = { + XFA_AttributeEnum::Click, XFA_AttributeEnum::Change, + XFA_AttributeEnum::DocClose, XFA_AttributeEnum::DocReady, + XFA_AttributeEnum::Enter, XFA_AttributeEnum::Exit, + XFA_AttributeEnum::Full, XFA_AttributeEnum::IndexChange, + XFA_AttributeEnum::Initialize, XFA_AttributeEnum::MouseDown, + XFA_AttributeEnum::MouseEnter, XFA_AttributeEnum::MouseExit, + XFA_AttributeEnum::MouseUp, XFA_AttributeEnum::PostExecute, + XFA_AttributeEnum::PostOpen, XFA_AttributeEnum::PostPrint, + XFA_AttributeEnum::PostSave, XFA_AttributeEnum::PostSign, + XFA_AttributeEnum::PostSubmit, XFA_AttributeEnum::PreExecute, + XFA_AttributeEnum::PreOpen, XFA_AttributeEnum::PrePrint, + XFA_AttributeEnum::PreSave, XFA_AttributeEnum::PreSign, + XFA_AttributeEnum::PreSubmit, XFA_AttributeEnum::Ready, + XFA_AttributeEnum::Unknown, }; CXFA_FFDocView::CXFA_FFDocView(CXFA_FFDoc* pDoc) @@ -573,7 +573,7 @@ void CXFA_FFDocView::RunSubformIndexChange() { CXFA_EventParam eParam; eParam.m_eType = XFA_EVENT_IndexChange; eParam.m_pTarget = pWidgetAcc; - pWidgetAcc->ProcessEvent(XFA_ATTRIBUTEENUM_IndexChange, &eParam); + pWidgetAcc->ProcessEvent(XFA_AttributeEnum::IndexChange, &eParam); } m_IndexChangedSubforms.clear(); } diff --git a/xfa/fxfa/cxfa_ffdocview.h b/xfa/fxfa/cxfa_ffdocview.h index 6f8b682a73..8be5cf16b8 100644 --- a/xfa/fxfa/cxfa_ffdocview.h +++ b/xfa/fxfa/cxfa_ffdocview.h @@ -20,7 +20,7 @@ class CXFA_FFDoc; class CXFA_FFWidget; class CXFA_WidgetAccIterator; -extern const XFA_ATTRIBUTEENUM gs_EventActivity[]; +extern const XFA_AttributeEnum gs_EventActivity[]; enum XFA_DOCVIEW_LAYOUTSTATUS { XFA_DOCVIEW_LAYOUTSTATUS_None, XFA_DOCVIEW_LAYOUTSTATUS_Start, 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: diff --git a/xfa/fxfa/cxfa_fffield.h b/xfa/fxfa/cxfa_fffield.h index dc6e916d18..b566fe970d 100644 --- a/xfa/fxfa/cxfa_fffield.h +++ b/xfa/fxfa/cxfa_fffield.h @@ -85,10 +85,10 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { void CapPlacement(); void CapTopBottomPlacement(const CXFA_MarginData& marginData, const CFX_RectF& rtWidget, - int32_t iCapPlacement); + XFA_AttributeEnum iCapPlacement); void CapLeftRightPlacement(const CXFA_MarginData& marginData, const CFX_RectF& rtWidget, - int32_t iCapPlacement); + XFA_AttributeEnum iCapPlacement); void SetEditScrollOffset(); std::unique_ptr<CFWL_Widget> m_pNormalWidget; diff --git a/xfa/fxfa/cxfa_ffimage.cpp b/xfa/fxfa/cxfa_ffimage.cpp index 79b7d9dd6f..7a94c76a6a 100644 --- a/xfa/fxfa/cxfa_ffimage.cpp +++ b/xfa/fxfa/cxfa_ffimage.cpp @@ -53,8 +53,8 @@ void CXFA_FFImage::RenderWidget(CXFA_Graphics* pGS, if (marginData.HasValidNode()) XFA_RectWidthoutMargin(rtImage, marginData); - XFA_ATTRIBUTEENUM iHorzAlign = XFA_ATTRIBUTEENUM_Left; - XFA_ATTRIBUTEENUM iVertAlign = XFA_ATTRIBUTEENUM_Top; + XFA_AttributeEnum iHorzAlign = XFA_AttributeEnum::Left; + XFA_AttributeEnum iVertAlign = XFA_AttributeEnum::Top; CXFA_ParaData paraData = m_pDataAcc->GetParaData(); if (paraData.HasValidNode()) { iHorzAlign = paraData.GetHorizontalAlign(); diff --git a/xfa/fxfa/cxfa_ffimageedit.cpp b/xfa/fxfa/cxfa_ffimageedit.cpp index 3736997ee9..558e597992 100644 --- a/xfa/fxfa/cxfa_ffimageedit.cpp +++ b/xfa/fxfa/cxfa_ffimageedit.cpp @@ -68,15 +68,15 @@ void CXFA_FFImageEdit::RenderWidget(CXFA_Graphics* pGS, return; CFX_RectF rtImage = m_pNormalWidget->GetWidgetRect(); - XFA_ATTRIBUTEENUM iHorzAlign = XFA_ATTRIBUTEENUM_Left; - XFA_ATTRIBUTEENUM iVertAlign = XFA_ATTRIBUTEENUM_Top; + XFA_AttributeEnum iHorzAlign = XFA_AttributeEnum::Left; + XFA_AttributeEnum iVertAlign = XFA_AttributeEnum::Top; CXFA_ParaData paraData = m_pDataAcc->GetParaData(); if (paraData.HasValidNode()) { iHorzAlign = paraData.GetHorizontalAlign(); iVertAlign = paraData.GetVerticalAlign(); } - XFA_ATTRIBUTEENUM iAspect = XFA_ATTRIBUTEENUM_Fit; + XFA_AttributeEnum iAspect = XFA_AttributeEnum::Fit; CXFA_ValueData valueData = m_pDataAcc->GetFormValueData(); if (valueData.HasValidNode()) { CXFA_ImageData imageData = valueData.GetImageData(); diff --git a/xfa/fxfa/cxfa_ffline.cpp b/xfa/fxfa/cxfa_ffline.cpp index 16794c35c5..1af7f4e705 100644 --- a/xfa/fxfa/cxfa_ffline.cpp +++ b/xfa/fxfa/cxfa_ffline.cpp @@ -12,11 +12,11 @@ namespace { -CFX_GraphStateData::LineCap LineCapToFXGE(XFA_ATTRIBUTEENUM iLineCap) { +CFX_GraphStateData::LineCap LineCapToFXGE(XFA_AttributeEnum iLineCap) { switch (iLineCap) { - case XFA_ATTRIBUTEENUM_Round: + case XFA_AttributeEnum::Round: return CFX_GraphStateData::LineCapRound; - case XFA_ATTRIBUTEENUM_Butt: + case XFA_AttributeEnum::Butt: return CFX_GraphStateData::LineCapButt; default: break; @@ -31,17 +31,17 @@ CXFA_FFLine::CXFA_FFLine(CXFA_WidgetAcc* pDataAcc) : CXFA_FFDraw(pDataAcc) {} CXFA_FFLine::~CXFA_FFLine() {} void CXFA_FFLine::GetRectFromHand(CFX_RectF& rect, - XFA_ATTRIBUTEENUM iHand, + XFA_AttributeEnum iHand, float fLineWidth) { float fHalfWidth = fLineWidth / 2.0f; if (rect.height < 1.0f) { switch (iHand) { - case XFA_ATTRIBUTEENUM_Left: + case XFA_AttributeEnum::Left: rect.top -= fHalfWidth; break; - case XFA_ATTRIBUTEENUM_Right: + case XFA_AttributeEnum::Right: rect.top += fHalfWidth; - case XFA_ATTRIBUTEENUM_Even: + case XFA_AttributeEnum::Even: break; default: NOTREACHED(); @@ -49,13 +49,13 @@ void CXFA_FFLine::GetRectFromHand(CFX_RectF& rect, } } else if (rect.width < 1.0f) { switch (iHand) { - case XFA_ATTRIBUTEENUM_Left: + case XFA_AttributeEnum::Left: rect.left += fHalfWidth; break; - case XFA_ATTRIBUTEENUM_Right: + case XFA_AttributeEnum::Right: rect.left += fHalfWidth; break; - case XFA_ATTRIBUTEENUM_Even: + case XFA_AttributeEnum::Even: break; default: NOTREACHED(); @@ -63,13 +63,13 @@ void CXFA_FFLine::GetRectFromHand(CFX_RectF& rect, } } else { switch (iHand) { - case XFA_ATTRIBUTEENUM_Left: + case XFA_AttributeEnum::Left: rect.Inflate(fHalfWidth, fHalfWidth); break; - case XFA_ATTRIBUTEENUM_Right: + case XFA_AttributeEnum::Right: rect.Deflate(fHalfWidth, fHalfWidth); break; - case XFA_ATTRIBUTEENUM_Even: + case XFA_AttributeEnum::Even: break; default: NOTREACHED(); @@ -91,8 +91,8 @@ void CXFA_FFLine::RenderWidget(CXFA_Graphics* pGS, CXFA_LineData lineData = valueData.GetLineData(); FX_ARGB lineColor = 0xFF000000; float fLineWidth = 1.0f; - XFA_ATTRIBUTEENUM iStrokeType = XFA_ATTRIBUTEENUM_Unknown; - XFA_ATTRIBUTEENUM iCap = XFA_ATTRIBUTEENUM_Unknown; + XFA_AttributeEnum iStrokeType = XFA_AttributeEnum::Unknown; + XFA_AttributeEnum iCap = XFA_AttributeEnum::Unknown; CXFA_EdgeData edgeData = lineData.GetEdgeData(); if (edgeData.HasValidNode()) { if (!edgeData.IsVisible()) diff --git a/xfa/fxfa/cxfa_ffline.h b/xfa/fxfa/cxfa_ffline.h index 7aded63c59..b6db5b3b75 100644 --- a/xfa/fxfa/cxfa_ffline.h +++ b/xfa/fxfa/cxfa_ffline.h @@ -21,7 +21,7 @@ class CXFA_FFLine : public CXFA_FFDraw { private: void GetRectFromHand(CFX_RectF& rect, - XFA_ATTRIBUTEENUM iHand, + XFA_AttributeEnum iHand, float fLineWidth); }; diff --git a/xfa/fxfa/cxfa_fflistbox.cpp b/xfa/fxfa/cxfa_fflistbox.cpp index 0609cd270a..ce9d26d917 100644 --- a/xfa/fxfa/cxfa_fflistbox.cpp +++ b/xfa/fxfa/cxfa_fflistbox.cpp @@ -110,16 +110,16 @@ uint32_t CXFA_FFListBox::GetAlignment() { uint32_t dwExtendedStyle = 0; switch (paraData.GetHorizontalAlign()) { - case XFA_ATTRIBUTEENUM_Center: + case XFA_AttributeEnum::Center: dwExtendedStyle |= FWL_STYLEEXT_LTB_CenterAlign; break; - case XFA_ATTRIBUTEENUM_Justify: + case XFA_AttributeEnum::Justify: break; - case XFA_ATTRIBUTEENUM_JustifyAll: + case XFA_AttributeEnum::JustifyAll: break; - case XFA_ATTRIBUTEENUM_Radix: + case XFA_AttributeEnum::Radix: break; - case XFA_ATTRIBUTEENUM_Right: + case XFA_AttributeEnum::Right: dwExtendedStyle |= FWL_STYLEEXT_LTB_RightAlign; break; default: @@ -159,7 +159,7 @@ void CXFA_FFListBox::OnSelectChanged(CFWL_Widget* pWidget) { CFWL_ListItem* item = pListBox->GetSelItem(0); eParam.m_wsNewText = item ? item->GetText() : L""; } - m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam); + m_pDataAcc->ProcessEvent(XFA_AttributeEnum::Change, &eParam); } void CXFA_FFListBox::SetItemState(int32_t nIndex, bool bSelected) { diff --git a/xfa/fxfa/cxfa_ffpushbutton.cpp b/xfa/fxfa/cxfa_ffpushbutton.cpp index 8745c7a1c1..615c8ae16c 100644 --- a/xfa/fxfa/cxfa_ffpushbutton.cpp +++ b/xfa/fxfa/cxfa_ffpushbutton.cpp @@ -69,13 +69,13 @@ bool CXFA_FFPushButton::LoadWidget() { void CXFA_FFPushButton::UpdateWidgetProperty() { uint32_t dwStyleEx = 0; switch (m_pDataAcc->GetButtonHighlight()) { - case XFA_ATTRIBUTEENUM_Inverted: + case XFA_AttributeEnum::Inverted: dwStyleEx = XFA_FWL_PSBSTYLEEXT_HiliteInverted; break; - case XFA_ATTRIBUTEENUM_Outline: + case XFA_AttributeEnum::Outline: dwStyleEx = XFA_FWL_PSBSTYLEEXT_HiliteOutLine; break; - case XFA_ATTRIBUTEENUM_Push: + case XFA_AttributeEnum::Push: dwStyleEx = XFA_FWL_PSBSTYLEEXT_HilitePush; break; default: @@ -117,7 +117,7 @@ bool CXFA_FFPushButton::PerformLayout() { float CXFA_FFPushButton::GetLineWidth() { CXFA_BorderData borderData = m_pDataAcc->GetBorderData(false); if (borderData.HasValidNode() && - borderData.GetPresence() == XFA_ATTRIBUTEENUM_Visible) { + borderData.GetPresence() == XFA_AttributeEnum::Visible) { return borderData.GetEdgeData(0).GetThickness(); } diff --git a/xfa/fxfa/cxfa_fftextedit.cpp b/xfa/fxfa/cxfa_fftextedit.cpp index 5b9c3c2f8f..88567213ca 100644 --- a/xfa/fxfa/cxfa_fftextedit.cpp +++ b/xfa/fxfa/cxfa_fftextedit.cpp @@ -220,16 +220,16 @@ uint32_t CXFA_FFTextEdit::GetAlignment() { uint32_t dwExtendedStyle = 0; switch (paraData.GetHorizontalAlign()) { - case XFA_ATTRIBUTEENUM_Center: + case XFA_AttributeEnum::Center: dwExtendedStyle |= FWL_STYLEEXT_EDT_HCenter; break; - case XFA_ATTRIBUTEENUM_Justify: + case XFA_AttributeEnum::Justify: dwExtendedStyle |= FWL_STYLEEXT_EDT_Justified; break; - case XFA_ATTRIBUTEENUM_JustifyAll: - case XFA_ATTRIBUTEENUM_Radix: + case XFA_AttributeEnum::JustifyAll: + case XFA_AttributeEnum::Radix: break; - case XFA_ATTRIBUTEENUM_Right: + case XFA_AttributeEnum::Right: dwExtendedStyle |= FWL_STYLEEXT_EDT_HFar; break; default: @@ -238,10 +238,10 @@ uint32_t CXFA_FFTextEdit::GetAlignment() { } switch (paraData.GetVerticalAlign()) { - case XFA_ATTRIBUTEENUM_Middle: + case XFA_AttributeEnum::Middle: dwExtendedStyle |= FWL_STYLEEXT_EDT_VCenter; break; - case XFA_ATTRIBUTEENUM_Bottom: + case XFA_AttributeEnum::Bottom: dwExtendedStyle |= FWL_STYLEEXT_EDT_VFar; break; default: @@ -316,14 +316,14 @@ void CXFA_FFTextEdit::OnTextChanged(CFWL_Widget* pWidget, if (pEdit->HasSelection()) std::tie(eParam.m_iSelStart, eParam.m_iSelEnd) = pEdit->GetSelection(); } - m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam); + m_pDataAcc->ProcessEvent(XFA_AttributeEnum::Change, &eParam); } void CXFA_FFTextEdit::OnTextFull(CFWL_Widget* pWidget) { CXFA_EventParam eParam; eParam.m_eType = XFA_EVENT_Full; eParam.m_pTarget = m_pDataAcc.Get(); - m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Full, &eParam); + m_pDataAcc->ProcessEvent(XFA_AttributeEnum::Full, &eParam); } bool CXFA_FFTextEdit::CheckWord(const ByteStringView& sWord) { diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index 439b45be4d..fdb10a34f2 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -82,7 +82,7 @@ void XFA_BOX_GetPath(const std::vector<CXFA_StrokeData>& strokes, bool bInverted = cornerData1.IsInverted(); float offsetY = 0.0f; float offsetX = 0.0f; - bool bRound = cornerData1.GetJoinType() == XFA_ATTRIBUTEENUM_Round; + bool bRound = cornerData1.GetJoinType() == XFA_AttributeEnum::Round; float halfAfter = 0.0f; float halfBefore = 0.0f; CXFA_StrokeData strokeData = strokes[nIndex]; @@ -243,10 +243,10 @@ void XFA_BOX_GetFillPath(const CXFA_BoxData& boxData, if (boxData.IsArc() || (dwFlags & XFA_DRAWBOX_ForceRound) != 0) { float fThickness = std::fmax(0.0, boxData.GetEdgeData(0).GetThickness()); float fHalf = fThickness / 2; - int32_t iHand = boxData.GetHand(); - if (iHand == XFA_ATTRIBUTEENUM_Left) + XFA_AttributeEnum iHand = boxData.GetHand(); + if (iHand == XFA_AttributeEnum::Left) rtWidget.Inflate(fHalf, fHalf); - else if (iHand == XFA_ATTRIBUTEENUM_Right) + else if (iHand == XFA_AttributeEnum::Right) rtWidget.Deflate(fHalf, fHalf); XFA_BOX_GetPath_Arc(boxData, rtWidget, fillPath, dwFlags); @@ -280,7 +280,7 @@ void XFA_BOX_GetFillPath(const CXFA_BoxData& boxData, if (strokeData1.IsInverted()) { bSameStyles = false; } - if (strokeData1.GetJoinType() != XFA_ATTRIBUTEENUM_Square) { + if (strokeData1.GetJoinType() != XFA_AttributeEnum::Square) { bSameStyles = false; } } @@ -304,7 +304,7 @@ void XFA_BOX_GetFillPath(const CXFA_BoxData& boxData, float fRadius1 = cornerData1.GetRadius(); float fRadius2 = cornerData2.GetRadius(); bool bInverted = cornerData1.IsInverted(); - bool bRound = cornerData1.GetJoinType() == XFA_ATTRIBUTEENUM_Round; + bool bRound = cornerData1.GetJoinType() == XFA_AttributeEnum::Round; if (bRound) { sy = FX_PI / 2; } @@ -415,19 +415,19 @@ void XFA_BOX_Fill_Pattern(const CXFA_BoxData& boxData, FX_ARGB crEnd = fillData.GetPatternColor(); FX_HatchStyle iHatch = FX_HatchStyle::Cross; switch (fillData.GetPatternType()) { - case XFA_ATTRIBUTEENUM_CrossDiagonal: + case XFA_AttributeEnum::CrossDiagonal: iHatch = FX_HatchStyle::DiagonalCross; break; - case XFA_ATTRIBUTEENUM_DiagonalLeft: + case XFA_AttributeEnum::DiagonalLeft: iHatch = FX_HatchStyle::ForwardDiagonal; break; - case XFA_ATTRIBUTEENUM_DiagonalRight: + case XFA_AttributeEnum::DiagonalRight: iHatch = FX_HatchStyle::BackwardDiagonal; break; - case XFA_ATTRIBUTEENUM_Horizontal: + case XFA_AttributeEnum::Horizontal: iHatch = FX_HatchStyle::Horizontal; break; - case XFA_ATTRIBUTEENUM_Vertical: + case XFA_AttributeEnum::Vertical: iHatch = FX_HatchStyle::Vertical; break; default: @@ -451,19 +451,19 @@ void XFA_BOX_Fill_Linear(const CXFA_BoxData& boxData, CFX_PointF ptStart; CFX_PointF ptEnd; switch (fillData.GetLinearType()) { - case XFA_ATTRIBUTEENUM_ToRight: + case XFA_AttributeEnum::ToRight: ptStart = CFX_PointF(rtFill.left, rtFill.top); ptEnd = CFX_PointF(rtFill.right(), rtFill.top); break; - case XFA_ATTRIBUTEENUM_ToBottom: + case XFA_AttributeEnum::ToBottom: ptStart = CFX_PointF(rtFill.left, rtFill.top); ptEnd = CFX_PointF(rtFill.left, rtFill.bottom()); break; - case XFA_ATTRIBUTEENUM_ToLeft: + case XFA_AttributeEnum::ToLeft: ptStart = CFX_PointF(rtFill.right(), rtFill.top); ptEnd = CFX_PointF(rtFill.left, rtFill.top); break; - case XFA_ATTRIBUTEENUM_ToTop: + case XFA_AttributeEnum::ToTop: ptStart = CFX_PointF(rtFill.left, rtFill.bottom()); ptEnd = CFX_PointF(rtFill.left, rtFill.top); break; @@ -542,7 +542,7 @@ void XFA_BOX_StrokePath(const CXFA_StrokeData& strokeData, pGS->EnableActOnDash(); pGS->SetLineCap(CFX_GraphStateData::LineCapButt); XFA_StrokeTypeSetLineDash(pGS, strokeData.GetStrokeType(), - XFA_ATTRIBUTEENUM_Butt); + XFA_AttributeEnum::Butt); pGS->SetStrokeColor(CXFA_GEColor(strokeData.GetColor())); pGS->StrokePath(pPath, &matrix); pGS->RestoreGraphState(); @@ -557,11 +557,11 @@ void XFA_BOX_StrokeArc(const CXFA_BoxData& boxData, if (!edgeData.HasValidNode() || !edgeData.IsVisible()) return; - bool bVisible = false; - float fThickness = 0; - int32_t i3DType = 0; + bool bVisible; + float fThickness; + XFA_AttributeEnum i3DType; std::tie(i3DType, bVisible, fThickness) = boxData.Get3DStyle(); - if (i3DType) { + if (i3DType != XFA_AttributeEnum::Unknown) { if (bVisible && fThickness >= 0.001f) { dwFlags |= XFA_DRAWBOX_Lowered3D; } @@ -570,10 +570,11 @@ void XFA_BOX_StrokeArc(const CXFA_BoxData& boxData, if (fHalf < 0) { fHalf = 0; } - int32_t iHand = boxData.GetHand(); - if (iHand == XFA_ATTRIBUTEENUM_Left) { + + XFA_AttributeEnum iHand = boxData.GetHand(); + if (iHand == XFA_AttributeEnum::Left) { rtWidget.Inflate(fHalf, fHalf); - } else if (iHand == XFA_ATTRIBUTEENUM_Right) { + } else if (iHand == XFA_AttributeEnum::Right) { rtWidget.Deflate(fHalf, fHalf); } if ((dwFlags & XFA_DRAWBOX_ForceRound) == 0 || @@ -725,27 +726,30 @@ void XFA_BOX_Stroke_Rect(CXFA_BoxData boxData, CXFA_Graphics* pGS, CFX_RectF rtWidget, const CFX_Matrix& matrix) { - bool bVisible = false; - float fThickness = 0; - int32_t i3DType = 0; + bool bVisible; + float fThickness; + XFA_AttributeEnum i3DType; std::tie(i3DType, bVisible, fThickness) = boxData.Get3DStyle(); - if (i3DType) { + if (i3DType != XFA_AttributeEnum::Unknown) { if (!bVisible || fThickness < 0.001f) { return; } switch (i3DType) { - case XFA_ATTRIBUTEENUM_Lowered: + case XFA_AttributeEnum::Lowered: XFA_BOX_Stroke_3DRect_Lowered(pGS, rtWidget, fThickness, matrix); break; - case XFA_ATTRIBUTEENUM_Raised: + case XFA_AttributeEnum::Raised: XFA_BOX_Stroke_3DRect_Raised(pGS, rtWidget, fThickness, matrix); break; - case XFA_ATTRIBUTEENUM_Etched: + case XFA_AttributeEnum::Etched: XFA_BOX_Stroke_3DRect_Etched(pGS, rtWidget, fThickness, matrix); break; - case XFA_ATTRIBUTEENUM_Embossed: + case XFA_AttributeEnum::Embossed: XFA_BOX_Stroke_3DRect_Embossed(pGS, rtWidget, fThickness, matrix); break; + default: + NOTREACHED(); + break; } return; } @@ -777,7 +781,7 @@ void XFA_BOX_Stroke_Rect(CXFA_BoxData boxData, strokeData1 = strokes[0]; if (strokeData1.IsInverted()) bSameStyles = false; - if (strokeData1.GetJoinType() != XFA_ATTRIBUTEENUM_Square) + if (strokeData1.GetJoinType() != XFA_AttributeEnum::Square) bSameStyles = false; } } @@ -834,36 +838,36 @@ void XFA_BOX_Stroke(CXFA_BoxData boxData, float fThickness = std::fmax(0.0, CXFA_EdgeData(strokes[i].GetNode()).GetThickness()); float fHalf = fThickness / 2; - int32_t iHand = boxData.GetHand(); + XFA_AttributeEnum iHand = boxData.GetHand(); switch (i) { case 1: - if (iHand == XFA_ATTRIBUTEENUM_Left) { + if (iHand == XFA_AttributeEnum::Left) { rtWidget.top -= fHalf; rtWidget.height += fHalf; - } else if (iHand == XFA_ATTRIBUTEENUM_Right) { + } else if (iHand == XFA_AttributeEnum::Right) { rtWidget.top += fHalf; rtWidget.height -= fHalf; } break; case 3: - if (iHand == XFA_ATTRIBUTEENUM_Left) { + if (iHand == XFA_AttributeEnum::Left) { rtWidget.width += fHalf; - } else if (iHand == XFA_ATTRIBUTEENUM_Right) { + } else if (iHand == XFA_AttributeEnum::Right) { rtWidget.width -= fHalf; } break; case 5: - if (iHand == XFA_ATTRIBUTEENUM_Left) { + if (iHand == XFA_AttributeEnum::Left) { rtWidget.height += fHalf; - } else if (iHand == XFA_ATTRIBUTEENUM_Right) { + } else if (iHand == XFA_AttributeEnum::Right) { rtWidget.height -= fHalf; } break; case 7: - if (iHand == XFA_ATTRIBUTEENUM_Left) { + if (iHand == XFA_AttributeEnum::Left) { rtWidget.left -= fHalf; rtWidget.width += fHalf; - } else if (iHand == XFA_ATTRIBUTEENUM_Right) { + } else if (iHand == XFA_AttributeEnum::Right) { rtWidget.left += fHalf; rtWidget.width -= fHalf; } @@ -879,7 +883,7 @@ void XFA_DrawBox(CXFA_BoxData boxData, const CFX_Matrix& matrix, uint32_t dwFlags) { if (!boxData.HasValidNode() || - boxData.GetPresence() != XFA_ATTRIBUTEENUM_Visible) { + boxData.GetPresence() != XFA_AttributeEnum::Visible) { return; } @@ -1082,7 +1086,7 @@ bool CXFA_FFWidget::OnSetFocus(CXFA_FFWidget* pOldWidget) { CXFA_EventParam eParam; eParam.m_eType = XFA_EVENT_Enter; eParam.m_pTarget = m_pDataAcc.Get(); - m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Enter, &eParam); + m_pDataAcc->ProcessEvent(XFA_AttributeEnum::Enter, &eParam); return true; } @@ -1196,7 +1200,7 @@ CFX_PointF CXFA_FFWidget::Rotate2Normal(const CFX_PointF& point) { static void XFA_GetMatrix(CFX_Matrix& m, int32_t iRotate, - XFA_ATTRIBUTEENUM at, + XFA_AttributeEnum at, const CFX_RectF& rt) { if (!iRotate) { return; @@ -1204,32 +1208,32 @@ static void XFA_GetMatrix(CFX_Matrix& m, float fAnchorX = 0; float fAnchorY = 0; switch (at) { - case XFA_ATTRIBUTEENUM_TopLeft: + case XFA_AttributeEnum::TopLeft: fAnchorX = rt.left, fAnchorY = rt.top; break; - case XFA_ATTRIBUTEENUM_TopCenter: + case XFA_AttributeEnum::TopCenter: fAnchorX = (rt.left + rt.right()) / 2, fAnchorY = rt.top; break; - case XFA_ATTRIBUTEENUM_TopRight: + case XFA_AttributeEnum::TopRight: fAnchorX = rt.right(), fAnchorY = rt.top; break; - case XFA_ATTRIBUTEENUM_MiddleLeft: + case XFA_AttributeEnum::MiddleLeft: fAnchorX = rt.left, fAnchorY = (rt.top + rt.bottom()) / 2; break; - case XFA_ATTRIBUTEENUM_MiddleCenter: + case XFA_AttributeEnum::MiddleCenter: fAnchorX = (rt.left + rt.right()) / 2, fAnchorY = (rt.top + rt.bottom()) / 2; break; - case XFA_ATTRIBUTEENUM_MiddleRight: + case XFA_AttributeEnum::MiddleRight: fAnchorX = rt.right(), fAnchorY = (rt.top + rt.bottom()) / 2; break; - case XFA_ATTRIBUTEENUM_BottomLeft: + case XFA_AttributeEnum::BottomLeft: fAnchorX = rt.left, fAnchorY = rt.bottom(); break; - case XFA_ATTRIBUTEENUM_BottomCenter: + case XFA_AttributeEnum::BottomCenter: fAnchorX = (rt.left + rt.right()) / 2, fAnchorY = rt.bottom(); break; - case XFA_ATTRIBUTEENUM_BottomRight: + case XFA_AttributeEnum::BottomRight: fAnchorX = rt.right(), fAnchorY = rt.bottom(); break; default: @@ -1258,7 +1262,7 @@ CFX_Matrix CXFA_FFWidget::GetRotateMatrix() { return mt; CFX_RectF rcWidget = GetRectWithoutRotate(); - XFA_ATTRIBUTEENUM at = XFA_ATTRIBUTEENUM_TopLeft; + XFA_AttributeEnum at = XFA_AttributeEnum::TopLeft; XFA_GetMatrix(mt, iRotate, at, rcWidget); return mt; @@ -1332,7 +1336,7 @@ void CXFA_FFWidget::EventKillFocus() { CXFA_EventParam eParam; eParam.m_eType = XFA_EVENT_Exit; eParam.m_pTarget = m_pDataAcc.Get(); - m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Exit, &eParam); + m_pDataAcc->ProcessEvent(XFA_AttributeEnum::Exit, &eParam); } bool CXFA_FFWidget::IsButtonDown() { @@ -1345,21 +1349,21 @@ void CXFA_FFWidget::SetButtonDown(bool bSet) { } int32_t XFA_StrokeTypeSetLineDash(CXFA_Graphics* pGraphics, - XFA_ATTRIBUTEENUM iStrokeType, - XFA_ATTRIBUTEENUM iCapType) { + XFA_AttributeEnum iStrokeType, + XFA_AttributeEnum iCapType) { switch (iStrokeType) { - case XFA_ATTRIBUTEENUM_DashDot: { + case XFA_AttributeEnum::DashDot: { float dashArray[] = {4, 1, 2, 1}; - if (iCapType != XFA_ATTRIBUTEENUM_Butt) { + if (iCapType != XFA_AttributeEnum::Butt) { dashArray[1] = 2; dashArray[3] = 2; } pGraphics->SetLineDash(0, dashArray, 4); return FX_DASHSTYLE_DashDot; } - case XFA_ATTRIBUTEENUM_DashDotDot: { + case XFA_AttributeEnum::DashDotDot: { float dashArray[] = {4, 1, 2, 1, 2, 1}; - if (iCapType != XFA_ATTRIBUTEENUM_Butt) { + if (iCapType != XFA_AttributeEnum::Butt) { dashArray[1] = 2; dashArray[3] = 2; dashArray[5] = 2; @@ -1367,17 +1371,17 @@ int32_t XFA_StrokeTypeSetLineDash(CXFA_Graphics* pGraphics, pGraphics->SetLineDash(0, dashArray, 6); return FX_DASHSTYLE_DashDotDot; } - case XFA_ATTRIBUTEENUM_Dashed: { + case XFA_AttributeEnum::Dashed: { float dashArray[] = {5, 1}; - if (iCapType != XFA_ATTRIBUTEENUM_Butt) + if (iCapType != XFA_AttributeEnum::Butt) dashArray[1] = 2; pGraphics->SetLineDash(0, dashArray, 2); return FX_DASHSTYLE_Dash; } - case XFA_ATTRIBUTEENUM_Dotted: { + case XFA_AttributeEnum::Dotted: { float dashArray[] = {2, 1}; - if (iCapType != XFA_ATTRIBUTEENUM_Butt) + if (iCapType != XFA_AttributeEnum::Butt) dashArray[1] = 2; pGraphics->SetLineDash(0, dashArray, 2); @@ -1666,11 +1670,11 @@ void XFA_DrawImage(CXFA_Graphics* pGS, const CFX_RectF& rtImage, const CFX_Matrix& matrix, const RetainPtr<CFX_DIBitmap>& pDIBitmap, - XFA_ATTRIBUTEENUM iAspect, + XFA_AttributeEnum iAspect, int32_t iImageXDpi, int32_t iImageYDpi, - XFA_ATTRIBUTEENUM iHorzAlign, - XFA_ATTRIBUTEENUM iVertAlign) { + XFA_AttributeEnum iHorzAlign, + XFA_AttributeEnum iVertAlign) { if (rtImage.IsEmpty()) return; if (!pDIBitmap || !pDIBitmap->GetBuffer()) @@ -1681,7 +1685,7 @@ void XFA_DrawImage(CXFA_Graphics* pGS, XFA_UnitPx2Pt((float)pDIBitmap->GetWidth(), (float)iImageXDpi), XFA_UnitPx2Pt((float)pDIBitmap->GetHeight(), (float)iImageYDpi)); switch (iAspect) { - case XFA_ATTRIBUTEENUM_Fit: { + case XFA_AttributeEnum::Fit: { float f1 = rtImage.height / rtFit.height; float f2 = rtImage.width / rtFit.width; f1 = std::min(f1, f2); @@ -1689,35 +1693,35 @@ void XFA_DrawImage(CXFA_Graphics* pGS, rtFit.width = rtFit.width * f1; break; } - case XFA_ATTRIBUTEENUM_Height: { + case XFA_AttributeEnum::Height: { float f1 = rtImage.height / rtFit.height; rtFit.height = rtImage.height; rtFit.width = f1 * rtFit.width; break; } - case XFA_ATTRIBUTEENUM_None: + case XFA_AttributeEnum::None: rtFit.height = rtImage.height; rtFit.width = rtImage.width; break; - case XFA_ATTRIBUTEENUM_Width: { + case XFA_AttributeEnum::Width: { float f1 = rtImage.width / rtFit.width; rtFit.width = rtImage.width; rtFit.height = rtFit.height * f1; break; } - case XFA_ATTRIBUTEENUM_Actual: + case XFA_AttributeEnum::Actual: default: break; } - if (iHorzAlign == XFA_ATTRIBUTEENUM_Center) + if (iHorzAlign == XFA_AttributeEnum::Center) rtFit.left += (rtImage.width - rtFit.width) / 2; - else if (iHorzAlign == XFA_ATTRIBUTEENUM_Right) + else if (iHorzAlign == XFA_AttributeEnum::Right) rtFit.left = rtImage.right() - rtFit.width; - if (iVertAlign == XFA_ATTRIBUTEENUM_Middle) + if (iVertAlign == XFA_AttributeEnum::Middle) rtFit.top += (rtImage.height - rtFit.height) / 2; - else if (iVertAlign == XFA_ATTRIBUTEENUM_Bottom) + else if (iVertAlign == XFA_AttributeEnum::Bottom) rtFit.top = rtImage.bottom() - rtImage.height; CFX_RenderDevice* pRenderDevice = pGS->GetRenderDevice(); @@ -1886,8 +1890,8 @@ RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc, uint8_t* pImageBuffer = nullptr; RetainPtr<IFX_SeekableReadStream> pImageFileRead; if (wsImage.GetLength() > 0) { - XFA_ATTRIBUTEENUM iEncoding = pImageData->GetTransferEncoding(); - if (iEncoding == XFA_ATTRIBUTEENUM_Base64) { + XFA_AttributeEnum iEncoding = pImageData->GetTransferEncoding(); + if (iEncoding == XFA_AttributeEnum::Base64) { ByteString bsData = wsImage.UTF8Encode(); int32_t iLength = bsData.GetLength(); pImageBuffer = FX_Alloc(uint8_t, iLength); diff --git a/xfa/fxfa/cxfa_ffwidget.h b/xfa/fxfa/cxfa_ffwidget.h index 4e9863cb5c..e9f88e9c14 100644 --- a/xfa/fxfa/cxfa_ffwidget.h +++ b/xfa/fxfa/cxfa_ffwidget.h @@ -35,17 +35,17 @@ enum XFA_WIDGETITEM { }; int32_t XFA_StrokeTypeSetLineDash(CXFA_Graphics* pGraphics, - XFA_ATTRIBUTEENUM iStrokeType, - XFA_ATTRIBUTEENUM iCapType); + XFA_AttributeEnum iStrokeType, + XFA_AttributeEnum iCapType); void XFA_DrawImage(CXFA_Graphics* pGS, const CFX_RectF& rtImage, const CFX_Matrix& matrix, const RetainPtr<CFX_DIBitmap>& pDIBitmap, - XFA_ATTRIBUTEENUM iAspect, + XFA_AttributeEnum iAspect, int32_t iImageXDpi, int32_t iImageYDpi, - XFA_ATTRIBUTEENUM iHorzAlign = XFA_ATTRIBUTEENUM_Left, - XFA_ATTRIBUTEENUM iVertAlign = XFA_ATTRIBUTEENUM_Top); + XFA_AttributeEnum iHorzAlign = XFA_AttributeEnum::Left, + XFA_AttributeEnum iVertAlign = XFA_AttributeEnum::Top); RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc, CXFA_ImageData* pImageData, diff --git a/xfa/fxfa/cxfa_ffwidgethandler.cpp b/xfa/fxfa/cxfa_ffwidgethandler.cpp index 6e142d3c4f..372abffa96 100644 --- a/xfa/fxfa/cxfa_ffwidgethandler.cpp +++ b/xfa/fxfa/cxfa_ffwidgethandler.cpp @@ -317,18 +317,18 @@ CXFA_Node* CXFA_FFWidgetHandler::CreatePushButton(CXFA_Node* pParent, pText->JSNode()->SetContent(L"Button", L"Button", false, false, true); CXFA_Node* pPara = CreateCopyNode(XFA_Element::Para, pCaption); - pPara->JSNode()->SetEnum(XFA_Attribute::VAlign, XFA_ATTRIBUTEENUM_Middle, + pPara->JSNode()->SetEnum(XFA_Attribute::VAlign, XFA_AttributeEnum::Middle, false); - pPara->JSNode()->SetEnum(XFA_Attribute::HAlign, XFA_ATTRIBUTEENUM_Center, + pPara->JSNode()->SetEnum(XFA_Attribute::HAlign, XFA_AttributeEnum::Center, false); CreateFontNode(pCaption); CXFA_Node* pBorder = CreateCopyNode(XFA_Element::Border, pField); - pBorder->JSNode()->SetEnum(XFA_Attribute::Hand, XFA_ATTRIBUTEENUM_Right, + pBorder->JSNode()->SetEnum(XFA_Attribute::Hand, XFA_AttributeEnum::Right, false); CXFA_Node* pEdge = CreateCopyNode(XFA_Element::Edge, pBorder); - pEdge->JSNode()->SetEnum(XFA_Attribute::Stroke, XFA_ATTRIBUTEENUM_Raised, + pEdge->JSNode()->SetEnum(XFA_Attribute::Stroke, XFA_AttributeEnum::Raised, false); CXFA_Node* pFill = CreateCopyNode(XFA_Element::Fill, pBorder); @@ -337,7 +337,8 @@ CXFA_Node* CXFA_FFWidgetHandler::CreatePushButton(CXFA_Node* pParent, false); CXFA_Node* pBind = CreateCopyNode(XFA_Element::Bind, pField); - pBind->JSNode()->SetEnum(XFA_Attribute::Match, XFA_ATTRIBUTEENUM_None, false); + pBind->JSNode()->SetEnum(XFA_Attribute::Match, XFA_AttributeEnum::None, + false); return pField; } @@ -357,7 +358,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateRadioButton(CXFA_Node* pParent, CXFA_Node* pField = CreateField(XFA_Element::CheckButton, pParent, pBefore); CXFA_Node* pUi = pField->GetFirstChildByClass(XFA_Element::Ui); CXFA_Node* pWidget = pUi->GetFirstChildByClass(XFA_Element::CheckButton); - pWidget->JSNode()->SetEnum(XFA_Attribute::Shape, XFA_ATTRIBUTEENUM_Round, + pWidget->JSNode()->SetEnum(XFA_Attribute::Shape, XFA_AttributeEnum::Round, false); return pField; } @@ -401,9 +402,9 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateListBox(CXFA_Node* pParent, CXFA_Node* pField = CreateDropdownList(pParent, pBefore); CXFA_Node* pUi = pField->GetNodeItem(XFA_NODEITEM_FirstChild); CXFA_Node* pListBox = pUi->GetNodeItem(XFA_NODEITEM_FirstChild); - pListBox->JSNode()->SetEnum(XFA_Attribute::Open, XFA_ATTRIBUTEENUM_Always, + pListBox->JSNode()->SetEnum(XFA_Attribute::Open, XFA_AttributeEnum::Always, false); - pListBox->JSNode()->SetEnum(XFA_Attribute::CommitOn, XFA_ATTRIBUTEENUM_Exit, + pListBox->JSNode()->SetEnum(XFA_Attribute::CommitOn, XFA_AttributeEnum::Exit, false); return pField; } @@ -417,7 +418,8 @@ CXFA_Node* CXFA_FFWidgetHandler::CreatePasswordEdit(CXFA_Node* pParent, CXFA_Node* pBefore) const { CXFA_Node* pField = CreateField(XFA_Element::PasswordEdit, pParent, pBefore); CXFA_Node* pBind = CreateCopyNode(XFA_Element::Bind, pField); - pBind->JSNode()->SetEnum(XFA_Attribute::Match, XFA_ATTRIBUTEENUM_None, false); + pBind->JSNode()->SetEnum(XFA_Attribute::Match, XFA_AttributeEnum::None, + false); return pField; } diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp index e951e3fe3a..ed36426578 100644 --- a/xfa/fxfa/cxfa_textlayout.cpp +++ b/xfa/fxfa/cxfa_textlayout.cpp @@ -108,20 +108,20 @@ void CXFA_TextLayout::InitBreak(float fLineWidth) { if (paraData.HasValidNode()) { CFX_RTFLineAlignment iAlign = CFX_RTFLineAlignment::Left; switch (paraData.GetHorizontalAlign()) { - case XFA_ATTRIBUTEENUM_Center: + case XFA_AttributeEnum::Center: iAlign = CFX_RTFLineAlignment::Center; break; - case XFA_ATTRIBUTEENUM_Right: + case XFA_AttributeEnum::Right: iAlign = CFX_RTFLineAlignment::Right; break; - case XFA_ATTRIBUTEENUM_Justify: + case XFA_AttributeEnum::Justify: iAlign = CFX_RTFLineAlignment::Justified; break; - case XFA_ATTRIBUTEENUM_JustifyAll: + case XFA_AttributeEnum::JustifyAll: iAlign = CFX_RTFLineAlignment::Distributed; break; - case XFA_ATTRIBUTEENUM_Left: - case XFA_ATTRIBUTEENUM_Radix: + case XFA_AttributeEnum::Left: + case XFA_AttributeEnum::Radix: break; default: NOTREACHED(); @@ -313,10 +313,10 @@ float CXFA_TextLayout::DoLayout(int32_t iBlockIndex, if (iBlockCount == 0 && fHeight > 0) { fHeight = fTextHeight - GetLayoutHeight(); if (fHeight > 0) { - int32_t iAlign = m_textParser.GetVAlign(m_pTextProvider); - if (iAlign == XFA_ATTRIBUTEENUM_Middle) + XFA_AttributeEnum iAlign = m_textParser.GetVAlign(m_pTextProvider); + if (iAlign == XFA_AttributeEnum::Middle) fHeight /= 2.0f; - else if (iAlign != XFA_ATTRIBUTEENUM_Bottom) + else if (iAlign != XFA_AttributeEnum::Bottom) fHeight = 0; m_pLoader->m_fStartLineOffset = fHeight; } @@ -607,10 +607,10 @@ void CXFA_TextLayout::UpdateAlign(float fHeight, float fBottom) { return; switch (m_textParser.GetVAlign(m_pTextProvider)) { - case XFA_ATTRIBUTEENUM_Middle: + case XFA_AttributeEnum::Middle: fHeight /= 2.0f; break; - case XFA_ATTRIBUTEENUM_Bottom: + case XFA_AttributeEnum::Bottom: break; default: return; @@ -659,9 +659,9 @@ void CXFA_TextLayout::LoadText(CXFA_Node* pNode, fSpaceAbove = 0; switch (paraData.GetVerticalAlign()) { - case XFA_ATTRIBUTEENUM_Top: - case XFA_ATTRIBUTEENUM_Middle: - case XFA_ATTRIBUTEENUM_Bottom: { + case XFA_AttributeEnum::Top: + case XFA_AttributeEnum::Middle: + case XFA_AttributeEnum::Bottom: { fLinePos += fSpaceAbove; break; } @@ -1161,7 +1161,7 @@ void CXFA_TextLayout::RenderPath(CFX_RenderDevice* pDevice, if (iChars > 0) { CFX_PointF pt1, pt2; float fEndY = pCharPos[0].m_Origin.y + 1.05f; - if (pPiece->iPeriod == XFA_ATTRIBUTEENUM_Word) { + if (pPiece->iPeriod == XFA_AttributeEnum::Word) { for (int32_t i = 0; i < pPiece->iUnderline; i++) { for (int32_t j = 0; j < iChars; j++) { pt1.x = pCharPos[j].m_Origin.x; @@ -1194,7 +1194,7 @@ void CXFA_TextLayout::RenderPath(CFX_RenderDevice* pDevice, } } else { if (bNoLineThrough && - (bNoUnderline || pPiece->iPeriod != XFA_ATTRIBUTEENUM_All)) { + (bNoUnderline || pPiece->iPeriod != XFA_AttributeEnum::All)) { return; } int32_t iCharsTmp = 0; diff --git a/xfa/fxfa/cxfa_textparser.cpp b/xfa/fxfa/cxfa_textparser.cpp index 433531373c..9260ab0835 100644 --- a/xfa/fxfa/cxfa_textparser.cpp +++ b/xfa/fxfa/cxfa_textparser.cpp @@ -103,20 +103,20 @@ RetainPtr<CFX_CSSComputedStyle> CXFA_TextParser::CreateRootStyle( pStyle->SetTextIndent(indent); CFX_CSSTextAlign hAlign = CFX_CSSTextAlign::Left; switch (paraData.GetHorizontalAlign()) { - case XFA_ATTRIBUTEENUM_Center: + case XFA_AttributeEnum::Center: hAlign = CFX_CSSTextAlign::Center; break; - case XFA_ATTRIBUTEENUM_Right: + case XFA_AttributeEnum::Right: hAlign = CFX_CSSTextAlign::Right; break; - case XFA_ATTRIBUTEENUM_Justify: + case XFA_AttributeEnum::Justify: hAlign = CFX_CSSTextAlign::Justify; break; - case XFA_ATTRIBUTEENUM_JustifyAll: + case XFA_AttributeEnum::JustifyAll: hAlign = CFX_CSSTextAlign::JustifyAll; break; - case XFA_ATTRIBUTEENUM_Left: - case XFA_ATTRIBUTEENUM_Radix: + case XFA_AttributeEnum::Left: + case XFA_AttributeEnum::Radix: break; default: NOTREACHED(); @@ -297,11 +297,11 @@ std::unique_ptr<CXFA_TextParser::TagProvider> CXFA_TextParser::ParseTagInfo( return tagProvider; } -XFA_ATTRIBUTEENUM CXFA_TextParser::GetVAlign( +XFA_AttributeEnum CXFA_TextParser::GetVAlign( CXFA_TextProvider* pTextProvider) const { CXFA_ParaData paraData = pTextProvider->GetParaData(); return paraData.HasValidNode() ? paraData.GetVerticalAlign() - : XFA_ATTRIBUTEENUM_Top; + : XFA_AttributeEnum::Top; } float CXFA_TextParser::GetTabInterval(CFX_CSSComputedStyle* pStyle) const { @@ -412,9 +412,9 @@ int32_t CXFA_TextParser::GetVerScale(CXFA_TextProvider* pTextProvider, void CXFA_TextParser::GetUnderline(CXFA_TextProvider* pTextProvider, CFX_CSSComputedStyle* pStyle, int32_t& iUnderline, - int32_t& iPeriod) const { + XFA_AttributeEnum& iPeriod) const { iUnderline = 0; - iPeriod = XFA_ATTRIBUTEENUM_All; + iPeriod = XFA_AttributeEnum::All; CXFA_FontData fontData = pTextProvider->GetFontData(); if (!pStyle) { if (fontData.HasValidNode()) { @@ -433,7 +433,7 @@ void CXFA_TextParser::GetUnderline(CXFA_TextProvider* pTextProvider, WideString wsValue; if (pStyle->GetCustomStyle(L"underlinePeriod", wsValue)) { if (wsValue == L"word") - iPeriod = XFA_ATTRIBUTEENUM_Word; + iPeriod = XFA_AttributeEnum::Word; } else if (fontData.HasValidNode()) { iPeriod = fontData.GetUnderlinePeriod(); } diff --git a/xfa/fxfa/cxfa_textparser.h b/xfa/fxfa/cxfa_textparser.h index 09ef8dbbb2..4c0c95e356 100644 --- a/xfa/fxfa/cxfa_textparser.h +++ b/xfa/fxfa/cxfa_textparser.h @@ -41,7 +41,7 @@ class CXFA_TextParser { bool IsParsed() const { return m_bParsed; } - XFA_ATTRIBUTEENUM GetVAlign(CXFA_TextProvider* pTextProvider) const; + XFA_AttributeEnum GetVAlign(CXFA_TextProvider* pTextProvider) const; float GetTabInterval(CFX_CSSComputedStyle* pStyle) const; int32_t CountTabs(CFX_CSSComputedStyle* pStyle) const; @@ -64,7 +64,7 @@ class CXFA_TextParser { void GetUnderline(CXFA_TextProvider* pTextProvider, CFX_CSSComputedStyle* pStyle, int32_t& iUnderline, - int32_t& iPeriod) const; + XFA_AttributeEnum& iPeriod) const; void GetLinethrough(CXFA_TextProvider* pTextProvider, CFX_CSSComputedStyle* pStyle, int32_t& iLinethrough) const; diff --git a/xfa/fxfa/cxfa_textpiece.h b/xfa/fxfa/cxfa_textpiece.h index b5025d2970..b4453b0f36 100644 --- a/xfa/fxfa/cxfa_textpiece.h +++ b/xfa/fxfa/cxfa_textpiece.h @@ -13,6 +13,7 @@ #include "core/fxcrt/fx_string.h" #include "core/fxge/fx_dib.h" #include "xfa/fgas/font/cfgas_gefont.h" +#include "xfa/fxfa/fxfa_basic.h" class CXFA_LinkUserData; @@ -28,7 +29,7 @@ class CXFA_TextPiece { int32_t iVerScale; int32_t iBidiLevel; int32_t iUnderline; - int32_t iPeriod; + XFA_AttributeEnum iPeriod; int32_t iLineThrough; FX_ARGB dwColor; float fFontSize; diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp index 16bde8e456..c55f007584 100644 --- a/xfa/fxfa/cxfa_widgetacc.cpp +++ b/xfa/fxfa/cxfa_widgetacc.cpp @@ -246,7 +246,7 @@ void CXFA_WidgetAcc::SetImageEdit(const WideString& wsContentType, CXFA_Node* pBind = GetDatasets(); if (!pBind) { - imageData.SetTransferEncoding(XFA_ATTRIBUTEENUM_Base64); + imageData.SetTransferEncoding(XFA_AttributeEnum::Base64); return; } pBind->JSNode()->SetCData(XFA_Attribute::ContentType, wsContentType, false, @@ -276,7 +276,7 @@ IXFA_AppProvider* CXFA_WidgetAcc::GetAppProvider() { return GetDoc()->GetApp()->GetAppProvider(); } -int32_t CXFA_WidgetAcc::ProcessEvent(XFA_ATTRIBUTEENUM iActivity, +int32_t CXFA_WidgetAcc::ProcessEvent(XFA_AttributeEnum iActivity, CXFA_EventParam* pEventParam) { if (GetElementType() == XFA_Element::Draw) return XFA_EVENTERROR_NotExist; @@ -353,7 +353,7 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_ValidateData validateData, WideString wsTitle = pAppProvider->GetAppTitle(); WideString wsScriptMsg = validateData.GetScriptMessageText(); - if (validateData.GetScriptTest() == XFA_ATTRIBUTEENUM_Warning) { + if (validateData.GetScriptTest() == XFA_AttributeEnum::Warning) { if (GetNode()->IsUserInteractive()) return; if (wsScriptMsg.IsEmpty()) @@ -397,7 +397,7 @@ int32_t CXFA_WidgetAcc::ProcessFormatTestValidate( WideString wsFormatMsg = validateData.GetFormatMessageText(); WideString wsTitle = pAppProvider->GetAppTitle(); - if (validateData.GetFormatTest() == XFA_ATTRIBUTEENUM_Error) { + if (validateData.GetFormatTest() == XFA_AttributeEnum::Error) { if (wsFormatMsg.IsEmpty()) wsFormatMsg = GetValidateMessage(true, bVersionFlag); pAppProvider->MsgBox(wsFormatMsg, wsTitle, XFA_MBICON_Error, XFA_MB_OK); @@ -431,15 +431,15 @@ int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_ValidateData validateData, if (IsNull() && IsPreNull()) return XFA_EVENTERROR_Success; - XFA_ATTRIBUTEENUM eNullTest = validateData.GetNullTest(); + XFA_AttributeEnum eNullTest = validateData.GetNullTest(); WideString wsNullMsg = validateData.GetNullMessageText(); if (iFlags & 0x01) { int32_t iRet = XFA_EVENTERROR_Success; - if (eNullTest != XFA_ATTRIBUTEENUM_Disabled) + if (eNullTest != XFA_AttributeEnum::Disabled) iRet = XFA_EVENTERROR_Error; if (!wsNullMsg.IsEmpty()) { - if (eNullTest != XFA_ATTRIBUTEENUM_Disabled) { + if (eNullTest != XFA_AttributeEnum::Disabled) { m_pDocView->m_arrNullTestMsg.push_back(wsNullMsg); return XFA_EVENTERROR_Error; } @@ -448,7 +448,7 @@ int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_ValidateData validateData, return iRet; } if (wsNullMsg.IsEmpty() && bVersionFlag && - eNullTest != XFA_ATTRIBUTEENUM_Disabled) { + eNullTest != XFA_AttributeEnum::Disabled) { return XFA_EVENTERROR_Error; } IXFA_AppProvider* pAppProvider = GetAppProvider(); @@ -458,7 +458,7 @@ int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_ValidateData validateData, WideString wsCaptionName; WideString wsTitle = pAppProvider->GetAppTitle(); switch (eNullTest) { - case XFA_ATTRIBUTEENUM_Error: { + case XFA_AttributeEnum::Error: { if (wsNullMsg.IsEmpty()) { wsCaptionName = GetValidateCaptionName(bVersionFlag); wsNullMsg = @@ -467,7 +467,7 @@ int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_ValidateData validateData, pAppProvider->MsgBox(wsNullMsg, wsTitle, XFA_MBICON_Status, XFA_MB_OK); return XFA_EVENTERROR_Error; } - case XFA_ATTRIBUTEENUM_Warning: { + case XFA_AttributeEnum::Warning: { if (GetNode()->IsUserInteractive()) return true; @@ -483,7 +483,7 @@ int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_ValidateData validateData, } return XFA_EVENTERROR_Error; } - case XFA_ATTRIBUTEENUM_Disabled: + case XFA_AttributeEnum::Disabled: default: break; } @@ -584,7 +584,7 @@ std::pair<int32_t, bool> CXFA_WidgetAcc::ExecuteBoolScript( ASSERT(pEventParam); if (!scriptData.HasValidNode()) return {XFA_EVENTERROR_NotExist, false}; - if (scriptData.GetRunAt() == XFA_ATTRIBUTEENUM_Server) + if (scriptData.GetRunAt() == XFA_AttributeEnum::Server) return {XFA_EVENTERROR_Disabled, false}; WideString wsExpression = scriptData.GetExpression(); @@ -679,10 +679,10 @@ void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF& szCap) { LoadCaption(); XFA_Element eUIType = GetUIType(); - XFA_ATTRIBUTEENUM iCapPlacement = captionData.GetPlacementType(); + XFA_AttributeEnum iCapPlacement = captionData.GetPlacementType(); float fCapReserve = captionData.GetReserve(); - const bool bVert = iCapPlacement == XFA_ATTRIBUTEENUM_Top || - iCapPlacement == XFA_ATTRIBUTEENUM_Bottom; + const bool bVert = iCapPlacement == XFA_AttributeEnum::Top || + iCapPlacement == XFA_AttributeEnum::Bottom; const bool bReserveExit = fCapReserve > 0.01; CXFA_TextLayout* pCapTextLayout = static_cast<CXFA_FieldLayoutData*>(m_pLayoutData.get()) @@ -738,14 +738,14 @@ bool CXFA_WidgetAcc::CalculateFieldAutoSize(CFX_SizeF& size) { size.height += rtUIMargin.top + rtUIMargin.height; if (szCap.width > 0 && szCap.height > 0) { switch (GetCaptionData().GetPlacementType()) { - case XFA_ATTRIBUTEENUM_Left: - case XFA_ATTRIBUTEENUM_Right: - case XFA_ATTRIBUTEENUM_Inline: { + case XFA_AttributeEnum::Left: + case XFA_AttributeEnum::Right: + case XFA_AttributeEnum::Inline: { size.width += szCap.width; size.height = std::max(size.height, szCap.height); } break; - case XFA_ATTRIBUTEENUM_Top: - case XFA_ATTRIBUTEENUM_Bottom: { + case XFA_AttributeEnum::Top: + case XFA_AttributeEnum::Bottom: { size.height += szCap.height; size.width = std::max(size.width, szCap.width); } @@ -834,13 +834,13 @@ bool CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) { CFX_SizeF szCap; CalcCaptionSize(szCap); bool bCapExit = szCap.width > 0.01 && szCap.height > 0.01; - XFA_ATTRIBUTEENUM iCapPlacement = XFA_ATTRIBUTEENUM_Unknown; + XFA_AttributeEnum iCapPlacement = XFA_AttributeEnum::Unknown; if (bCapExit) { iCapPlacement = GetCaptionData().GetPlacementType(); switch (iCapPlacement) { - case XFA_ATTRIBUTEENUM_Left: - case XFA_ATTRIBUTEENUM_Right: - case XFA_ATTRIBUTEENUM_Inline: { + case XFA_AttributeEnum::Left: + case XFA_AttributeEnum::Right: + case XFA_AttributeEnum::Inline: { size.width -= szCap.width; } default: @@ -857,13 +857,13 @@ bool CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) { size.height += rtUIMargin.top + rtUIMargin.height; if (bCapExit) { switch (iCapPlacement) { - case XFA_ATTRIBUTEENUM_Left: - case XFA_ATTRIBUTEENUM_Right: - case XFA_ATTRIBUTEENUM_Inline: { + case XFA_AttributeEnum::Left: + case XFA_AttributeEnum::Right: + case XFA_AttributeEnum::Inline: { size.height = std::max(size.height, szCap.height); } break; - case XFA_ATTRIBUTEENUM_Top: - case XFA_ATTRIBUTEENUM_Bottom: { + case XFA_AttributeEnum::Top: + case XFA_AttributeEnum::Bottom: { size.height += szCap.height; } default: @@ -1169,7 +1169,7 @@ bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, float& fCalcHeight) { } return true; } - XFA_ATTRIBUTEENUM iCapPlacement = XFA_ATTRIBUTEENUM_Unknown; + XFA_AttributeEnum iCapPlacement = XFA_AttributeEnum::Unknown; float fCapReserve = 0; if (iBlockIndex == 0) { CXFA_CaptionData captionData = GetCaptionData(); @@ -1177,17 +1177,17 @@ bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, float& fCalcHeight) { iCapPlacement = captionData.GetPlacementType(); fCapReserve = captionData.GetReserve(); } - if (iCapPlacement == XFA_ATTRIBUTEENUM_Top && + if (iCapPlacement == XFA_AttributeEnum::Top && fCalcHeight < fCapReserve + fTopInset) { fCalcHeight = 0; return true; } - if (iCapPlacement == XFA_ATTRIBUTEENUM_Bottom && + if (iCapPlacement == XFA_AttributeEnum::Bottom && m_pLayoutData->m_fWidgetHeight - fCapReserve - fBottomInset) { fCalcHeight = 0; return true; } - if (iCapPlacement != XFA_ATTRIBUTEENUM_Top) + if (iCapPlacement != XFA_AttributeEnum::Top) fCapReserve = 0; } CXFA_FieldLayoutData* pFieldData = @@ -1228,13 +1228,13 @@ bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, float& fCalcHeight) { float fSpaceBelow = paraData.GetSpaceBelow(); fHeight -= (fSpaceAbove + fSpaceBelow); switch (paraData.GetVerticalAlign()) { - case XFA_ATTRIBUTEENUM_Top: + case XFA_AttributeEnum::Top: fStartOffset += fSpaceAbove; break; - case XFA_ATTRIBUTEENUM_Middle: + case XFA_AttributeEnum::Middle: fStartOffset += ((fHeight - fTextHeight) / 2 + fSpaceAbove); break; - case XFA_ATTRIBUTEENUM_Bottom: + case XFA_AttributeEnum::Bottom: fStartOffset += (fHeight - fTextHeight + fSpaceAbove); break; default: @@ -1257,21 +1257,21 @@ bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, float& fCalcHeight) { XFA_VERSION version = GetDoc()->GetXFADoc()->GetCurVersionMode(); bool bCanSplitNoContent = false; - XFA_ATTRIBUTEENUM eLayoutMode = GetNode() + XFA_AttributeEnum eLayoutMode = GetNode() ->GetNodeItem(XFA_NODEITEM_Parent) ->JSNode() ->TryEnum(XFA_Attribute::Layout, true) - .value_or(XFA_ATTRIBUTEENUM_Position); - if ((eLayoutMode == XFA_ATTRIBUTEENUM_Position || - eLayoutMode == XFA_ATTRIBUTEENUM_Tb || - eLayoutMode == XFA_ATTRIBUTEENUM_Row || - eLayoutMode == XFA_ATTRIBUTEENUM_Table) && + .value_or(XFA_AttributeEnum::Position); + if ((eLayoutMode == XFA_AttributeEnum::Position || + eLayoutMode == XFA_AttributeEnum::Tb || + eLayoutMode == XFA_AttributeEnum::Row || + eLayoutMode == XFA_AttributeEnum::Table) && version > XFA_VERSION_208) { bCanSplitNoContent = true; } - if ((eLayoutMode == XFA_ATTRIBUTEENUM_Tb || - eLayoutMode == XFA_ATTRIBUTEENUM_Row || - eLayoutMode == XFA_ATTRIBUTEENUM_Table) && + if ((eLayoutMode == XFA_AttributeEnum::Tb || + eLayoutMode == XFA_AttributeEnum::Row || + eLayoutMode == XFA_AttributeEnum::Table) && version <= XFA_VERSION_208) { if (fStartOffset < fCalcHeight) { bCanSplitNoContent = true; diff --git a/xfa/fxfa/cxfa_widgetacc.h b/xfa/fxfa/cxfa_widgetacc.h index 8bef65a4bf..7b046b4670 100644 --- a/xfa/fxfa/cxfa_widgetacc.h +++ b/xfa/fxfa/cxfa_widgetacc.h @@ -44,7 +44,7 @@ class CXFA_WidgetAcc : public CXFA_WidgetData { CXFA_FFDoc* GetDoc(); bool ProcessValueChanged(); - int32_t ProcessEvent(XFA_ATTRIBUTEENUM iActivity, + int32_t ProcessEvent(XFA_AttributeEnum iActivity, CXFA_EventParam* pEventParam); int32_t ProcessEvent(const CXFA_EventData& eventData, CXFA_EventParam* pEventParam); diff --git a/xfa/fxfa/fxfa_basic.h b/xfa/fxfa/fxfa_basic.h index 0f4ea37e3f..1f375cdcac 100644 --- a/xfa/fxfa/fxfa_basic.h +++ b/xfa/fxfa/fxfa_basic.h @@ -97,273 +97,273 @@ enum XFA_XDPPACKET_FLAGS { XFA_XDPPACKET_FLAGS_SUPPORTMANY = 16, }; -enum XFA_ATTRIBUTEENUM { - XFA_ATTRIBUTEENUM_Asterisk, - XFA_ATTRIBUTEENUM_Slash, - XFA_ATTRIBUTEENUM_Backslash, - XFA_ATTRIBUTEENUM_On, - XFA_ATTRIBUTEENUM_Tb, - XFA_ATTRIBUTEENUM_Up, - XFA_ATTRIBUTEENUM_MetaData, - XFA_ATTRIBUTEENUM_Delegate, - XFA_ATTRIBUTEENUM_PostSubmit, - XFA_ATTRIBUTEENUM_Name, - XFA_ATTRIBUTEENUM_Cross, - XFA_ATTRIBUTEENUM_Next, - XFA_ATTRIBUTEENUM_None, - XFA_ATTRIBUTEENUM_ShortEdge, - XFA_ATTRIBUTEENUM_1mod10_1mod11, - XFA_ATTRIBUTEENUM_Height, - XFA_ATTRIBUTEENUM_CrossDiagonal, - XFA_ATTRIBUTEENUM_All, - XFA_ATTRIBUTEENUM_Any, - XFA_ATTRIBUTEENUM_ToRight, - XFA_ATTRIBUTEENUM_MatchTemplate, - XFA_ATTRIBUTEENUM_Dpl, - XFA_ATTRIBUTEENUM_Invisible, - XFA_ATTRIBUTEENUM_Fit, - XFA_ATTRIBUTEENUM_Width, - XFA_ATTRIBUTEENUM_PreSubmit, - XFA_ATTRIBUTEENUM_Ipl, - XFA_ATTRIBUTEENUM_FlateCompress, - XFA_ATTRIBUTEENUM_Med, - XFA_ATTRIBUTEENUM_Odd, - XFA_ATTRIBUTEENUM_Off, - XFA_ATTRIBUTEENUM_Pdf, - XFA_ATTRIBUTEENUM_Row, - XFA_ATTRIBUTEENUM_Top, - XFA_ATTRIBUTEENUM_Xdp, - XFA_ATTRIBUTEENUM_Xfd, - XFA_ATTRIBUTEENUM_Xml, - XFA_ATTRIBUTEENUM_Zip, - XFA_ATTRIBUTEENUM_Zpl, - XFA_ATTRIBUTEENUM_Visible, - XFA_ATTRIBUTEENUM_Exclude, - XFA_ATTRIBUTEENUM_MouseEnter, - XFA_ATTRIBUTEENUM_Pair, - XFA_ATTRIBUTEENUM_Filter, - XFA_ATTRIBUTEENUM_MoveLast, - XFA_ATTRIBUTEENUM_ExportAndImport, - XFA_ATTRIBUTEENUM_Push, - XFA_ATTRIBUTEENUM_Portrait, - XFA_ATTRIBUTEENUM_Default, - XFA_ATTRIBUTEENUM_StoredProc, - XFA_ATTRIBUTEENUM_StayBOF, - XFA_ATTRIBUTEENUM_StayEOF, - XFA_ATTRIBUTEENUM_PostPrint, - XFA_ATTRIBUTEENUM_UsCarrier, - XFA_ATTRIBUTEENUM_Right, - XFA_ATTRIBUTEENUM_PreOpen, - XFA_ATTRIBUTEENUM_Actual, - XFA_ATTRIBUTEENUM_Rest, - XFA_ATTRIBUTEENUM_TopCenter, - XFA_ATTRIBUTEENUM_StandardSymbol, - XFA_ATTRIBUTEENUM_Initialize, - XFA_ATTRIBUTEENUM_JustifyAll, - XFA_ATTRIBUTEENUM_Normal, - XFA_ATTRIBUTEENUM_Landscape, - XFA_ATTRIBUTEENUM_NonInteractive, - XFA_ATTRIBUTEENUM_MouseExit, - XFA_ATTRIBUTEENUM_Minus, - XFA_ATTRIBUTEENUM_DiagonalLeft, - XFA_ATTRIBUTEENUM_SimplexPaginated, - XFA_ATTRIBUTEENUM_Document, - XFA_ATTRIBUTEENUM_Warning, - XFA_ATTRIBUTEENUM_Auto, - XFA_ATTRIBUTEENUM_Below, - XFA_ATTRIBUTEENUM_BottomLeft, - XFA_ATTRIBUTEENUM_BottomCenter, - XFA_ATTRIBUTEENUM_Tcpl, - XFA_ATTRIBUTEENUM_Text, - XFA_ATTRIBUTEENUM_Grouping, - XFA_ATTRIBUTEENUM_SecureSymbol, - XFA_ATTRIBUTEENUM_PreExecute, - XFA_ATTRIBUTEENUM_DocClose, - XFA_ATTRIBUTEENUM_Keyset, - XFA_ATTRIBUTEENUM_Vertical, - XFA_ATTRIBUTEENUM_PreSave, - XFA_ATTRIBUTEENUM_PreSign, - XFA_ATTRIBUTEENUM_Bottom, - XFA_ATTRIBUTEENUM_ToTop, - XFA_ATTRIBUTEENUM_Verify, - XFA_ATTRIBUTEENUM_First, - XFA_ATTRIBUTEENUM_ContentArea, - XFA_ATTRIBUTEENUM_Solid, - XFA_ATTRIBUTEENUM_Pessimistic, - XFA_ATTRIBUTEENUM_DuplexPaginated, - XFA_ATTRIBUTEENUM_Round, - XFA_ATTRIBUTEENUM_Remerge, - XFA_ATTRIBUTEENUM_Ordered, - XFA_ATTRIBUTEENUM_Percent, - XFA_ATTRIBUTEENUM_Even, - XFA_ATTRIBUTEENUM_Exit, - XFA_ATTRIBUTEENUM_ToolTip, - XFA_ATTRIBUTEENUM_OrderedOccurrence, - XFA_ATTRIBUTEENUM_ReadOnly, - XFA_ATTRIBUTEENUM_Currency, - XFA_ATTRIBUTEENUM_Concat, - XFA_ATTRIBUTEENUM_Thai, - XFA_ATTRIBUTEENUM_Embossed, - XFA_ATTRIBUTEENUM_Formdata, - XFA_ATTRIBUTEENUM_Greek, - XFA_ATTRIBUTEENUM_Decimal, - XFA_ATTRIBUTEENUM_Select, - XFA_ATTRIBUTEENUM_LongEdge, - XFA_ATTRIBUTEENUM_Protected, - XFA_ATTRIBUTEENUM_BottomRight, - XFA_ATTRIBUTEENUM_Zero, - XFA_ATTRIBUTEENUM_ForwardOnly, - XFA_ATTRIBUTEENUM_DocReady, - XFA_ATTRIBUTEENUM_Hidden, - XFA_ATTRIBUTEENUM_Include, - XFA_ATTRIBUTEENUM_Dashed, - XFA_ATTRIBUTEENUM_MultiSelect, - XFA_ATTRIBUTEENUM_Inactive, - XFA_ATTRIBUTEENUM_Embed, - XFA_ATTRIBUTEENUM_Static, - XFA_ATTRIBUTEENUM_OnEntry, - XFA_ATTRIBUTEENUM_Cyrillic, - XFA_ATTRIBUTEENUM_NonBlank, - XFA_ATTRIBUTEENUM_TopRight, - XFA_ATTRIBUTEENUM_Hebrew, - XFA_ATTRIBUTEENUM_TopLeft, - XFA_ATTRIBUTEENUM_Center, - XFA_ATTRIBUTEENUM_MoveFirst, - XFA_ATTRIBUTEENUM_Diamond, - XFA_ATTRIBUTEENUM_PageOdd, - XFA_ATTRIBUTEENUM_1mod10, - XFA_ATTRIBUTEENUM_Korean, - XFA_ATTRIBUTEENUM_AboveEmbedded, - XFA_ATTRIBUTEENUM_ZipCompress, - XFA_ATTRIBUTEENUM_Numeric, - XFA_ATTRIBUTEENUM_Circle, - XFA_ATTRIBUTEENUM_ToBottom, - XFA_ATTRIBUTEENUM_Inverted, - XFA_ATTRIBUTEENUM_Update, - XFA_ATTRIBUTEENUM_Isoname, - XFA_ATTRIBUTEENUM_Server, - XFA_ATTRIBUTEENUM_Position, - XFA_ATTRIBUTEENUM_MiddleCenter, - XFA_ATTRIBUTEENUM_Optional, - XFA_ATTRIBUTEENUM_UsePrinterSetting, - XFA_ATTRIBUTEENUM_Outline, - XFA_ATTRIBUTEENUM_IndexChange, - XFA_ATTRIBUTEENUM_Change, - XFA_ATTRIBUTEENUM_PageArea, - XFA_ATTRIBUTEENUM_Once, - XFA_ATTRIBUTEENUM_Only, - XFA_ATTRIBUTEENUM_Open, - XFA_ATTRIBUTEENUM_Caption, - XFA_ATTRIBUTEENUM_Raised, - XFA_ATTRIBUTEENUM_Justify, - XFA_ATTRIBUTEENUM_RefAndDescendants, - XFA_ATTRIBUTEENUM_Short, - XFA_ATTRIBUTEENUM_PageFront, - XFA_ATTRIBUTEENUM_Monospace, - XFA_ATTRIBUTEENUM_Middle, - XFA_ATTRIBUTEENUM_PrePrint, - XFA_ATTRIBUTEENUM_Always, - XFA_ATTRIBUTEENUM_Unknown, - XFA_ATTRIBUTEENUM_ToLeft, - XFA_ATTRIBUTEENUM_Above, - XFA_ATTRIBUTEENUM_DashDot, - XFA_ATTRIBUTEENUM_Gregorian, - XFA_ATTRIBUTEENUM_Roman, - XFA_ATTRIBUTEENUM_MouseDown, - XFA_ATTRIBUTEENUM_Symbol, - XFA_ATTRIBUTEENUM_PageEven, - XFA_ATTRIBUTEENUM_Sign, - XFA_ATTRIBUTEENUM_AddNew, - XFA_ATTRIBUTEENUM_Star, - XFA_ATTRIBUTEENUM_Optimistic, - XFA_ATTRIBUTEENUM_Rl_tb, - XFA_ATTRIBUTEENUM_MiddleRight, - XFA_ATTRIBUTEENUM_Maintain, - XFA_ATTRIBUTEENUM_Package, - XFA_ATTRIBUTEENUM_SimplifiedChinese, - XFA_ATTRIBUTEENUM_ToCenter, - XFA_ATTRIBUTEENUM_Back, - XFA_ATTRIBUTEENUM_Unspecified, - XFA_ATTRIBUTEENUM_BatchOptimistic, - XFA_ATTRIBUTEENUM_Bold, - XFA_ATTRIBUTEENUM_Both, - XFA_ATTRIBUTEENUM_Butt, - XFA_ATTRIBUTEENUM_Client, - XFA_ATTRIBUTEENUM_2mod10, - XFA_ATTRIBUTEENUM_ImageOnly, - XFA_ATTRIBUTEENUM_Horizontal, - XFA_ATTRIBUTEENUM_Dotted, - XFA_ATTRIBUTEENUM_UserControl, - XFA_ATTRIBUTEENUM_DiagonalRight, - XFA_ATTRIBUTEENUM_ConsumeData, - XFA_ATTRIBUTEENUM_Check, - XFA_ATTRIBUTEENUM_Data, - XFA_ATTRIBUTEENUM_Down, - XFA_ATTRIBUTEENUM_SansSerif, - XFA_ATTRIBUTEENUM_Inline, - XFA_ATTRIBUTEENUM_TraditionalChinese, - XFA_ATTRIBUTEENUM_Warn, - XFA_ATTRIBUTEENUM_RefOnly, - XFA_ATTRIBUTEENUM_InteractiveForms, - XFA_ATTRIBUTEENUM_Word, - XFA_ATTRIBUTEENUM_Unordered, - XFA_ATTRIBUTEENUM_Required, - XFA_ATTRIBUTEENUM_ImportOnly, - XFA_ATTRIBUTEENUM_BelowEmbedded, - XFA_ATTRIBUTEENUM_Japanese, - XFA_ATTRIBUTEENUM_Full, - XFA_ATTRIBUTEENUM_Rl_row, - XFA_ATTRIBUTEENUM_Vietnamese, - XFA_ATTRIBUTEENUM_EastEuropeanRoman, - XFA_ATTRIBUTEENUM_MouseUp, - XFA_ATTRIBUTEENUM_ExportOnly, - XFA_ATTRIBUTEENUM_Clear, - XFA_ATTRIBUTEENUM_Click, - XFA_ATTRIBUTEENUM_Base64, - XFA_ATTRIBUTEENUM_Close, - XFA_ATTRIBUTEENUM_Host, - XFA_ATTRIBUTEENUM_Global, - XFA_ATTRIBUTEENUM_Blank, - XFA_ATTRIBUTEENUM_Table, - XFA_ATTRIBUTEENUM_Import, - XFA_ATTRIBUTEENUM_Custom, - XFA_ATTRIBUTEENUM_MiddleLeft, - XFA_ATTRIBUTEENUM_PostExecute, - XFA_ATTRIBUTEENUM_Radix, - XFA_ATTRIBUTEENUM_PostOpen, - XFA_ATTRIBUTEENUM_Enter, - XFA_ATTRIBUTEENUM_Ignore, - XFA_ATTRIBUTEENUM_Lr_tb, - XFA_ATTRIBUTEENUM_Fantasy, - XFA_ATTRIBUTEENUM_Italic, - XFA_ATTRIBUTEENUM_Author, - XFA_ATTRIBUTEENUM_ToEdge, - XFA_ATTRIBUTEENUM_Choice, - XFA_ATTRIBUTEENUM_Disabled, - XFA_ATTRIBUTEENUM_CrossHatch, - XFA_ATTRIBUTEENUM_DataRef, - XFA_ATTRIBUTEENUM_DashDotDot, - XFA_ATTRIBUTEENUM_Square, - XFA_ATTRIBUTEENUM_Dynamic, - XFA_ATTRIBUTEENUM_Manual, - XFA_ATTRIBUTEENUM_Etched, - XFA_ATTRIBUTEENUM_ValidationState, - XFA_ATTRIBUTEENUM_Cursive, - XFA_ATTRIBUTEENUM_Last, - XFA_ATTRIBUTEENUM_Left, - XFA_ATTRIBUTEENUM_Link, - XFA_ATTRIBUTEENUM_Long, - XFA_ATTRIBUTEENUM_InternationalCarrier, - XFA_ATTRIBUTEENUM_PDF1_3, - XFA_ATTRIBUTEENUM_PDF1_6, - XFA_ATTRIBUTEENUM_Serif, - XFA_ATTRIBUTEENUM_PostSave, - XFA_ATTRIBUTEENUM_Ready, - XFA_ATTRIBUTEENUM_PostSign, - XFA_ATTRIBUTEENUM_Arabic, - XFA_ATTRIBUTEENUM_Error, - XFA_ATTRIBUTEENUM_Urlencoded, - XFA_ATTRIBUTEENUM_Lowered, +enum class XFA_AttributeEnum : uint32_t { + Asterisk, + Slash, + Backslash, + On, + Tb, + Up, + MetaData, + Delegate, + PostSubmit, + Name, + Cross, + Next, + None, + ShortEdge, + Checksum_1mod10_1mod11, + Height, + CrossDiagonal, + All, + Any, + ToRight, + MatchTemplate, + Dpl, + Invisible, + Fit, + Width, + PreSubmit, + Ipl, + FlateCompress, + Med, + Odd, + Off, + Pdf, + Row, + Top, + Xdp, + Xfd, + Xml, + Zip, + Zpl, + Visible, + Exclude, + MouseEnter, + Pair, + Filter, + MoveLast, + ExportAndImport, + Push, + Portrait, + Default, + StoredProc, + StayBOF, + StayEOF, + PostPrint, + UsCarrier, + Right, + PreOpen, + Actual, + Rest, + TopCenter, + StandardSymbol, + Initialize, + JustifyAll, + Normal, + Landscape, + NonInteractive, + MouseExit, + Minus, + DiagonalLeft, + SimplexPaginated, + Document, + Warning, + Auto, + Below, + BottomLeft, + BottomCenter, + Tcpl, + Text, + Grouping, + SecureSymbol, + PreExecute, + DocClose, + Keyset, + Vertical, + PreSave, + PreSign, + Bottom, + ToTop, + Verify, + First, + ContentArea, + Solid, + Pessimistic, + DuplexPaginated, + Round, + Remerge, + Ordered, + Percent, + Even, + Exit, + ToolTip, + OrderedOccurrence, + ReadOnly, + Currency, + Concat, + Thai, + Embossed, + Formdata, + Greek, + Decimal, + Select, + LongEdge, + Protected, + BottomRight, + Zero, + ForwardOnly, + DocReady, + Hidden, + Include, + Dashed, + MultiSelect, + Inactive, + Embed, + Static, + OnEntry, + Cyrillic, + NonBlank, + TopRight, + Hebrew, + TopLeft, + Center, + MoveFirst, + Diamond, + PageOdd, + Checksum_1mod10, + Korean, + AboveEmbedded, + ZipCompress, + Numeric, + Circle, + ToBottom, + Inverted, + Update, + Isoname, + Server, + Position, + MiddleCenter, + Optional, + UsePrinterSetting, + Outline, + IndexChange, + Change, + PageArea, + Once, + Only, + Open, + Caption, + Raised, + Justify, + RefAndDescendants, + Short, + PageFront, + Monospace, + Middle, + PrePrint, + Always, + Unknown, + ToLeft, + Above, + DashDot, + Gregorian, + Roman, + MouseDown, + Symbol, + PageEven, + Sign, + AddNew, + Star, + Optimistic, + Rl_tb, + MiddleRight, + Maintain, + Package, + SimplifiedChinese, + ToCenter, + Back, + Unspecified, + BatchOptimistic, + Bold, + Both, + Butt, + Client, + Checksum_2mod10, + ImageOnly, + Horizontal, + Dotted, + UserControl, + DiagonalRight, + ConsumeData, + Check, + Data, + Down, + SansSerif, + Inline, + TraditionalChinese, + Warn, + RefOnly, + InteractiveForms, + Word, + Unordered, + Required, + ImportOnly, + BelowEmbedded, + Japanese, + Full, + Rl_row, + Vietnamese, + EastEuropeanRoman, + MouseUp, + ExportOnly, + Clear, + Click, + Base64, + Close, + Host, + Global, + Blank, + Table, + Import, + Custom, + MiddleLeft, + PostExecute, + Radix, + PostOpen, + Enter, + Ignore, + Lr_tb, + Fantasy, + Italic, + Author, + ToEdge, + Choice, + Disabled, + CrossHatch, + DataRef, + DashDotDot, + Square, + Dynamic, + Manual, + Etched, + ValidationState, + Cursive, + Last, + Left, + Link, + Long, + InternationalCarrier, + PDF1_3, + PDF1_6, + Serif, + PostSave, + Ready, + PostSign, + Arabic, + Error, + Urlencoded, + Lowered }; enum class XFA_Attribute : uint8_t { @@ -949,10 +949,10 @@ struct XFA_SCRIPTHIERARCHY { #define XFA_PROPERTYFLAG_OneOf 0x01 #define XFA_PROPERTYFLAG_DefaultOneOf 0x02 -struct XFA_ATTRIBUTEENUMINFO { +struct XFA_AttributeEnumInfo { uint32_t uHash; const wchar_t* pName; - XFA_ATTRIBUTEENUM eName; + XFA_AttributeEnum eName; }; enum class XFA_Unit : uint8_t { diff --git a/xfa/fxfa/parser/cxfa_appearancefilter.cpp b/xfa/fxfa/parser/cxfa_appearancefilter.cpp index eca2a92fff..9b3e9fb8d5 100644 --- a/xfa/fxfa/parser/cxfa_appearancefilter.cpp +++ b/xfa/fxfa/parser/cxfa_appearancefilter.cpp @@ -12,7 +12,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Optional}, + (void*)XFA_AttributeEnum::Optional}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_arc.cpp b/xfa/fxfa/parser/cxfa_arc.cpp index 2af650e630..26209543f3 100644 --- a/xfa/fxfa/parser/cxfa_arc.cpp +++ b/xfa/fxfa/parser/cxfa_arc.cpp @@ -19,7 +19,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Circular, XFA_AttributeType::Boolean, (void*)0}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Hand, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Even}, + (void*)XFA_AttributeEnum::Even}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"arc"; diff --git a/xfa/fxfa/parser/cxfa_barcode.cpp b/xfa/fxfa/parser/cxfa_barcode.cpp index 357270c94b..9ab4aef0fe 100644 --- a/xfa/fxfa/parser/cxfa_barcode.cpp +++ b/xfa/fxfa/parser/cxfa_barcode.cpp @@ -13,10 +13,10 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::DataRowCount, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::DataPrep, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_None}, + (void*)XFA_AttributeEnum::None}, {XFA_Attribute::Type, XFA_AttributeType::CData, (void*)nullptr}, {XFA_Attribute::TextLocation, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Below}, + (void*)XFA_AttributeEnum::Below}, {XFA_Attribute::ModuleWidth, XFA_AttributeType::Measure, (void*)L"0.25mm"}, {XFA_Attribute::PrintCheckDigit, XFA_AttributeType::Boolean, (void*)0}, {XFA_Attribute::ModuleHeight, XFA_AttributeType::Measure, (void*)L"5mm"}, @@ -25,9 +25,9 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::WideNarrowRatio, XFA_AttributeType::CData, (void*)L"3:1"}, {XFA_Attribute::ErrorCorrectionLevel, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::UpsMode, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_UsCarrier}, + (void*)XFA_AttributeEnum::UsCarrier}, {XFA_Attribute::Checksum, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_None}, + (void*)XFA_AttributeEnum::None}, {XFA_Attribute::CharEncoding, XFA_AttributeType::CData, (void*)L"UTF-8"}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::DataColumnCount, XFA_AttributeType::CData, nullptr}, diff --git a/xfa/fxfa/parser/cxfa_batchoutput.cpp b/xfa/fxfa/parser/cxfa_batchoutput.cpp index 64c2ccefcb..1678d6a36f 100644 --- a/xfa/fxfa/parser/cxfa_batchoutput.cpp +++ b/xfa/fxfa/parser/cxfa_batchoutput.cpp @@ -10,7 +10,7 @@ namespace { const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Format, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_None}, + (void*)XFA_AttributeEnum::None}, {XFA_Attribute::Desc, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Lock, XFA_AttributeType::Integer, (void*)0}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_bind.cpp b/xfa/fxfa/parser/cxfa_bind.cpp index e3f61dae7d..feef393a99 100644 --- a/xfa/fxfa/parser/cxfa_bind.cpp +++ b/xfa/fxfa/parser/cxfa_bind.cpp @@ -17,10 +17,10 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::ContentType, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::TransferEncoding, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_None}, + (void*)XFA_AttributeEnum::None}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Match, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Once}, + (void*)XFA_AttributeEnum::Once}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"bind"; diff --git a/xfa/fxfa/parser/cxfa_border.cpp b/xfa/fxfa/parser/cxfa_border.cpp index fe58a93ec8..9a58366134 100644 --- a/xfa/fxfa/parser/cxfa_border.cpp +++ b/xfa/fxfa/parser/cxfa_border.cpp @@ -15,14 +15,14 @@ const CXFA_Node::PropertyData kPropertyData[] = { const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Break, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Close}, + (void*)XFA_AttributeEnum::Close}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Presence, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Visible}, + (void*)XFA_AttributeEnum::Visible}, {XFA_Attribute::Relevant, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Hand, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Even}, + (void*)XFA_AttributeEnum::Even}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"border"; diff --git a/xfa/fxfa/parser/cxfa_boxdata.cpp b/xfa/fxfa/parser/cxfa_boxdata.cpp index 6428247154..b8a82c2b80 100644 --- a/xfa/fxfa/parser/cxfa_boxdata.cpp +++ b/xfa/fxfa/parser/cxfa_boxdata.cpp @@ -46,10 +46,10 @@ std::vector<CXFA_StrokeData> GetStrokesInternal(CXFA_Node* pNode, bool bNull) { return strokes; } -static int32_t Style3D(const std::vector<CXFA_StrokeData>& strokes, - CXFA_StrokeData& strokeData) { +static XFA_AttributeEnum Style3D(const std::vector<CXFA_StrokeData>& strokes, + CXFA_StrokeData& strokeData) { if (strokes.empty()) - return 0; + return XFA_AttributeEnum::Unknown; strokeData = strokes[0]; for (size_t i = 1; i < strokes.size(); i++) { @@ -64,29 +64,30 @@ static int32_t Style3D(const std::vector<CXFA_StrokeData>& strokes, break; } - XFA_ATTRIBUTEENUM iType = strokeData.GetStrokeType(); - if (iType == XFA_ATTRIBUTEENUM_Lowered || iType == XFA_ATTRIBUTEENUM_Raised || - iType == XFA_ATTRIBUTEENUM_Etched || - iType == XFA_ATTRIBUTEENUM_Embossed) { + XFA_AttributeEnum iType = strokeData.GetStrokeType(); + if (iType == XFA_AttributeEnum::Lowered || + iType == XFA_AttributeEnum::Raised || + iType == XFA_AttributeEnum::Etched || + iType == XFA_AttributeEnum::Embossed) { return iType; } - return 0; + return XFA_AttributeEnum::Unknown; } } // namespace -int32_t CXFA_BoxData::GetHand() const { +XFA_AttributeEnum CXFA_BoxData::GetHand() const { if (!m_pNode) - return XFA_ATTRIBUTEENUM_Even; + return XFA_AttributeEnum::Even; return m_pNode->JSNode()->GetEnum(XFA_Attribute::Hand); } -int32_t CXFA_BoxData::GetPresence() const { +XFA_AttributeEnum CXFA_BoxData::GetPresence() const { if (!m_pNode) - return XFA_ATTRIBUTEENUM_Hidden; + return XFA_AttributeEnum::Hidden; return m_pNode->JSNode() ->TryEnum(XFA_Attribute::Presence, true) - .value_or(XFA_ATTRIBUTEENUM_Visible); + .value_or(XFA_AttributeEnum::Visible); } int32_t CXFA_BoxData::CountEdges() const { @@ -137,15 +138,15 @@ CXFA_MarginData CXFA_BoxData::GetMarginData() const { m_pNode ? m_pNode->GetChild(0, XFA_Element::Margin, false) : nullptr); } -std::tuple<int32_t, bool, float> CXFA_BoxData::Get3DStyle() const { +std::tuple<XFA_AttributeEnum, bool, float> CXFA_BoxData::Get3DStyle() const { if (IsArc()) - return {0, false, 0.0f}; + return {XFA_AttributeEnum::Unknown, false, 0.0f}; std::vector<CXFA_StrokeData> strokes = GetStrokesInternal(m_pNode, true); CXFA_StrokeData strokeData(nullptr); - int32_t iType = Style3D(strokes, strokeData); - if (iType == 0) - return {0, false, 0.0f}; + XFA_AttributeEnum iType = Style3D(strokes, strokeData); + if (iType == XFA_AttributeEnum::Unknown) + return {XFA_AttributeEnum::Unknown, false, 0.0f}; return {iType, strokeData.IsVisible(), strokeData.GetThickness()}; } diff --git a/xfa/fxfa/parser/cxfa_boxdata.h b/xfa/fxfa/parser/cxfa_boxdata.h index 7fd6869f2f..38a7faa38c 100644 --- a/xfa/fxfa/parser/cxfa_boxdata.h +++ b/xfa/fxfa/parser/cxfa_boxdata.h @@ -25,9 +25,9 @@ class CXFA_BoxData : public CXFA_DataData { bool IsArc() const { return GetElementType() == XFA_Element::Arc; } bool IsCircular() const; - int32_t GetHand() const; - int32_t GetPresence() const; - std::tuple<int32_t, bool, float> Get3DStyle() const; + XFA_AttributeEnum GetHand() const; + XFA_AttributeEnum GetPresence() const; + std::tuple<XFA_AttributeEnum, bool, float> Get3DStyle() const; int32_t CountEdges() const; CXFA_EdgeData GetEdgeData(int32_t nIndex) const; diff --git a/xfa/fxfa/parser/cxfa_break.cpp b/xfa/fxfa/parser/cxfa_break.cpp index 7d820f9c8a..fcce81c89c 100644 --- a/xfa/fxfa/parser/cxfa_break.cpp +++ b/xfa/fxfa/parser/cxfa_break.cpp @@ -20,12 +20,12 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::StartNew, XFA_AttributeType::Boolean, (void*)0}, {XFA_Attribute::BookendTrailer, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::After, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Auto}, + (void*)XFA_AttributeEnum::Auto}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::BookendLeader, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::AfterTarget, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Before, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Auto}, + (void*)XFA_AttributeEnum::Auto}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"break"; diff --git a/xfa/fxfa/parser/cxfa_breakafter.cpp b/xfa/fxfa/parser/cxfa_breakafter.cpp index e80a5725ac..a85cf6dfd2 100644 --- a/xfa/fxfa/parser/cxfa_breakafter.cpp +++ b/xfa/fxfa/parser/cxfa_breakafter.cpp @@ -16,7 +16,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::StartNew, XFA_AttributeType::Boolean, (void*)0}, {XFA_Attribute::Trailer, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::TargetType, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Auto}, + (void*)XFA_AttributeEnum::Auto}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Target, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Leader, XFA_AttributeType::CData, nullptr}, diff --git a/xfa/fxfa/parser/cxfa_breakbefore.cpp b/xfa/fxfa/parser/cxfa_breakbefore.cpp index 94d9130b2c..7c28feb419 100644 --- a/xfa/fxfa/parser/cxfa_breakbefore.cpp +++ b/xfa/fxfa/parser/cxfa_breakbefore.cpp @@ -16,7 +16,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::StartNew, XFA_AttributeType::Boolean, (void*)0}, {XFA_Attribute::Trailer, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::TargetType, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Auto}, + (void*)XFA_AttributeEnum::Auto}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Target, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Leader, XFA_AttributeType::CData, nullptr}, diff --git a/xfa/fxfa/parser/cxfa_button.cpp b/xfa/fxfa/parser/cxfa_button.cpp index 245f00e205..9d589dc703 100644 --- a/xfa/fxfa/parser/cxfa_button.cpp +++ b/xfa/fxfa/parser/cxfa_button.cpp @@ -15,7 +15,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Highlight, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Inverted}, + (void*)XFA_AttributeEnum::Inverted}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"button"; diff --git a/xfa/fxfa/parser/cxfa_calculate.cpp b/xfa/fxfa/parser/cxfa_calculate.cpp index 44c060ff84..f894ebf71f 100644 --- a/xfa/fxfa/parser/cxfa_calculate.cpp +++ b/xfa/fxfa/parser/cxfa_calculate.cpp @@ -17,7 +17,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Override, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Error}, + (void*)XFA_AttributeEnum::Error}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"calculate"; diff --git a/xfa/fxfa/parser/cxfa_calculatedata.cpp b/xfa/fxfa/parser/cxfa_calculatedata.cpp index 5bf106cbf0..c5a2781308 100644 --- a/xfa/fxfa/parser/cxfa_calculatedata.cpp +++ b/xfa/fxfa/parser/cxfa_calculatedata.cpp @@ -12,10 +12,10 @@ CXFA_CalculateData::CXFA_CalculateData(CXFA_Node* pNode) : CXFA_DataData(pNode) {} -int32_t CXFA_CalculateData::GetOverride() const { +XFA_AttributeEnum CXFA_CalculateData::GetOverride() const { return m_pNode->JSNode() ->TryEnum(XFA_Attribute::Override, false) - .value_or(XFA_ATTRIBUTEENUM_Error); + .value_or(XFA_AttributeEnum::Error); } CXFA_ScriptData CXFA_CalculateData::GetScriptData() const { diff --git a/xfa/fxfa/parser/cxfa_calculatedata.h b/xfa/fxfa/parser/cxfa_calculatedata.h index 3158bd97cf..833b1508a4 100644 --- a/xfa/fxfa/parser/cxfa_calculatedata.h +++ b/xfa/fxfa/parser/cxfa_calculatedata.h @@ -17,7 +17,7 @@ class CXFA_CalculateData : public CXFA_DataData { public: explicit CXFA_CalculateData(CXFA_Node* pNode); - int32_t GetOverride() const; + XFA_AttributeEnum GetOverride() const; CXFA_ScriptData GetScriptData() const; WideString GetMessageText() const; }; diff --git a/xfa/fxfa/parser/cxfa_calendarsymbols.cpp b/xfa/fxfa/parser/cxfa_calendarsymbols.cpp index 810349fb23..c9ad3b5817 100644 --- a/xfa/fxfa/parser/cxfa_calendarsymbols.cpp +++ b/xfa/fxfa/parser/cxfa_calendarsymbols.cpp @@ -16,7 +16,7 @@ const CXFA_Node::PropertyData kPropertyData[] = { {XFA_Element::Unknown, 0, 0}}; const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Name, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Gregorian}, + (void*)XFA_AttributeEnum::Gregorian}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"calendarSymbols"; diff --git a/xfa/fxfa/parser/cxfa_caption.cpp b/xfa/fxfa/parser/cxfa_caption.cpp index cfd61c0b3b..3b405ff890 100644 --- a/xfa/fxfa/parser/cxfa_caption.cpp +++ b/xfa/fxfa/parser/cxfa_caption.cpp @@ -17,10 +17,10 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Reserve, XFA_AttributeType::Measure, (void*)L"-1un"}, {XFA_Attribute::Presence, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Visible}, + (void*)XFA_AttributeEnum::Visible}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Placement, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Left}, + (void*)XFA_AttributeEnum::Left}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"caption"; diff --git a/xfa/fxfa/parser/cxfa_captiondata.cpp b/xfa/fxfa/parser/cxfa_captiondata.cpp index 61bcbcefa1..af670f14dd 100644 --- a/xfa/fxfa/parser/cxfa_captiondata.cpp +++ b/xfa/fxfa/parser/cxfa_captiondata.cpp @@ -14,19 +14,20 @@ CXFA_CaptionData::CXFA_CaptionData(CXFA_Node* pNode) : CXFA_DataData(pNode) {} bool CXFA_CaptionData::IsVisible() const { return m_pNode->JSNode() ->TryEnum(XFA_Attribute::Presence, true) - .value_or(XFA_ATTRIBUTEENUM_Visible) == XFA_ATTRIBUTEENUM_Visible; + .value_or(XFA_AttributeEnum::Visible) == + XFA_AttributeEnum::Visible; } bool CXFA_CaptionData::IsHidden() const { return m_pNode->JSNode() ->TryEnum(XFA_Attribute::Presence, true) - .value_or(XFA_ATTRIBUTEENUM_Visible) == XFA_ATTRIBUTEENUM_Hidden; + .value_or(XFA_AttributeEnum::Visible) == XFA_AttributeEnum::Hidden; } -XFA_ATTRIBUTEENUM CXFA_CaptionData::GetPlacementType() const { +XFA_AttributeEnum CXFA_CaptionData::GetPlacementType() const { return m_pNode->JSNode() ->TryEnum(XFA_Attribute::Placement, true) - .value_or(XFA_ATTRIBUTEENUM_Left); + .value_or(XFA_AttributeEnum::Left); } float CXFA_CaptionData::GetReserve() const { diff --git a/xfa/fxfa/parser/cxfa_captiondata.h b/xfa/fxfa/parser/cxfa_captiondata.h index 1a0d61fb8e..fd8af7273b 100644 --- a/xfa/fxfa/parser/cxfa_captiondata.h +++ b/xfa/fxfa/parser/cxfa_captiondata.h @@ -20,7 +20,7 @@ class CXFA_CaptionData : public CXFA_DataData { bool IsVisible() const; bool IsHidden() const; - XFA_ATTRIBUTEENUM GetPlacementType() const; + XFA_AttributeEnum GetPlacementType() const; float GetReserve() const; CXFA_MarginData GetMarginData() const; CXFA_FontData GetFontData() const; diff --git a/xfa/fxfa/parser/cxfa_certificates.cpp b/xfa/fxfa/parser/cxfa_certificates.cpp index 3ad45374ef..29dd574a3f 100644 --- a/xfa/fxfa/parser/cxfa_certificates.cpp +++ b/xfa/fxfa/parser/cxfa_certificates.cpp @@ -17,7 +17,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Url, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::CredentialServerPolicy, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Optional}, + (void*)XFA_AttributeEnum::Optional}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::UrlPolicy, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_checkbutton.cpp b/xfa/fxfa/parser/cxfa_checkbutton.cpp index b9d0689c71..01adbdfc3a 100644 --- a/xfa/fxfa/parser/cxfa_checkbutton.cpp +++ b/xfa/fxfa/parser/cxfa_checkbutton.cpp @@ -17,9 +17,9 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::AllowNeutral, XFA_AttributeType::Boolean, (void*)0}, {XFA_Attribute::Mark, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Default}, + (void*)XFA_AttributeEnum::Default}, {XFA_Attribute::Shape, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Square}, + (void*)XFA_AttributeEnum::Square}, {XFA_Attribute::Size, XFA_AttributeType::Measure, (void*)L"10pt"}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_choicelist.cpp b/xfa/fxfa/parser/cxfa_choicelist.cpp index 89eb8fa32f..452e87d3e8 100644 --- a/xfa/fxfa/parser/cxfa_choicelist.cpp +++ b/xfa/fxfa/parser/cxfa_choicelist.cpp @@ -16,9 +16,9 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Open, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_UserControl}, + (void*)XFA_AttributeEnum::UserControl}, {XFA_Attribute::CommitOn, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Select}, + (void*)XFA_AttributeEnum::Select}, {XFA_Attribute::TextEntry, XFA_AttributeType::Boolean, (void*)0}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_compress.cpp b/xfa/fxfa/parser/cxfa_compress.cpp index 5658b2061e..72a3b9202c 100644 --- a/xfa/fxfa/parser/cxfa_compress.cpp +++ b/xfa/fxfa/parser/cxfa_compress.cpp @@ -11,7 +11,7 @@ namespace { const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Desc, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Scope, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_ImageOnly}, + (void*)XFA_AttributeEnum::ImageOnly}, {XFA_Attribute::Lock, XFA_AttributeType::Integer, (void*)0}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_connect.cpp b/xfa/fxfa/parser/cxfa_connect.cpp index 723be1e5f2..0def93d352 100644 --- a/xfa/fxfa/parser/cxfa_connect.cpp +++ b/xfa/fxfa/parser/cxfa_connect.cpp @@ -22,7 +22,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Timeout, XFA_AttributeType::Integer, (void*)15}, {XFA_Attribute::Connection, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Usage, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_ExportAndImport}, + (void*)XFA_AttributeEnum::ExportAndImport}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::DelayedOpen, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_containerlayoutitem.cpp b/xfa/fxfa/parser/cxfa_containerlayoutitem.cpp index fb54354eeb..07203caa85 100644 --- a/xfa/fxfa/parser/cxfa_containerlayoutitem.cpp +++ b/xfa/fxfa/parser/cxfa_containerlayoutitem.cpp @@ -35,7 +35,7 @@ CFX_SizeF CXFA_ContainerLayoutItem::GetPageSize() const { pMedium->JSNode()->GetMeasure(XFA_Attribute::Short).ToUnit(XFA_Unit::Pt), pMedium->JSNode()->GetMeasure(XFA_Attribute::Long).ToUnit(XFA_Unit::Pt)); if (pMedium->JSNode()->GetEnum(XFA_Attribute::Orientation) == - XFA_ATTRIBUTEENUM_Landscape) { + XFA_AttributeEnum::Landscape) { size = CFX_SizeF(size.height, size.width); } return size; diff --git a/xfa/fxfa/parser/cxfa_corner.cpp b/xfa/fxfa/parser/cxfa_corner.cpp index 7b8eecf1bb..951d58d00c 100644 --- a/xfa/fxfa/parser/cxfa_corner.cpp +++ b/xfa/fxfa/parser/cxfa_corner.cpp @@ -15,14 +15,14 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Stroke, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Solid}, + (void*)XFA_AttributeEnum::Solid}, {XFA_Attribute::Presence, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Visible}, + (void*)XFA_AttributeEnum::Visible}, {XFA_Attribute::Inverted, XFA_AttributeType::Boolean, (void*)0}, {XFA_Attribute::Thickness, XFA_AttributeType::Measure, (void*)L"0.5pt"}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Join, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Square}, + (void*)XFA_AttributeEnum::Square}, {XFA_Attribute::Radius, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_currencysymbol.cpp b/xfa/fxfa/parser/cxfa_currencysymbol.cpp index f40372029e..de11f27f34 100644 --- a/xfa/fxfa/parser/cxfa_currencysymbol.cpp +++ b/xfa/fxfa/parser/cxfa_currencysymbol.cpp @@ -10,7 +10,7 @@ namespace { const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Name, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Symbol}, + (void*)XFA_AttributeEnum::Symbol}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"currencySymbol"; diff --git a/xfa/fxfa/parser/cxfa_datavalue.cpp b/xfa/fxfa/parser/cxfa_datavalue.cpp index 5eb439bee2..b3d7599bd3 100644 --- a/xfa/fxfa/parser/cxfa_datavalue.cpp +++ b/xfa/fxfa/parser/cxfa_datavalue.cpp @@ -12,7 +12,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Name, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::ContentType, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Contains, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Data}, + (void*)XFA_AttributeEnum::Data}, {XFA_Attribute::Value, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::IsNull, XFA_AttributeType::Boolean, (void*)0}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_datepattern.cpp b/xfa/fxfa/parser/cxfa_datepattern.cpp index ff116b12ee..237874bf7c 100644 --- a/xfa/fxfa/parser/cxfa_datepattern.cpp +++ b/xfa/fxfa/parser/cxfa_datepattern.cpp @@ -10,7 +10,7 @@ namespace { const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Name, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Med}, + (void*)XFA_AttributeEnum::Med}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"datePattern"; diff --git a/xfa/fxfa/parser/cxfa_datetimeedit.cpp b/xfa/fxfa/parser/cxfa_datetimeedit.cpp index 8635f6377d..bec792d22e 100644 --- a/xfa/fxfa/parser/cxfa_datetimeedit.cpp +++ b/xfa/fxfa/parser/cxfa_datetimeedit.cpp @@ -18,9 +18,9 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Picker, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Host}, + (void*)XFA_AttributeEnum::Host}, {XFA_Attribute::HScrollPolicy, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Auto}, + (void*)XFA_AttributeEnum::Auto}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"dateTimeEdit"; diff --git a/xfa/fxfa/parser/cxfa_defaulttypeface.cpp b/xfa/fxfa/parser/cxfa_defaulttypeface.cpp index 31a93cc2cf..60da7867a7 100644 --- a/xfa/fxfa/parser/cxfa_defaulttypeface.cpp +++ b/xfa/fxfa/parser/cxfa_defaulttypeface.cpp @@ -11,7 +11,7 @@ namespace { const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Desc, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::WritingScript, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Asterisk}, + (void*)XFA_AttributeEnum::Asterisk}, {XFA_Attribute::Lock, XFA_AttributeType::Integer, (void*)0}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_digestmethods.cpp b/xfa/fxfa/parser/cxfa_digestmethods.cpp index 0608d123af..52a8da5c72 100644 --- a/xfa/fxfa/parser/cxfa_digestmethods.cpp +++ b/xfa/fxfa/parser/cxfa_digestmethods.cpp @@ -12,7 +12,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Optional}, + (void*)XFA_AttributeEnum::Optional}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_draw.cpp b/xfa/fxfa/parser/cxfa_draw.cpp index 073d3154e4..5d4c29cf9b 100644 --- a/xfa/fxfa/parser/cxfa_draw.cpp +++ b/xfa/fxfa/parser/cxfa_draw.cpp @@ -23,14 +23,14 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Y, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::HAlign, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Left}, + (void*)XFA_AttributeEnum::Left}, {XFA_Attribute::Name, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Rotate, XFA_AttributeType::Integer, (void*)0}, {XFA_Attribute::Presence, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Visible}, + (void*)XFA_AttributeEnum::Visible}, {XFA_Attribute::VAlign, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Top}, + (void*)XFA_AttributeEnum::Top}, {XFA_Attribute::MaxH, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::MaxW, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::MinH, XFA_AttributeType::Measure, (void*)L"0in"}, @@ -40,7 +40,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Locale, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::AnchorType, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_TopLeft}, + (void*)XFA_AttributeEnum::TopLeft}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"draw"; diff --git a/xfa/fxfa/parser/cxfa_edge.cpp b/xfa/fxfa/parser/cxfa_edge.cpp index 310a7e27b0..d9763101d3 100644 --- a/xfa/fxfa/parser/cxfa_edge.cpp +++ b/xfa/fxfa/parser/cxfa_edge.cpp @@ -14,12 +14,12 @@ const CXFA_Node::PropertyData kPropertyData[] = {{XFA_Element::Color, 1, 0}, const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Cap, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Square}, + (void*)XFA_AttributeEnum::Square}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Stroke, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Solid}, + (void*)XFA_AttributeEnum::Solid}, {XFA_Attribute::Presence, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Visible}, + (void*)XFA_AttributeEnum::Visible}, {XFA_Attribute::Thickness, XFA_AttributeType::Measure, (void*)L"0.5pt"}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_encodings.cpp b/xfa/fxfa/parser/cxfa_encodings.cpp index dddcf1b74d..d6b1fb7cd8 100644 --- a/xfa/fxfa/parser/cxfa_encodings.cpp +++ b/xfa/fxfa/parser/cxfa_encodings.cpp @@ -12,7 +12,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Optional}, + (void*)XFA_AttributeEnum::Optional}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_encryptionmethods.cpp b/xfa/fxfa/parser/cxfa_encryptionmethods.cpp index c8913d1159..e4120314bf 100644 --- a/xfa/fxfa/parser/cxfa_encryptionmethods.cpp +++ b/xfa/fxfa/parser/cxfa_encryptionmethods.cpp @@ -12,7 +12,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Optional}, + (void*)XFA_AttributeEnum::Optional}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_event.cpp b/xfa/fxfa/parser/cxfa_event.cpp index ca5aa58a2b..940be135a0 100644 --- a/xfa/fxfa/parser/cxfa_event.cpp +++ b/xfa/fxfa/parser/cxfa_event.cpp @@ -21,10 +21,10 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Ref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Listen, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_RefOnly}, + (void*)XFA_AttributeEnum::RefOnly}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Activity, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Click}, + (void*)XFA_AttributeEnum::Click}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"event"; diff --git a/xfa/fxfa/parser/cxfa_eventdata.cpp b/xfa/fxfa/parser/cxfa_eventdata.cpp index 3c9720d1fd..1af838974b 100644 --- a/xfa/fxfa/parser/cxfa_eventdata.cpp +++ b/xfa/fxfa/parser/cxfa_eventdata.cpp @@ -10,7 +10,7 @@ CXFA_EventData::CXFA_EventData(CXFA_Node* pNode) : CXFA_DataData(pNode) {} -XFA_ATTRIBUTEENUM CXFA_EventData::GetActivity() { +XFA_AttributeEnum CXFA_EventData::GetActivity() { return m_pNode->JSNode()->GetEnum(XFA_Attribute::Activity); } diff --git a/xfa/fxfa/parser/cxfa_eventdata.h b/xfa/fxfa/parser/cxfa_eventdata.h index 89ed63e269..4e386430dc 100644 --- a/xfa/fxfa/parser/cxfa_eventdata.h +++ b/xfa/fxfa/parser/cxfa_eventdata.h @@ -20,7 +20,7 @@ class CXFA_EventData : public CXFA_DataData { public: explicit CXFA_EventData(CXFA_Node* pNode); - XFA_ATTRIBUTEENUM GetActivity(); + XFA_AttributeEnum GetActivity(); XFA_Element GetEventType() const; CXFA_ScriptData GetScriptData() const; CXFA_SubmitData GetSubmitData() const; diff --git a/xfa/fxfa/parser/cxfa_exclgroup.cpp b/xfa/fxfa/parser/cxfa_exclgroup.cpp index 39ecc72630..745a971121 100644 --- a/xfa/fxfa/parser/cxfa_exclgroup.cpp +++ b/xfa/fxfa/parser/cxfa_exclgroup.cpp @@ -22,26 +22,26 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Y, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::HAlign, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Left}, + (void*)XFA_AttributeEnum::Left}, {XFA_Attribute::Name, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Access, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Open}, + (void*)XFA_AttributeEnum::Open}, {XFA_Attribute::Presence, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Visible}, + (void*)XFA_AttributeEnum::Visible}, {XFA_Attribute::VAlign, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Top}, + (void*)XFA_AttributeEnum::Top}, {XFA_Attribute::MaxH, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::MaxW, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::MinH, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::MinW, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::Layout, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Position}, + (void*)XFA_AttributeEnum::Position}, {XFA_Attribute::Relevant, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::ColSpan, XFA_AttributeType::Integer, (void*)1}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::AnchorType, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_TopLeft}, + (void*)XFA_AttributeEnum::TopLeft}, {XFA_Attribute::AccessKey, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_exdata.cpp b/xfa/fxfa/parser/cxfa_exdata.cpp index 0a73d78df3..f189480447 100644 --- a/xfa/fxfa/parser/cxfa_exdata.cpp +++ b/xfa/fxfa/parser/cxfa_exdata.cpp @@ -15,7 +15,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::ContentType, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::TransferEncoding, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_None}, + (void*)XFA_AttributeEnum::None}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::MaxLength, XFA_AttributeType::Integer, (void*)-1}, {XFA_Attribute::Href, XFA_AttributeType::CData, nullptr}, diff --git a/xfa/fxfa/parser/cxfa_execute.cpp b/xfa/fxfa/parser/cxfa_execute.cpp index f0a979668b..a2af26b333 100644 --- a/xfa/fxfa/parser/cxfa_execute.cpp +++ b/xfa/fxfa/parser/cxfa_execute.cpp @@ -13,9 +13,9 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Connection, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::RunAt, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Client}, + (void*)XFA_AttributeEnum::Client}, {XFA_Attribute::ExecuteType, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Import}, + (void*)XFA_AttributeEnum::Import}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_field.cpp b/xfa/fxfa/parser/cxfa_field.cpp index 5fd07d654e..2b1ef0441e 100644 --- a/xfa/fxfa/parser/cxfa_field.cpp +++ b/xfa/fxfa/parser/cxfa_field.cpp @@ -25,16 +25,16 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Y, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::HAlign, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Left}, + (void*)XFA_AttributeEnum::Left}, {XFA_Attribute::Name, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Access, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Open}, + (void*)XFA_AttributeEnum::Open}, {XFA_Attribute::Rotate, XFA_AttributeType::Integer, (void*)0}, {XFA_Attribute::Presence, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Visible}, + (void*)XFA_AttributeEnum::Visible}, {XFA_Attribute::VAlign, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Top}, + (void*)XFA_AttributeEnum::Top}, {XFA_Attribute::MaxH, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::MaxW, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::MinH, XFA_AttributeType::Measure, (void*)L"0in"}, @@ -44,7 +44,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Locale, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::AnchorType, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_TopLeft}, + (void*)XFA_AttributeEnum::TopLeft}, {XFA_Attribute::AccessKey, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_fill.cpp b/xfa/fxfa/parser/cxfa_fill.cpp index 340d94cfa2..d5020033b7 100644 --- a/xfa/fxfa/parser/cxfa_fill.cpp +++ b/xfa/fxfa/parser/cxfa_fill.cpp @@ -22,7 +22,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Presence, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Visible}, + (void*)XFA_AttributeEnum::Visible}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_filldata.cpp b/xfa/fxfa/parser/cxfa_filldata.cpp index dce743e72d..b4ca99735f 100644 --- a/xfa/fxfa/parser/cxfa_filldata.cpp +++ b/xfa/fxfa/parser/cxfa_filldata.cpp @@ -15,7 +15,8 @@ CXFA_FillData::~CXFA_FillData() {} bool CXFA_FillData::IsVisible() const { return m_pNode->JSNode() ->TryEnum(XFA_Attribute::Presence, true) - .value_or(XFA_ATTRIBUTEENUM_Visible) == XFA_ATTRIBUTEENUM_Visible; + .value_or(XFA_AttributeEnum::Visible) == + XFA_AttributeEnum::Visible; } void CXFA_FillData::SetColor(FX_ARGB color) { @@ -55,7 +56,7 @@ XFA_Element CXFA_FillData::GetFillType() const { return XFA_Element::Solid; } -XFA_ATTRIBUTEENUM CXFA_FillData::GetPatternType() const { +XFA_AttributeEnum CXFA_FillData::GetPatternType() const { return GetPattern()->JSNode()->GetEnum(XFA_Attribute::Type); } @@ -88,11 +89,11 @@ FX_ARGB CXFA_FillData::GetStippleColor() const { return 0xFF000000; } -XFA_ATTRIBUTEENUM CXFA_FillData::GetLinearType() const { +XFA_AttributeEnum CXFA_FillData::GetLinearType() const { return GetLinear() ->JSNode() ->TryEnum(XFA_Attribute::Type, true) - .value_or(XFA_ATTRIBUTEENUM_ToRight); + .value_or(XFA_AttributeEnum::ToRight); } FX_ARGB CXFA_FillData::GetLinearColor() const { @@ -109,7 +110,7 @@ bool CXFA_FillData::IsRadialToEdge() const { return GetRadial() ->JSNode() ->TryEnum(XFA_Attribute::Type, true) - .value_or(XFA_ATTRIBUTEENUM_ToEdge) == XFA_ATTRIBUTEENUM_ToEdge; + .value_or(XFA_AttributeEnum::ToEdge) == XFA_AttributeEnum::ToEdge; } FX_ARGB CXFA_FillData::GetRadialColor() const { diff --git a/xfa/fxfa/parser/cxfa_filldata.h b/xfa/fxfa/parser/cxfa_filldata.h index 6890952c25..8331123404 100644 --- a/xfa/fxfa/parser/cxfa_filldata.h +++ b/xfa/fxfa/parser/cxfa_filldata.h @@ -25,10 +25,10 @@ class CXFA_FillData : public CXFA_DataData { XFA_Element GetFillType() const; - XFA_ATTRIBUTEENUM GetPatternType() const; + XFA_AttributeEnum GetPatternType() const; FX_ARGB GetPatternColor() const; - XFA_ATTRIBUTEENUM GetLinearType() const; + XFA_AttributeEnum GetLinearType() const; FX_ARGB GetLinearColor() const; int32_t GetStippleRate() const; diff --git a/xfa/fxfa/parser/cxfa_font.cpp b/xfa/fxfa/parser/cxfa_font.cpp index c81e951229..df2c32797d 100644 --- a/xfa/fxfa/parser/cxfa_font.cpp +++ b/xfa/fxfa/parser/cxfa_font.cpp @@ -19,28 +19,28 @@ const CXFA_Node::AttributeData kAttributeData[] = { (void*)L"100%"}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::KerningMode, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_None}, + (void*)XFA_AttributeEnum::None}, {XFA_Attribute::Underline, XFA_AttributeType::Integer, (void*)0}, {XFA_Attribute::BaselineShift, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::OverlinePeriod, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_All}, + (void*)XFA_AttributeEnum::All}, {XFA_Attribute::LetterSpacing, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::LineThroughPeriod, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_All}, + (void*)XFA_AttributeEnum::All}, {XFA_Attribute::FontVerticalScale, XFA_AttributeType::CData, (void*)L"100%"}, {XFA_Attribute::PsName, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Size, XFA_AttributeType::Measure, (void*)L"10pt"}, {XFA_Attribute::Posture, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Normal}, + (void*)XFA_AttributeEnum::Normal}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Weight, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Normal}, + (void*)XFA_AttributeEnum::Normal}, {XFA_Attribute::UnderlinePeriod, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_All}, + (void*)XFA_AttributeEnum::All}, {XFA_Attribute::Overline, XFA_AttributeType::Integer, (void*)0}, {XFA_Attribute::GenericFamily, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Serif}, + (void*)XFA_AttributeEnum::Serif}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"font"; diff --git a/xfa/fxfa/parser/cxfa_fontdata.cpp b/xfa/fxfa/parser/cxfa_fontdata.cpp index 20fe68face..7eda807c1c 100644 --- a/xfa/fxfa/parser/cxfa_fontdata.cpp +++ b/xfa/fxfa/parser/cxfa_fontdata.cpp @@ -50,10 +50,10 @@ int32_t CXFA_FontData::GetUnderline() const { return m_pNode->JSNode()->GetInteger(XFA_Attribute::Underline); } -int32_t CXFA_FontData::GetUnderlinePeriod() const { +XFA_AttributeEnum CXFA_FontData::GetUnderlinePeriod() const { return m_pNode->JSNode() ->TryEnum(XFA_Attribute::UnderlinePeriod, true) - .value_or(XFA_ATTRIBUTEENUM_All); + .value_or(XFA_AttributeEnum::All); } float CXFA_FontData::GetFontSize() const { @@ -68,12 +68,12 @@ WideString CXFA_FontData::GetTypeface() const { bool CXFA_FontData::IsBold() const { return m_pNode->JSNode()->GetEnum(XFA_Attribute::Weight) == - XFA_ATTRIBUTEENUM_Bold; + XFA_AttributeEnum::Bold; } bool CXFA_FontData::IsItalic() const { return m_pNode->JSNode()->GetEnum(XFA_Attribute::Posture) == - XFA_ATTRIBUTEENUM_Italic; + XFA_AttributeEnum::Italic; } void CXFA_FontData::SetColor(FX_ARGB color) { diff --git a/xfa/fxfa/parser/cxfa_fontdata.h b/xfa/fxfa/parser/cxfa_fontdata.h index 906337a88b..45fbba6592 100644 --- a/xfa/fxfa/parser/cxfa_fontdata.h +++ b/xfa/fxfa/parser/cxfa_fontdata.h @@ -22,7 +22,7 @@ class CXFA_FontData : public CXFA_DataData { float GetLetterSpacing() const; int32_t GetLineThrough() const; int32_t GetUnderline() const; - int32_t GetUnderlinePeriod() const; + XFA_AttributeEnum GetUnderlinePeriod() const; float GetFontSize() const; WideString GetTypeface() const; diff --git a/xfa/fxfa/parser/cxfa_handler.cpp b/xfa/fxfa/parser/cxfa_handler.cpp index 405fcd5969..70f40ae6d9 100644 --- a/xfa/fxfa/parser/cxfa_handler.cpp +++ b/xfa/fxfa/parser/cxfa_handler.cpp @@ -12,7 +12,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Optional}, + (void*)XFA_AttributeEnum::Optional}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_image.cpp b/xfa/fxfa/parser/cxfa_image.cpp index 0bc82a6806..9f7988c4c5 100644 --- a/xfa/fxfa/parser/cxfa_image.cpp +++ b/xfa/fxfa/parser/cxfa_image.cpp @@ -14,10 +14,10 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::ContentType, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::TransferEncoding, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Base64}, + (void*)XFA_AttributeEnum::Base64}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Aspect, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Fit}, + (void*)XFA_AttributeEnum::Fit}, {XFA_Attribute::Href, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_imagedata.cpp b/xfa/fxfa/parser/cxfa_imagedata.cpp index dcf5563ad5..ebd4a8adf5 100644 --- a/xfa/fxfa/parser/cxfa_imagedata.cpp +++ b/xfa/fxfa/parser/cxfa_imagedata.cpp @@ -10,7 +10,7 @@ CXFA_ImageData::CXFA_ImageData(CXFA_Node* pNode) : CXFA_DataData(pNode) {} -XFA_ATTRIBUTEENUM CXFA_ImageData::GetAspect() const { +XFA_AttributeEnum CXFA_ImageData::GetAspect() const { return m_pNode->JSNode()->GetEnum(XFA_Attribute::Aspect); } @@ -24,8 +24,8 @@ WideString CXFA_ImageData::GetHref() const { return m_pNode->JSNode()->TryCData(XFA_Attribute::Href, true).value_or(L""); } -XFA_ATTRIBUTEENUM CXFA_ImageData::GetTransferEncoding() const { - return static_cast<XFA_ATTRIBUTEENUM>( +XFA_AttributeEnum CXFA_ImageData::GetTransferEncoding() const { + return static_cast<XFA_AttributeEnum>( m_pNode->JSNode()->GetEnum(XFA_Attribute::TransferEncoding)); } @@ -42,7 +42,7 @@ void CXFA_ImageData::SetHref(const WideString& wsHref) { m_pNode->JSNode()->SetCData(XFA_Attribute::Href, wsHref, false, false); } -void CXFA_ImageData::SetTransferEncoding(XFA_ATTRIBUTEENUM iTransferEncoding) { +void CXFA_ImageData::SetTransferEncoding(XFA_AttributeEnum iTransferEncoding) { m_pNode->JSNode()->SetEnum(XFA_Attribute::TransferEncoding, iTransferEncoding, false); } diff --git a/xfa/fxfa/parser/cxfa_imagedata.h b/xfa/fxfa/parser/cxfa_imagedata.h index 445d3d4fba..9030918541 100644 --- a/xfa/fxfa/parser/cxfa_imagedata.h +++ b/xfa/fxfa/parser/cxfa_imagedata.h @@ -17,14 +17,14 @@ class CXFA_ImageData : public CXFA_DataData { public: explicit CXFA_ImageData(CXFA_Node* pNode); - XFA_ATTRIBUTEENUM GetAspect() const; + XFA_AttributeEnum GetAspect() const; WideString GetContent() const; WideString GetHref() const; void SetHref(const WideString& wsHref); - XFA_ATTRIBUTEENUM GetTransferEncoding() const; - void SetTransferEncoding(XFA_ATTRIBUTEENUM iTransferEncoding); + XFA_AttributeEnum GetTransferEncoding() const; + void SetTransferEncoding(XFA_AttributeEnum iTransferEncoding); WideString GetContentType() const; void SetContentType(const WideString& wsContentType); diff --git a/xfa/fxfa/parser/cxfa_imageedit.cpp b/xfa/fxfa/parser/cxfa_imageedit.cpp index 937f3dc778..dd640b7a70 100644 --- a/xfa/fxfa/parser/cxfa_imageedit.cpp +++ b/xfa/fxfa/parser/cxfa_imageedit.cpp @@ -17,7 +17,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Data, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Link}, + (void*)XFA_AttributeEnum::Link}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"imageEdit"; diff --git a/xfa/fxfa/parser/cxfa_issuers.cpp b/xfa/fxfa/parser/cxfa_issuers.cpp index b6909d4be8..33de02a786 100644 --- a/xfa/fxfa/parser/cxfa_issuers.cpp +++ b/xfa/fxfa/parser/cxfa_issuers.cpp @@ -12,7 +12,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Optional}, + (void*)XFA_AttributeEnum::Optional}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp index d6ed0ccf0c..cb52c9de08 100644 --- a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp +++ b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp @@ -165,7 +165,7 @@ CFX_SizeF CalculateContainerComponentSizeFromContentSize( void RelocateTableRowCells(CXFA_ContentLayoutItem* pLayoutRow, const std::vector<float>& rgSpecifiedColumnWidths, - XFA_ATTRIBUTEENUM eLayout) { + XFA_AttributeEnum eLayout) { bool bContainerWidthAutoSize = true; bool bContainerHeightAutoSize = true; CFX_SizeF containerSize = CalculateContainerSpecifiedSize( @@ -257,15 +257,15 @@ void RelocateTableRowCells(CXFA_ContentLayoutItem* pLayoutRow, pLayoutChild->m_pFormNode->GetFirstChildByClass(XFA_Element::Para); if (pParaNode && pLayoutChild->m_pFirstChild) { float fOffHeight = fContentCalculatedHeight - fOldChildHeight; - XFA_ATTRIBUTEENUM eVType = + XFA_AttributeEnum eVType = pParaNode->JSNode()->GetEnum(XFA_Attribute::VAlign); switch (eVType) { - case XFA_ATTRIBUTEENUM_Middle: + case XFA_AttributeEnum::Middle: fOffHeight = fOffHeight / 2; break; - case XFA_ATTRIBUTEENUM_Bottom: + case XFA_AttributeEnum::Bottom: break; - case XFA_ATTRIBUTEENUM_Top: + case XFA_AttributeEnum::Top: default: fOffHeight = 0; break; @@ -296,7 +296,7 @@ void RelocateTableRowCells(CXFA_ContentLayoutItem* pLayoutRow, } if (pLayoutRow->m_pFormNode->JSNode()->GetEnum(XFA_Attribute::Layout) == - XFA_ATTRIBUTEENUM_Rl_row) { + XFA_AttributeEnum::Rl_row) { for (CXFA_ContentLayoutItem* pLayoutChild = (CXFA_ContentLayoutItem*)pLayoutRow->m_pFirstChild; pLayoutChild; @@ -313,11 +313,11 @@ void RelocateTableRowCells(CXFA_ContentLayoutItem* pLayoutRow, void UpdatePendingItemLayout(CXFA_ItemLayoutProcessor* pProcessor, CXFA_ContentLayoutItem* pLayoutItem) { - XFA_ATTRIBUTEENUM eLayout = + XFA_AttributeEnum eLayout = pLayoutItem->m_pFormNode->JSNode()->GetEnum(XFA_Attribute::Layout); switch (eLayout) { - case XFA_ATTRIBUTEENUM_Row: - case XFA_ATTRIBUTEENUM_Rl_row: + case XFA_AttributeEnum::Row: + case XFA_AttributeEnum::Rl_row: RelocateTableRowCells(pLayoutItem, pProcessor->m_rgSpecifiedColumnWidths, eLayout); break; @@ -387,18 +387,18 @@ void AddTrailerBeforeSplit(CXFA_ItemLayoutProcessor* pProcessor, switch (pTrailerLayoutItem->m_pFormNode->JSNode()->GetEnum( XFA_Attribute::HAlign)) { - case XFA_ATTRIBUTEENUM_Right: + case XFA_AttributeEnum::Right: pTrailerLayoutItem->m_sPos.x = pProcessor->m_pLayoutItem->m_sSize.width - fRightInset - pTrailerLayoutItem->m_sSize.width; break; - case XFA_ATTRIBUTEENUM_Center: + case XFA_AttributeEnum::Center: pTrailerLayoutItem->m_sPos.x = (pProcessor->m_pLayoutItem->m_sSize.width - fLeftInset - fRightInset - pTrailerLayoutItem->m_sSize.width) / 2; break; - case XFA_ATTRIBUTEENUM_Left: + case XFA_AttributeEnum::Left: default: pTrailerLayoutItem->m_sPos.x = fLeftInset; break; @@ -435,18 +435,18 @@ void AddLeaderAfterSplit(CXFA_ItemLayoutProcessor* pProcessor, switch (pLeaderLayoutItem->m_pFormNode->JSNode()->GetEnum( XFA_Attribute::HAlign)) { - case XFA_ATTRIBUTEENUM_Right: + case XFA_AttributeEnum::Right: pLeaderLayoutItem->m_sPos.x = pProcessor->m_pLayoutItem->m_sSize.width - fRightInset - pLeaderLayoutItem->m_sSize.width; break; - case XFA_ATTRIBUTEENUM_Center: + case XFA_AttributeEnum::Center: pLeaderLayoutItem->m_sPos.x = (pProcessor->m_pLayoutItem->m_sSize.width - fLeftInset - fRightInset - pLeaderLayoutItem->m_sSize.width) / 2; break; - case XFA_ATTRIBUTEENUM_Left: + case XFA_AttributeEnum::Left: default: pLeaderLayoutItem->m_sPos.x = fLeftInset; break; @@ -492,9 +492,9 @@ float InsertPendingItems(CXFA_ItemLayoutProcessor* pProcessor, return fTotalHeight; } -XFA_ATTRIBUTEENUM GetLayout(CXFA_Node* pFormNode, bool* bRootForceTb) { +XFA_AttributeEnum GetLayout(CXFA_Node* pFormNode, bool* bRootForceTb) { *bRootForceTb = false; - pdfium::Optional<XFA_ATTRIBUTEENUM> layoutMode = + pdfium::Optional<XFA_AttributeEnum> layoutMode = pFormNode->JSNode()->TryEnum(XFA_Attribute::Layout, false); if (layoutMode) return *layoutMode; @@ -502,9 +502,9 @@ XFA_ATTRIBUTEENUM GetLayout(CXFA_Node* pFormNode, bool* bRootForceTb) { CXFA_Node* pParentNode = pFormNode->GetNodeItem(XFA_NODEITEM_Parent); if (pParentNode && pParentNode->GetElementType() == XFA_Element::Form) { *bRootForceTb = true; - return XFA_ATTRIBUTEENUM_Tb; + return XFA_AttributeEnum::Tb; } - return XFA_ATTRIBUTEENUM_Position; + return XFA_AttributeEnum::Position; } bool ExistContainerKeep(CXFA_Node* pCurNode, bool bPreFind) { @@ -526,11 +526,11 @@ bool ExistContainerKeep(CXFA_Node* pCurNode, bool bPreFind) { if (!bPreFind) eKeepType = XFA_Attribute::Next; - pdfium::Optional<XFA_ATTRIBUTEENUM> previous = + pdfium::Optional<XFA_AttributeEnum> previous = pKeep->JSNode()->TryEnum(eKeepType, false); if (previous) { - if (*previous == XFA_ATTRIBUTEENUM_ContentArea || - *previous == XFA_ATTRIBUTEENUM_PageArea) { + if (*previous == XFA_AttributeEnum::ContentArea || + *previous == XFA_AttributeEnum::PageArea) { return true; } } @@ -544,12 +544,12 @@ bool ExistContainerKeep(CXFA_Node* pCurNode, bool bPreFind) { if (!bPreFind) eKeepType = XFA_Attribute::Previous; - pdfium::Optional<XFA_ATTRIBUTEENUM> next = + pdfium::Optional<XFA_AttributeEnum> next = pKeep->JSNode()->TryEnum(eKeepType, false); if (!next) return false; - if (*next == XFA_ATTRIBUTEENUM_ContentArea || - *next == XFA_ATTRIBUTEENUM_PageArea) { + if (*next == XFA_AttributeEnum::ContentArea || + *next == XFA_AttributeEnum::PageArea) { return true; } return false; @@ -585,7 +585,7 @@ bool FindBreakNode(CXFA_Node* pContainerNode, } case XFA_Element::Break: if (pBreakNode->JSNode()->GetEnum(eAttributeType) != - XFA_ATTRIBUTEENUM_Auto) { + XFA_AttributeEnum::Auto) { pCurActionNode = pBreakNode; *nCurStage = XFA_ItemLayoutProcessorStages::BreakBefore; if (!bBreakBefore) @@ -625,13 +625,13 @@ void DeleteLayoutGeneratedNode(CXFA_Node* pGenerateNode) { ->RemoveChild(pGenerateNode, true); } -uint8_t HAlignEnumToInt(XFA_ATTRIBUTEENUM eHAlign) { +uint8_t HAlignEnumToInt(XFA_AttributeEnum eHAlign) { switch (eHAlign) { - case XFA_ATTRIBUTEENUM_Center: + case XFA_AttributeEnum::Center: return 1; - case XFA_ATTRIBUTEENUM_Right: + case XFA_AttributeEnum::Right: return 2; - case XFA_ATTRIBUTEENUM_Left: + case XFA_AttributeEnum::Left: default: return 0; } @@ -643,7 +643,7 @@ XFA_ItemLayoutProcessorResult InsertFlowedItem( bool bContainerWidthAutoSize, bool bContainerHeightAutoSize, float fContainerHeight, - XFA_ATTRIBUTEENUM eFlowStrategy, + XFA_AttributeEnum eFlowStrategy, uint8_t* uCurHAlignState, std::vector<CXFA_ContentLayoutItem*> (&rgCurLineLayoutItems)[3], bool bUseBreakControl, @@ -664,27 +664,27 @@ XFA_ItemLayoutProcessorResult InsertFlowedItem( if (bContainerWidthAutoSize) uHAlign = 0; - if ((eFlowStrategy != XFA_ATTRIBUTEENUM_Rl_tb && + if ((eFlowStrategy != XFA_AttributeEnum::Rl_tb && uHAlign < *uCurHAlignState) || - (eFlowStrategy == XFA_ATTRIBUTEENUM_Rl_tb && + (eFlowStrategy == XFA_AttributeEnum::Rl_tb && uHAlign > *uCurHAlignState)) { return XFA_ItemLayoutProcessorResult::RowFullBreak; } *uCurHAlignState = uHAlign; bool bIsOwnSplit = - pProcessor->m_pFormNode->GetIntact() == XFA_ATTRIBUTEENUM_None; + pProcessor->m_pFormNode->GetIntact() == XFA_AttributeEnum::None; bool bUseRealHeight = bTakeSpace && bContainerHeightAutoSize && bIsOwnSplit && pProcessor->m_pFormNode->GetNodeItem(XFA_NODEITEM_Parent)->GetIntact() == - XFA_ATTRIBUTEENUM_None; + XFA_AttributeEnum::None; bool bIsTransHeight = bTakeSpace; if (bIsTransHeight && !bIsOwnSplit) { bool bRootForceTb = false; - XFA_ATTRIBUTEENUM eLayoutStrategy = + XFA_AttributeEnum eLayoutStrategy = GetLayout(pProcessor->m_pFormNode, &bRootForceTb); - if (eLayoutStrategy == XFA_ATTRIBUTEENUM_Lr_tb || - eLayoutStrategy == XFA_ATTRIBUTEENUM_Rl_tb) { + if (eLayoutStrategy == XFA_AttributeEnum::Lr_tb || + eLayoutStrategy == XFA_AttributeEnum::Rl_tb) { bIsTransHeight = false; } } @@ -735,7 +735,7 @@ XFA_ItemLayoutProcessorResult InsertFlowedItem( CXFA_ContentLayoutItem* pTrailerLayoutItem = nullptr; bool bIsAddTrailerHeight = false; if (pThis->m_pPageMgr && - pProcessor->m_pFormNode->GetIntact() == XFA_ATTRIBUTEENUM_None) { + pProcessor->m_pFormNode->GetIntact() == XFA_AttributeEnum::None) { pFormNode = pThis->m_pPageMgr->QueryOverflow(pProcessor->m_pFormNode); if (!pFormNode && pLayoutContext && pLayoutContext->m_pOverflowProcessor) { pFormNode = pLayoutContext->m_pOverflowNode; @@ -795,7 +795,7 @@ XFA_ItemLayoutProcessorResult InsertFlowedItem( CXFA_ContentLayoutItem* pChildLayoutItem = pProcessor->ExtractLayoutItem(); if (ExistContainerKeep(pProcessor->m_pFormNode, false) && - pProcessor->m_pFormNode->GetIntact() == XFA_ATTRIBUTEENUM_None) { + pProcessor->m_pFormNode->GetIntact() == XFA_AttributeEnum::None) { pThis->m_arrayKeepItems.push_back(pChildLayoutItem); } else { pThis->m_arrayKeepItems.clear(); @@ -847,9 +847,9 @@ XFA_ItemLayoutProcessorResult InsertFlowedItem( *bForceEndPage = true; float fSplitPos = pProcessor->FindSplitPos(fAvailHeight - *fContentCurRowY); if (fSplitPos > XFA_LAYOUT_FLOAT_PERCISION) { - XFA_ATTRIBUTEENUM eLayout = + XFA_AttributeEnum eLayout = pProcessor->m_pFormNode->JSNode()->GetEnum(XFA_Attribute::Layout); - if (eLayout == XFA_ATTRIBUTEENUM_Tb && + if (eLayout == XFA_AttributeEnum::Tb && eRetValue == XFA_ItemLayoutProcessorResult::Done) { pProcessor->ProcessUnUseOverFlow(pOverflowLeaderNode, pOverflowTrailerNode, pTrailerLayoutItem, @@ -942,10 +942,10 @@ XFA_ItemLayoutProcessorResult InsertFlowedItem( return eRetValue; } - XFA_ATTRIBUTEENUM eLayout = + XFA_AttributeEnum eLayout = pProcessor->m_pFormNode->JSNode()->GetEnum(XFA_Attribute::Layout); - if (pProcessor->m_pFormNode->GetIntact() == XFA_ATTRIBUTEENUM_None && - eLayout == XFA_ATTRIBUTEENUM_Tb) { + if (pProcessor->m_pFormNode->GetIntact() == XFA_AttributeEnum::None && + eLayout == XFA_AttributeEnum::Tb) { if (pThis->m_pPageMgr) { pThis->m_pPageMgr->ProcessOverflow(pFormNode, pOverflowLeaderNode, pOverflowTrailerNode, false, true); @@ -988,7 +988,7 @@ bool FindLayoutItemSplitPos(CXFA_ContentLayoutItem* pLayoutItem, } switch (pFormNode->GetIntact()) { - case XFA_ATTRIBUTEENUM_None: { + case XFA_AttributeEnum::None: { bool bAnyChanged = false; CXFA_Document* pDocument = pFormNode->GetDocument(); CXFA_FFNotify* pNotify = pDocument->GetNotify(); @@ -1049,8 +1049,8 @@ bool FindLayoutItemSplitPos(CXFA_ContentLayoutItem* pLayoutItem, } return bAnyChanged; } - case XFA_ATTRIBUTEENUM_ContentArea: - case XFA_ATTRIBUTEENUM_PageArea: { + case XFA_AttributeEnum::ContentArea: + case XFA_AttributeEnum::PageArea: { *fProposedSplitPos = fCurVerticalOffset; return true; } @@ -1061,35 +1061,35 @@ bool FindLayoutItemSplitPos(CXFA_ContentLayoutItem* pLayoutItem, CFX_PointF CalculatePositionedContainerPos(CXFA_Node* pNode, const CFX_SizeF& size) { - XFA_ATTRIBUTEENUM eAnchorType = + XFA_AttributeEnum eAnchorType = pNode->JSNode()->GetEnum(XFA_Attribute::AnchorType); int32_t nAnchorType = 0; switch (eAnchorType) { - case XFA_ATTRIBUTEENUM_TopLeft: + case XFA_AttributeEnum::TopLeft: nAnchorType = 0; break; - case XFA_ATTRIBUTEENUM_TopCenter: + case XFA_AttributeEnum::TopCenter: nAnchorType = 1; break; - case XFA_ATTRIBUTEENUM_TopRight: + case XFA_AttributeEnum::TopRight: nAnchorType = 2; break; - case XFA_ATTRIBUTEENUM_MiddleLeft: + case XFA_AttributeEnum::MiddleLeft: nAnchorType = 3; break; - case XFA_ATTRIBUTEENUM_MiddleCenter: + case XFA_AttributeEnum::MiddleCenter: nAnchorType = 4; break; - case XFA_ATTRIBUTEENUM_MiddleRight: + case XFA_AttributeEnum::MiddleRight: nAnchorType = 5; break; - case XFA_ATTRIBUTEENUM_BottomLeft: + case XFA_AttributeEnum::BottomLeft: nAnchorType = 6; break; - case XFA_ATTRIBUTEENUM_BottomCenter: + case XFA_AttributeEnum::BottomCenter: nAnchorType = 7; break; - case XFA_ATTRIBUTEENUM_BottomRight: + case XFA_AttributeEnum::BottomRight: nAnchorType = 8; break; default: @@ -1191,10 +1191,10 @@ CXFA_ContentLayoutItem* CXFA_ItemLayoutProcessor::CreateContentLayoutItem( float CXFA_ItemLayoutProcessor::FindSplitPos(float fProposedSplitPos) { ASSERT(m_pLayoutItem); - XFA_ATTRIBUTEENUM eLayout = m_pFormNode->JSNode() + XFA_AttributeEnum eLayout = m_pFormNode->JSNode() ->TryEnum(XFA_Attribute::Layout, true) - .value_or(XFA_ATTRIBUTEENUM_Position); - bool bCalculateMargin = eLayout != XFA_ATTRIBUTEENUM_Position; + .value_or(XFA_AttributeEnum::Position); + bool bCalculateMargin = eLayout != XFA_AttributeEnum::Position; while (fProposedSplitPos > XFA_LAYOUT_FLOAT_PERCISION) { bool bAppChange = false; if (!FindLayoutItemSplitPos(m_pLayoutItem, 0, &fProposedSplitPos, @@ -1210,11 +1210,11 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem( CXFA_ContentLayoutItem* pSecondParent, float fSplitPos) { float fCurTopMargin = 0, fCurBottomMargin = 0; - XFA_ATTRIBUTEENUM eLayout = m_pFormNode->JSNode() + XFA_AttributeEnum eLayout = m_pFormNode->JSNode() ->TryEnum(XFA_Attribute::Layout, true) - .value_or(XFA_ATTRIBUTEENUM_Position); + .value_or(XFA_AttributeEnum::Position); bool bCalculateMargin = true; - if (eLayout == XFA_ATTRIBUTEENUM_Position) + if (eLayout == XFA_AttributeEnum::Position) bCalculateMargin = false; CXFA_Node* pMarginNode = @@ -1529,7 +1529,7 @@ bool CXFA_ItemLayoutProcessor::ProcessKeepNodesForCheckNext( XFA_ItemLayoutProcessorStages& nCurStage, CXFA_Node*& pNextContainer, bool& bLastKeepNode) { - const bool bCanSplit = pNextContainer->GetIntact() == XFA_ATTRIBUTEENUM_None; + const bool bCanSplit = pNextContainer->GetIntact() == XFA_AttributeEnum::None; bool bNextKeep = false; if (ExistContainerKeep(pNextContainer, false)) bNextKeep = true; @@ -1584,11 +1584,11 @@ bool CXFA_ItemLayoutProcessor::ProcessKeepNodesForBreakBefore( } bool XFA_ItemLayoutProcessor_IsTakingSpace(CXFA_Node* pNode) { - XFA_ATTRIBUTEENUM ePresence = pNode->JSNode() + XFA_AttributeEnum ePresence = pNode->JSNode() ->TryEnum(XFA_Attribute::Presence, true) - .value_or(XFA_ATTRIBUTEENUM_Visible); - return ePresence == XFA_ATTRIBUTEENUM_Visible || - ePresence == XFA_ATTRIBUTEENUM_Invisible; + .value_or(XFA_AttributeEnum::Visible); + return ePresence == XFA_AttributeEnum::Visible || + ePresence == XFA_AttributeEnum::Invisible; } bool CXFA_ItemLayoutProcessor::IncrementRelayoutNode( @@ -1660,10 +1660,10 @@ void CXFA_ItemLayoutProcessor::DoLayoutPositionedContainer( return; m_pLayoutItem = CreateContentLayoutItem(m_pFormNode); - bool bIgnoreXY = - (m_pFormNode->JSNode() - ->TryEnum(XFA_Attribute::Layout, true) - .value_or(XFA_ATTRIBUTEENUM_Position) != XFA_ATTRIBUTEENUM_Position); + bool bIgnoreXY = (m_pFormNode->JSNode() + ->TryEnum(XFA_Attribute::Layout, true) + .value_or(XFA_AttributeEnum::Position) != + XFA_AttributeEnum::Position); bool bContainerWidthAutoSize = true; bool bContainerHeightAutoSize = true; CFX_SizeF containerSize = CalculateContainerSpecifiedSize( @@ -1853,10 +1853,10 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) { if (!XFA_ItemLayoutProcessor_IsTakingSpace(pLayoutChild->m_pFormNode)) continue; - XFA_ATTRIBUTEENUM eLayout = + XFA_AttributeEnum eLayout = pLayoutChild->m_pFormNode->JSNode()->GetEnum(XFA_Attribute::Layout); - if (eLayout != XFA_ATTRIBUTEENUM_Row && - eLayout != XFA_ATTRIBUTEENUM_Rl_row) { + if (eLayout != XFA_AttributeEnum::Row && + eLayout != XFA_AttributeEnum::Rl_row) { continue; } if (CXFA_ContentLayoutItem* pRowLayoutCell = @@ -1940,10 +1940,10 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) { continue; if (pLayoutChild->m_pFormNode->GetElementType() == XFA_Element::Subform) { - XFA_ATTRIBUTEENUM eSubformLayout = + XFA_AttributeEnum eSubformLayout = pLayoutChild->m_pFormNode->JSNode()->GetEnum(XFA_Attribute::Layout); - if (eSubformLayout == XFA_ATTRIBUTEENUM_Row || - eSubformLayout == XFA_ATTRIBUTEENUM_Rl_row) { + if (eSubformLayout == XFA_AttributeEnum::Row || + eSubformLayout == XFA_AttributeEnum::Rl_row) { RelocateTableRowCells(pLayoutChild, m_rgSpecifiedColumnWidths, eSubformLayout); } @@ -1955,15 +1955,15 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) { } else { switch ( pLayoutChild->m_pFormNode->JSNode()->GetEnum(XFA_Attribute::HAlign)) { - case XFA_ATTRIBUTEENUM_Center: + case XFA_AttributeEnum::Center: pLayoutChild->m_sPos.x = (fContentWidthLimit - pLayoutChild->m_sSize.width) / 2; break; - case XFA_ATTRIBUTEENUM_Right: + case XFA_AttributeEnum::Right: pLayoutChild->m_sPos.x = fContentWidthLimit - pLayoutChild->m_sSize.width; break; - case XFA_ATTRIBUTEENUM_Left: + case XFA_AttributeEnum::Left: default: pLayoutChild->m_sPos.x = 0; break; @@ -1998,9 +1998,9 @@ bool CXFA_ItemLayoutProcessor::IsAddNewRowForTrailer( return false; float fWidth = pTrailerItem->m_sSize.width; - XFA_ATTRIBUTEENUM eLayout = + XFA_AttributeEnum eLayout = m_pFormNode->JSNode()->GetEnum(XFA_Attribute::Layout); - return eLayout == XFA_ATTRIBUTEENUM_Tb || m_fWidthLimite <= fWidth; + return eLayout == XFA_AttributeEnum::Tb || m_fWidthLimite <= fWidth; } float CXFA_ItemLayoutProcessor::InsertKeepLayoutItems() { @@ -2038,7 +2038,7 @@ bool CXFA_ItemLayoutProcessor::ProcessKeepForSplit( return false; if (pParentProcessor->m_pCurChildNode->GetIntact() == - XFA_ATTRIBUTEENUM_None && + XFA_AttributeEnum::None && pChildProcessor->m_bHasAvailHeight) return false; @@ -2139,7 +2139,7 @@ void CXFA_ItemLayoutProcessor::ProcessUnUseOverFlow( XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( bool bUseBreakControl, - XFA_ATTRIBUTEENUM eFlowStrategy, + XFA_AttributeEnum eFlowStrategy, float fHeightLimit, float fRealHeight, CXFA_LayoutContext* pContext, @@ -2168,7 +2168,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( CXFA_Node* pParentNode = m_pFormNode->GetNodeItem(XFA_NODEITEM_Parent); bool bFocrTb = false; if (pParentNode && - GetLayout(pParentNode, &bFocrTb) == XFA_ATTRIBUTEENUM_Row) { + GetLayout(pParentNode, &bFocrTb) == XFA_AttributeEnum::Row) { CXFA_Node* pChildContainer = m_pFormNode->GetNodeItem( XFA_NODEITEM_FirstChild, XFA_ObjectType::ContainerNode); if (pChildContainer && @@ -2214,7 +2214,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( CXFA_ContentLayoutItem* pLayoutChild = nullptr; if (m_pLayoutItem) { if (m_nCurChildNodeStage != XFA_ItemLayoutProcessorStages::Done && - eFlowStrategy != XFA_ATTRIBUTEENUM_Tb) { + eFlowStrategy != XFA_AttributeEnum::Tb) { pLayoutChild = (CXFA_ContentLayoutItem*)m_pLayoutItem->m_pFirstChild; for (CXFA_ContentLayoutItem* pLayoutNext = pLayoutChild; pLayoutNext; pLayoutNext = (CXFA_ContentLayoutItem*)pLayoutNext->m_pNextSibling) { @@ -2267,7 +2267,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( m_fWidthLimite = fContentCurRowAvailWidth; std::vector<CXFA_ContentLayoutItem*> rgCurLineLayoutItems[3]; uint8_t uCurHAlignState = - (eFlowStrategy != XFA_ATTRIBUTEENUM_Rl_tb ? 0 : 2); + (eFlowStrategy != XFA_AttributeEnum::Rl_tb ? 0 : 2); if (pLayoutChild) { for (CXFA_ContentLayoutItem* pLayoutNext = pLayoutChild; pLayoutNext; pLayoutNext = (CXFA_ContentLayoutItem*)pLayoutNext->m_pNextSibling) { @@ -2280,7 +2280,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( uint8_t uHAlign = HAlignEnumToInt( pLayoutNext->m_pFormNode->JSNode()->GetEnum(XFA_Attribute::HAlign)); rgCurLineLayoutItems[uHAlign].push_back(pLayoutNext); - if (eFlowStrategy == XFA_ATTRIBUTEENUM_Lr_tb) { + if (eFlowStrategy == XFA_AttributeEnum::Lr_tb) { if (uHAlign > uCurHAlignState) uCurHAlignState = uHAlign; } else if (uHAlign < uCurHAlignState) { @@ -2541,7 +2541,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( } GotoNextContainerNode(m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, true); - if (bAddedItemInRow && eFlowStrategy == XFA_ATTRIBUTEENUM_Tb) + if (bAddedItemInRow && eFlowStrategy == XFA_AttributeEnum::Tb) break; else continue; @@ -2592,7 +2592,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( bool CXFA_ItemLayoutProcessor::CalculateRowChildPosition( std::vector<CXFA_ContentLayoutItem*> (&rgCurLineLayoutItems)[3], - XFA_ATTRIBUTEENUM eFlowStrategy, + XFA_AttributeEnum eFlowStrategy, bool bContainerHeightAutoSize, bool bContainerWidthAutoSize, float* fContentCalculatedWidth, @@ -2624,7 +2624,7 @@ bool CXFA_ItemLayoutProcessor::CalculateRowChildPosition( if (!m_pLayoutItem) m_pLayoutItem = CreateContentLayoutItem(m_pFormNode); - if (eFlowStrategy != XFA_ATTRIBUTEENUM_Rl_tb) { + if (eFlowStrategy != XFA_AttributeEnum::Rl_tb) { float fCurPos; fCurPos = 0; for (int32_t c = nGroupLengths[0], j = 0; j < c; j++) { @@ -2782,22 +2782,22 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayout( case XFA_Element::SubformSet: { bool bRootForceTb = false; CXFA_Node* pLayoutNode = GetSubformSetParent(m_pFormNode); - XFA_ATTRIBUTEENUM eLayoutStrategy = GetLayout(pLayoutNode, &bRootForceTb); + XFA_AttributeEnum eLayoutStrategy = GetLayout(pLayoutNode, &bRootForceTb); switch (eLayoutStrategy) { - case XFA_ATTRIBUTEENUM_Tb: - case XFA_ATTRIBUTEENUM_Lr_tb: - case XFA_ATTRIBUTEENUM_Rl_tb: + case XFA_AttributeEnum::Tb: + case XFA_AttributeEnum::Lr_tb: + case XFA_AttributeEnum::Rl_tb: return DoLayoutFlowedContainer(bUseBreakControl, eLayoutStrategy, fHeightLimit, fRealHeight, pContext, bRootForceTb); - case XFA_ATTRIBUTEENUM_Position: - case XFA_ATTRIBUTEENUM_Row: - case XFA_ATTRIBUTEENUM_Rl_row: + case XFA_AttributeEnum::Position: + case XFA_AttributeEnum::Row: + case XFA_AttributeEnum::Rl_row: default: DoLayoutPositionedContainer(pContext); m_nCurChildNodeStage = XFA_ItemLayoutProcessorStages::Done; return XFA_ItemLayoutProcessorResult::Done; - case XFA_ATTRIBUTEENUM_Table: + case XFA_AttributeEnum::Table: DoLayoutTableContainer(pLayoutNode); m_nCurChildNodeStage = XFA_ItemLayoutProcessorStages::Done; return XFA_ItemLayoutProcessorResult::Done; diff --git a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.h b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.h index 832941c810..e178095207 100644 --- a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.h +++ b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.h @@ -115,7 +115,7 @@ class CXFA_ItemLayoutProcessor { float InsertKeepLayoutItems(); bool CalculateRowChildPosition( std::vector<CXFA_ContentLayoutItem*> (&rgCurLineLayoutItems)[3], - XFA_ATTRIBUTEENUM eFlowStrategy, + XFA_AttributeEnum eFlowStrategy, bool bContainerHeightAutoSize, bool bContainerWidthAutoSize, float* fContentCalculatedWidth, @@ -133,7 +133,7 @@ class CXFA_ItemLayoutProcessor { void DoLayoutTableContainer(CXFA_Node* pLayoutNode); XFA_ItemLayoutProcessorResult DoLayoutFlowedContainer( bool bUseBreakControl, - XFA_ATTRIBUTEENUM eFlowStrategy, + XFA_AttributeEnum eFlowStrategy, float fHeightLimit, float fRealHeight, CXFA_LayoutContext* pContext, diff --git a/xfa/fxfa/parser/cxfa_items.cpp b/xfa/fxfa/parser/cxfa_items.cpp index 833e284777..8276ed4b20 100644 --- a/xfa/fxfa/parser/cxfa_items.cpp +++ b/xfa/fxfa/parser/cxfa_items.cpp @@ -14,7 +14,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Ref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Presence, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Visible}, + (void*)XFA_AttributeEnum::Visible}, {XFA_Attribute::Save, XFA_AttributeType::Boolean, (void*)0}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_keep.cpp b/xfa/fxfa/parser/cxfa_keep.cpp index c72592b65f..54121fe62f 100644 --- a/xfa/fxfa/parser/cxfa_keep.cpp +++ b/xfa/fxfa/parser/cxfa_keep.cpp @@ -13,13 +13,13 @@ const CXFA_Node::PropertyData kPropertyData[] = {{XFA_Element::Extras, 1, 0}, const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Next, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_None}, + (void*)XFA_AttributeEnum::None}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Previous, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_None}, + (void*)XFA_AttributeEnum::None}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Intact, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_None}, + (void*)XFA_AttributeEnum::None}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"keep"; diff --git a/xfa/fxfa/parser/cxfa_keyusage.cpp b/xfa/fxfa/parser/cxfa_keyusage.cpp index 269a58cd7c..f12ab04d5d 100644 --- a/xfa/fxfa/parser/cxfa_keyusage.cpp +++ b/xfa/fxfa/parser/cxfa_keyusage.cpp @@ -14,7 +14,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::NonRepudiation, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::EncipherOnly, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Optional}, + (void*)XFA_AttributeEnum::Optional}, {XFA_Attribute::DigitalSignature, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::CrlSign, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::KeyAgreement, XFA_AttributeType::CData, nullptr}, diff --git a/xfa/fxfa/parser/cxfa_labelprinter.cpp b/xfa/fxfa/parser/cxfa_labelprinter.cpp index 0520cb6023..55b04da7de 100644 --- a/xfa/fxfa/parser/cxfa_labelprinter.cpp +++ b/xfa/fxfa/parser/cxfa_labelprinter.cpp @@ -16,7 +16,7 @@ const CXFA_Node::PropertyData kPropertyData[] = { {XFA_Element::Unknown, 0, 0}}; const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Name, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Zpl}, + (void*)XFA_AttributeEnum::Zpl}, {XFA_Attribute::Desc, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Lock, XFA_AttributeType::Integer, (void*)0}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp index 70d5f46856..90e0b15de6 100644 --- a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp +++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp @@ -96,11 +96,11 @@ void SyncContainer(CXFA_FFNotify* pNotify, uint32_t dwStatus = 0; uint32_t dwRelevantContainer = 0; if (bVisible) { - XFA_ATTRIBUTEENUM eAttributeValue = + XFA_AttributeEnum eAttributeValue = pContainerItem->m_pFormNode->JSNode() ->TryEnum(XFA_Attribute::Presence, true) - .value_or(XFA_ATTRIBUTEENUM_Visible); - if (eAttributeValue == XFA_ATTRIBUTEENUM_Visible) + .value_or(XFA_AttributeEnum::Visible); + if (eAttributeValue == XFA_AttributeEnum::Visible) bVisibleItem = true; dwRelevantContainer = GetRelevant(pContainerItem->m_pFormNode, dwRelevant); @@ -253,7 +253,7 @@ CXFA_LayoutPageMgr::CXFA_LayoutPageMgr(CXFA_LayoutProcessor* pLayoutProcessor) m_pCurPageArea(nullptr), m_nAvailPages(0), m_nCurPageCount(0), - m_ePageSetMode(XFA_ATTRIBUTEENUM_OrderedOccurrence), + m_ePageSetMode(XFA_AttributeEnum::OrderedOccurrence), m_bCreateOverFlowPage(false) {} CXFA_LayoutPageMgr::~CXFA_LayoutPageMgr() { @@ -287,9 +287,9 @@ bool CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) { m_pPageSetCurRoot = m_pPageSetLayoutItemRoot; m_pTemplatePageSetRoot->JSNode()->SetLayoutItem(m_pPageSetLayoutItemRoot); - XFA_ATTRIBUTEENUM eRelation = + XFA_AttributeEnum eRelation = m_pTemplatePageSetRoot->JSNode()->GetEnum(XFA_Attribute::Relation); - if (eRelation != XFA_ATTRIBUTEENUM_Unknown) + if (eRelation != XFA_AttributeEnum::Unknown) m_ePageSetMode = eRelation; InitPageSetMap(); @@ -366,7 +366,7 @@ bool CXFA_LayoutPageMgr::PrepareFirstPage(CXFA_Node* pRootSubform) { if (eType == XFA_Element::BreakBefore || (eType == XFA_Element::Break && pBreakNode->JSNode()->GetEnum(XFA_Attribute::Before) != - XFA_ATTRIBUTEENUM_Auto)) { + XFA_AttributeEnum::Auto)) { bProBreakBefore = true; pBreakBeforeNode = pBreakNode; break; @@ -606,14 +606,14 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() { sIterator(pRootPageSetLayoutItem); for (CXFA_ContainerLayoutItem* pPageSetLayoutItem = sIterator.GetCurrent(); pPageSetLayoutItem; pPageSetLayoutItem = sIterator.MoveToNext()) { - XFA_ATTRIBUTEENUM ePageRelation = + XFA_AttributeEnum ePageRelation = pPageSetLayoutItem->m_pFormNode->JSNode()->GetEnum( XFA_Attribute::Relation); switch (ePageRelation) { - case XFA_ATTRIBUTEENUM_OrderedOccurrence: + case XFA_AttributeEnum::OrderedOccurrence: default: { ProcessLastPageSet(); } break; - case XFA_ATTRIBUTEENUM_SimplexPaginated: - case XFA_ATTRIBUTEENUM_DuplexPaginated: { + case XFA_AttributeEnum::SimplexPaginated: + case XFA_AttributeEnum::DuplexPaginated: { CXFA_LayoutItem* pLastPageAreaLayoutItem = nullptr; int32_t nPageAreaCount = 0; for (CXFA_LayoutItem* pPageAreaLayoutItem = @@ -632,26 +632,27 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() { if (!FindPageAreaFromPageSet_SimplexDuplex( pPageSetLayoutItem->m_pFormNode, nullptr, nullptr, nullptr, - true, true, nPageAreaCount == 1 ? XFA_ATTRIBUTEENUM_Only - : XFA_ATTRIBUTEENUM_Last) && + true, true, + nPageAreaCount == 1 ? XFA_AttributeEnum::Only + : XFA_AttributeEnum::Last) && (nPageAreaCount == 1 && !FindPageAreaFromPageSet_SimplexDuplex( pPageSetLayoutItem->m_pFormNode, nullptr, nullptr, nullptr, - true, true, XFA_ATTRIBUTEENUM_Last))) { + true, true, XFA_AttributeEnum::Last))) { break; } CXFA_Node* pNode = m_pCurPageArea; - XFA_ATTRIBUTEENUM eCurChoice = + XFA_AttributeEnum eCurChoice = pNode->JSNode()->GetEnum(XFA_Attribute::PagePosition); - if (eCurChoice == XFA_ATTRIBUTEENUM_Last) { - XFA_ATTRIBUTEENUM eOddOrEven = + if (eCurChoice == XFA_AttributeEnum::Last) { + XFA_AttributeEnum eOddOrEven = pNode->JSNode()->GetEnum(XFA_Attribute::OddOrEven); - XFA_ATTRIBUTEENUM eLastChoice = + XFA_AttributeEnum eLastChoice = pLastPageAreaLayoutItem->m_pFormNode->JSNode()->GetEnum( XFA_Attribute::PagePosition); - if (eLastChoice == XFA_ATTRIBUTEENUM_First && - (ePageRelation == XFA_ATTRIBUTEENUM_SimplexPaginated || - eOddOrEven != XFA_ATTRIBUTEENUM_Odd)) { + if (eLastChoice == XFA_AttributeEnum::First && + (ePageRelation == XFA_AttributeEnum::SimplexPaginated || + eOddOrEven != XFA_AttributeEnum::Odd)) { CXFA_ContainerRecord* pRecord = CreateContainerRecord(); AddPageAreaLayoutItem(pRecord, pNode); break; @@ -724,7 +725,7 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() { pContentAreaNode->GetNodeItem(XFA_NODEITEM_NextSibling); } } else if (pNode->JSNode()->GetEnum(XFA_Attribute::PagePosition) == - XFA_ATTRIBUTEENUM_Last) { + XFA_AttributeEnum::Last) { CXFA_ContainerRecord* pRecord = CreateContainerRecord(); AddPageAreaLayoutItem(pRecord, pNode); } @@ -751,12 +752,12 @@ int32_t CXFA_LayoutPageMgr::GetPageIndex( } bool CXFA_LayoutPageMgr::RunBreak(XFA_Element eBreakType, - XFA_ATTRIBUTEENUM eTargetType, + XFA_AttributeEnum eTargetType, CXFA_Node* pTarget, bool bStartNew) { bool bRet = false; switch (eTargetType) { - case XFA_ATTRIBUTEENUM_ContentArea: + case XFA_AttributeEnum::ContentArea: if (pTarget && pTarget->GetElementType() != XFA_Element::ContentArea) pTarget = nullptr; if (!pTarget || @@ -772,7 +773,7 @@ bool CXFA_LayoutPageMgr::RunBreak(XFA_Element eBreakType, bRet = !!pPageArea; } break; - case XFA_ATTRIBUTEENUM_PageArea: + case XFA_AttributeEnum::PageArea: if (pTarget && pTarget->GetElementType() != XFA_Element::PageArea) pTarget = nullptr; if (!pTarget || @@ -783,15 +784,15 @@ bool CXFA_LayoutPageMgr::RunBreak(XFA_Element eBreakType, bRet = !!pPageArea; } break; - case XFA_ATTRIBUTEENUM_PageOdd: + case XFA_AttributeEnum::PageOdd: if (pTarget && pTarget->GetElementType() != XFA_Element::PageArea) pTarget = nullptr; break; - case XFA_ATTRIBUTEENUM_PageEven: + case XFA_AttributeEnum::PageEven: if (pTarget && pTarget->GetElementType() != XFA_Element::PageArea) pTarget = nullptr; break; - case XFA_ATTRIBUTEENUM_Auto: + case XFA_AttributeEnum::Auto: default: break; } @@ -964,11 +965,11 @@ CXFA_Node* CXFA_LayoutPageMgr::BreakOverflow(CXFA_Node* pOverflowNode, m_bCreateOverFlowPage = true; switch (pTarget->GetElementType()) { case XFA_Element::PageArea: - RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_PageArea, pTarget, - true); + RunBreak(XFA_Element::Overflow, XFA_AttributeEnum::PageArea, + pTarget, true); break; case XFA_Element::ContentArea: - RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_ContentArea, + RunBreak(XFA_Element::Overflow, XFA_AttributeEnum::ContentArea, pTarget, true); break; default: @@ -996,11 +997,11 @@ CXFA_Node* CXFA_LayoutPageMgr::BreakOverflow(CXFA_Node* pOverflowNode, m_bCreateOverFlowPage = true; switch (pTarget->GetElementType()) { case XFA_Element::PageArea: - RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_PageArea, pTarget, + RunBreak(XFA_Element::Overflow, XFA_AttributeEnum::PageArea, pTarget, true); break; case XFA_Element::ContentArea: - RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_ContentArea, + RunBreak(XFA_Element::Overflow, XFA_AttributeEnum::ContentArea, pTarget, true); break; default: @@ -1113,10 +1114,10 @@ bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet(CXFA_Node* pPageSet, pTargetPageArea, pTargetContentArea, bNewPage, bQuery); } - XFA_ATTRIBUTEENUM ePreferredPosition = + XFA_AttributeEnum ePreferredPosition = m_CurrentContainerRecordIter != m_ProposedContainerRecords.end() - ? XFA_ATTRIBUTEENUM_Rest - : XFA_ATTRIBUTEENUM_First; + ? XFA_AttributeEnum::Rest + : XFA_AttributeEnum::First; return FindPageAreaFromPageSet_SimplexDuplex( pPageSet, pStartChild, pTargetPageArea, pTargetContentArea, bNewPage, bQuery, ePreferredPosition); @@ -1201,8 +1202,8 @@ bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( CXFA_Node* pTargetContentArea, bool bNewPage, bool bQuery, - XFA_ATTRIBUTEENUM ePreferredPosition) { - const XFA_ATTRIBUTEENUM eFallbackPosition = XFA_ATTRIBUTEENUM_Any; + XFA_AttributeEnum ePreferredPosition) { + const XFA_AttributeEnum eFallbackPosition = XFA_AttributeEnum::Any; CXFA_Node* pPreferredPageArea = nullptr; CXFA_Node* pFallbackPageArea = nullptr; CXFA_Node* pCurrentNode = nullptr; @@ -1217,14 +1218,14 @@ bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( if (!MatchPageAreaOddOrEven(pCurrentNode)) continue; - XFA_ATTRIBUTEENUM eCurPagePosition = + XFA_AttributeEnum eCurPagePosition = pCurrentNode->JSNode()->GetEnum(XFA_Attribute::PagePosition); - if (ePreferredPosition == XFA_ATTRIBUTEENUM_Last) { + if (ePreferredPosition == XFA_AttributeEnum::Last) { if (eCurPagePosition != ePreferredPosition) continue; - if (m_ePageSetMode == XFA_ATTRIBUTEENUM_SimplexPaginated || + if (m_ePageSetMode == XFA_AttributeEnum::SimplexPaginated || pCurrentNode->JSNode()->GetEnum(XFA_Attribute::OddOrEven) == - XFA_ATTRIBUTEENUM_Any) { + XFA_AttributeEnum::Any) { pPreferredPageArea = pCurrentNode; break; } @@ -1235,12 +1236,12 @@ bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( pPreferredPageArea = pCurrentNode; return false; } - if (ePreferredPosition == XFA_ATTRIBUTEENUM_Only) { + if (ePreferredPosition == XFA_AttributeEnum::Only) { if (eCurPagePosition != ePreferredPosition) continue; - if (m_ePageSetMode != XFA_ATTRIBUTEENUM_DuplexPaginated || + if (m_ePageSetMode != XFA_AttributeEnum::DuplexPaginated || pCurrentNode->JSNode()->GetEnum(XFA_Attribute::OddOrEven) == - XFA_ATTRIBUTEENUM_Any) { + XFA_AttributeEnum::Any) { pPreferredPageArea = pCurrentNode; break; } @@ -1255,8 +1256,8 @@ bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( } continue; } - if ((ePreferredPosition == XFA_ATTRIBUTEENUM_Rest && - eCurPagePosition == XFA_ATTRIBUTEENUM_Any) || + if ((ePreferredPosition == XFA_AttributeEnum::Rest && + eCurPagePosition == XFA_AttributeEnum::Any) || eCurPagePosition == ePreferredPosition) { pPreferredPageArea = pCurrentNode; break; @@ -1302,16 +1303,16 @@ bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex( } bool CXFA_LayoutPageMgr::MatchPageAreaOddOrEven(CXFA_Node* pPageArea) { - if (m_ePageSetMode != XFA_ATTRIBUTEENUM_DuplexPaginated) + if (m_ePageSetMode != XFA_AttributeEnum::DuplexPaginated) return true; - pdfium::Optional<XFA_ATTRIBUTEENUM> ret = + pdfium::Optional<XFA_AttributeEnum> ret = pPageArea->JSNode()->TryEnum(XFA_Attribute::OddOrEven, true); - if (!ret || *ret == XFA_ATTRIBUTEENUM_Any) + if (!ret || *ret == XFA_AttributeEnum::Any) return true; int32_t iPageLast = GetPageCount() % 2; - return *ret == XFA_ATTRIBUTEENUM_Odd ? iPageLast == 0 : iPageLast == 1; + return *ret == XFA_AttributeEnum::Odd ? iPageLast == 0 : iPageLast == 1; } CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea( @@ -1425,9 +1426,9 @@ void CXFA_LayoutPageMgr::InitPageSetMap() { for (CXFA_Node* pPageSetNode = sIterator.GetCurrent(); pPageSetNode; pPageSetNode = sIterator.MoveToNext()) { if (pPageSetNode->GetElementType() == XFA_Element::PageSet) { - XFA_ATTRIBUTEENUM eRelation = + XFA_AttributeEnum eRelation = pPageSetNode->JSNode()->GetEnum(XFA_Attribute::Relation); - if (eRelation == XFA_ATTRIBUTEENUM_OrderedOccurrence) + if (eRelation == XFA_AttributeEnum::OrderedOccurrence) m_pPageSetMap[pPageSetNode] = 0; } } @@ -1929,11 +1930,11 @@ void CXFA_LayoutPageMgr::SyncLayoutData() { continue; } - XFA_ATTRIBUTEENUM presence = + XFA_AttributeEnum presence = pContentItem->m_pFormNode->JSNode() ->TryEnum(XFA_Attribute::Presence, true) - .value_or(XFA_ATTRIBUTEENUM_Visible); - bool bVisible = presence == XFA_ATTRIBUTEENUM_Visible; + .value_or(XFA_AttributeEnum::Visible); + bool bVisible = presence == XFA_AttributeEnum::Visible; uint32_t dwRelevantChild = GetRelevant(pContentItem->m_pFormNode, dwRelevant); SyncContainer(pNotify, m_pLayoutProcessor, pContentItem, @@ -1972,7 +1973,7 @@ void XFA_ReleaseLayoutItem_NoPageArea(CXFA_LayoutItem* pLayoutItem) { void CXFA_LayoutPageMgr::PrepareLayout() { m_pPageSetCurRoot = nullptr; - m_ePageSetMode = XFA_ATTRIBUTEENUM_OrderedOccurrence; + m_ePageSetMode = XFA_AttributeEnum::OrderedOccurrence; m_nAvailPages = 0; ClearData(); if (!m_pPageSetLayoutItemRoot) diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.h b/xfa/fxfa/parser/cxfa_layoutpagemgr.h index 7ab1d4f82c..42fa4e6cd9 100644 --- a/xfa/fxfa/parser/cxfa_layoutpagemgr.h +++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.h @@ -72,7 +72,7 @@ class CXFA_LayoutPageMgr { void AddContentAreaLayoutItem(CXFA_ContainerRecord* pNewRecord, CXFA_Node* pContentArea); bool RunBreak(XFA_Element eBreakType, - XFA_ATTRIBUTEENUM eTargetType, + XFA_AttributeEnum eTargetType, CXFA_Node* pTarget, bool bStartNew); CXFA_Node* BreakOverflow(CXFA_Node* pOverflowNode, @@ -111,7 +111,7 @@ class CXFA_LayoutPageMgr { CXFA_Node* pTargetContentArea = nullptr, bool bNewPage = false, bool bQuery = false, - XFA_ATTRIBUTEENUM ePreferredPosition = XFA_ATTRIBUTEENUM_First); + XFA_AttributeEnum ePreferredPosition = XFA_AttributeEnum::First); bool MatchPageAreaOddOrEven(CXFA_Node* pPageArea); CXFA_Node* GetNextAvailPageArea(CXFA_Node* pTargetPageArea, CXFA_Node* pTargetContentArea = nullptr, @@ -121,7 +121,7 @@ class CXFA_LayoutPageMgr { void InitPageSetMap(); void ProcessLastPageSet(); bool IsPageSetRootOrderedOccurrence() const { - return m_ePageSetMode == XFA_ATTRIBUTEENUM_OrderedOccurrence; + return m_ePageSetMode == XFA_AttributeEnum::OrderedOccurrence; } void ClearData(); void MergePageSetContents(); @@ -138,7 +138,7 @@ class CXFA_LayoutPageMgr { CXFA_Node* m_pCurPageArea; int32_t m_nAvailPages; int32_t m_nCurPageCount; - XFA_ATTRIBUTEENUM m_ePageSetMode; + XFA_AttributeEnum m_ePageSetMode; bool m_bCreateOverFlowPage; std::map<CXFA_Node*, int32_t> m_pPageSetMap; std::vector<CXFA_ContainerLayoutItem*> m_PageArray; diff --git a/xfa/fxfa/parser/cxfa_line.cpp b/xfa/fxfa/parser/cxfa_line.cpp index e517cbb55d..dde2165350 100644 --- a/xfa/fxfa/parser/cxfa_line.cpp +++ b/xfa/fxfa/parser/cxfa_line.cpp @@ -14,10 +14,10 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Slope, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Backslash}, + (void*)XFA_AttributeEnum::Backslash}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Hand, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Even}, + (void*)XFA_AttributeEnum::Even}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"line"; diff --git a/xfa/fxfa/parser/cxfa_linear.cpp b/xfa/fxfa/parser/cxfa_linear.cpp index c92598f1fd..307ab11919 100644 --- a/xfa/fxfa/parser/cxfa_linear.cpp +++ b/xfa/fxfa/parser/cxfa_linear.cpp @@ -15,7 +15,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_ToRight}, + (void*)XFA_AttributeEnum::ToRight}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_linedata.cpp b/xfa/fxfa/parser/cxfa_linedata.cpp index 9fa39bc956..c4995d7338 100644 --- a/xfa/fxfa/parser/cxfa_linedata.cpp +++ b/xfa/fxfa/parser/cxfa_linedata.cpp @@ -8,13 +8,13 @@ #include "xfa/fxfa/parser/cxfa_node.h" -XFA_ATTRIBUTEENUM CXFA_LineData::GetHand() const { +XFA_AttributeEnum CXFA_LineData::GetHand() const { return m_pNode->JSNode()->GetEnum(XFA_Attribute::Hand); } bool CXFA_LineData::GetSlope() const { return m_pNode->JSNode()->GetEnum(XFA_Attribute::Slope) == - XFA_ATTRIBUTEENUM_Slash; + XFA_AttributeEnum::Slash; } CXFA_EdgeData CXFA_LineData::GetEdgeData() const { diff --git a/xfa/fxfa/parser/cxfa_linedata.h b/xfa/fxfa/parser/cxfa_linedata.h index 0f85e50a11..c1cc1e468c 100644 --- a/xfa/fxfa/parser/cxfa_linedata.h +++ b/xfa/fxfa/parser/cxfa_linedata.h @@ -17,7 +17,7 @@ class CXFA_LineData : public CXFA_DataData { public: explicit CXFA_LineData(CXFA_Node* pNode) : CXFA_DataData(pNode) {} - XFA_ATTRIBUTEENUM GetHand() const; + XFA_AttributeEnum GetHand() const; bool GetSlope() const; CXFA_EdgeData GetEdgeData() const; }; diff --git a/xfa/fxfa/parser/cxfa_lockdocument.cpp b/xfa/fxfa/parser/cxfa_lockdocument.cpp index 2b09736197..7e653347e0 100644 --- a/xfa/fxfa/parser/cxfa_lockdocument.cpp +++ b/xfa/fxfa/parser/cxfa_lockdocument.cpp @@ -12,7 +12,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Optional}, + (void*)XFA_AttributeEnum::Optional}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_manifest.cpp b/xfa/fxfa/parser/cxfa_manifest.cpp index 2406160bae..243331cab5 100644 --- a/xfa/fxfa/parser/cxfa_manifest.cpp +++ b/xfa/fxfa/parser/cxfa_manifest.cpp @@ -15,7 +15,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Name, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Action, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Include}, + (void*)XFA_AttributeEnum::Include}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_mdp.cpp b/xfa/fxfa/parser/cxfa_mdp.cpp index a3703c39f3..17858b352d 100644 --- a/xfa/fxfa/parser/cxfa_mdp.cpp +++ b/xfa/fxfa/parser/cxfa_mdp.cpp @@ -12,7 +12,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::SignatureType, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Filter}, + (void*)XFA_AttributeEnum::Filter}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Permissions, XFA_AttributeType::Integer, (void*)2}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_medium.cpp b/xfa/fxfa/parser/cxfa_medium.cpp index a124dab6e0..e212e2112b 100644 --- a/xfa/fxfa/parser/cxfa_medium.cpp +++ b/xfa/fxfa/parser/cxfa_medium.cpp @@ -11,14 +11,14 @@ namespace { const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::TrayOut, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Auto}, + (void*)XFA_AttributeEnum::Auto}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Orientation, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Portrait}, + (void*)XFA_AttributeEnum::Portrait}, {XFA_Attribute::ImagingBBox, XFA_AttributeType::CData, (void*)L"none"}, {XFA_Attribute::Short, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::TrayIn, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Auto}, + (void*)XFA_AttributeEnum::Auto}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Stock, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Long, XFA_AttributeType::Measure, (void*)L"0in"}, diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 3207010fcb..378d3063a9 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -135,21 +135,19 @@ void ReorderDataNodes(const std::set<CXFA_Node*>& sSet1, } // namespace // static -WideString CXFA_Node::AttributeEnumToName(XFA_ATTRIBUTEENUM item) { - if (item >= g_iXFAEnumCount) - return L""; +WideString CXFA_Node::AttributeEnumToName(XFA_AttributeEnum item) { return g_XFAEnumData[static_cast<int32_t>(item)].pName; } // static -pdfium::Optional<XFA_ATTRIBUTEENUM> CXFA_Node::NameToAttributeEnum( +pdfium::Optional<XFA_AttributeEnum> CXFA_Node::NameToAttributeEnum( const WideStringView& name) { if (name.IsEmpty()) return {}; auto* it = std::lower_bound(g_XFAEnumData, g_XFAEnumData + g_iXFAEnumCount, FX_HashCode_GetW(name, false), - [](const XFA_ATTRIBUTEENUMINFO& arg, + [](const XFA_AttributeEnumInfo& arg, uint32_t hash) { return arg.uHash < hash; }); if (it != g_XFAEnumData + g_iXFAEnumCount && name == it->pName) return {it->eName}; @@ -218,7 +216,7 @@ CXFA_Node* CXFA_Node::Clone(bool bRecursive) { pCloneXML.reset(pCloneXMLElement.release()); pClone->JSNode()->SetEnum(XFA_Attribute::Contains, - XFA_ATTRIBUTEENUM_Unknown, false); + XFA_AttributeEnum::Unknown, false); } else { pCloneXML = m_pXMLNode->Clone(); } @@ -648,38 +646,38 @@ bool CXFA_Node::GetLocaleName(WideString& wsLocaleName) { return true; } -XFA_ATTRIBUTEENUM CXFA_Node::GetIntact() { +XFA_AttributeEnum CXFA_Node::GetIntact() { CXFA_Node* pKeep = GetFirstChildByClass(XFA_Element::Keep); - XFA_ATTRIBUTEENUM eLayoutType = JSNode() + XFA_AttributeEnum eLayoutType = JSNode() ->TryEnum(XFA_Attribute::Layout, true) - .value_or(XFA_ATTRIBUTEENUM_Position); + .value_or(XFA_AttributeEnum::Position); if (pKeep) { - pdfium::Optional<XFA_ATTRIBUTEENUM> intact = + pdfium::Optional<XFA_AttributeEnum> intact = pKeep->JSNode()->TryEnum(XFA_Attribute::Intact, false); if (intact) { - if (*intact == XFA_ATTRIBUTEENUM_None && - eLayoutType == XFA_ATTRIBUTEENUM_Row && + if (*intact == XFA_AttributeEnum::None && + eLayoutType == XFA_AttributeEnum::Row && m_pDocument->GetCurVersionMode() < XFA_VERSION_208) { CXFA_Node* pPreviewRow = GetNodeItem(XFA_NODEITEM_PrevSibling, XFA_ObjectType::ContainerNode); if (pPreviewRow && pPreviewRow->JSNode()->GetEnum(XFA_Attribute::Layout) == - XFA_ATTRIBUTEENUM_Row) { - pdfium::Optional<XFA_ATTRIBUTEENUM> value = + XFA_AttributeEnum::Row) { + pdfium::Optional<XFA_AttributeEnum> value = pKeep->JSNode()->TryEnum(XFA_Attribute::Previous, false); - if (value && (*value == XFA_ATTRIBUTEENUM_ContentArea || - *value == XFA_ATTRIBUTEENUM_PageArea)) { - return XFA_ATTRIBUTEENUM_ContentArea; + if (value && (*value == XFA_AttributeEnum::ContentArea || + *value == XFA_AttributeEnum::PageArea)) { + return XFA_AttributeEnum::ContentArea; } CXFA_Node* pNode = pPreviewRow->GetFirstChildByClass(XFA_Element::Keep); - pdfium::Optional<XFA_ATTRIBUTEENUM> ret; + pdfium::Optional<XFA_AttributeEnum> ret; if (pNode) ret = pNode->JSNode()->TryEnum(XFA_Attribute::Next, false); - if (ret && (*ret == XFA_ATTRIBUTEENUM_ContentArea || - *ret == XFA_ATTRIBUTEENUM_PageArea)) { - return XFA_ATTRIBUTEENUM_ContentArea; + if (ret && (*ret == XFA_AttributeEnum::ContentArea || + *ret == XFA_AttributeEnum::PageArea)) { + return XFA_AttributeEnum::ContentArea; } } } @@ -689,14 +687,14 @@ XFA_ATTRIBUTEENUM CXFA_Node::GetIntact() { switch (GetElementType()) { case XFA_Element::Subform: switch (eLayoutType) { - case XFA_ATTRIBUTEENUM_Position: - case XFA_ATTRIBUTEENUM_Row: - return XFA_ATTRIBUTEENUM_ContentArea; - case XFA_ATTRIBUTEENUM_Tb: - case XFA_ATTRIBUTEENUM_Table: - case XFA_ATTRIBUTEENUM_Lr_tb: - case XFA_ATTRIBUTEENUM_Rl_tb: - return XFA_ATTRIBUTEENUM_None; + case XFA_AttributeEnum::Position: + case XFA_AttributeEnum::Row: + return XFA_AttributeEnum::ContentArea; + case XFA_AttributeEnum::Tb: + case XFA_AttributeEnum::Table: + case XFA_AttributeEnum::Lr_tb: + case XFA_AttributeEnum::Rl_tb: + return XFA_AttributeEnum::None; default: break; } @@ -705,34 +703,34 @@ XFA_ATTRIBUTEENUM CXFA_Node::GetIntact() { CXFA_Node* pParentNode = GetNodeItem(XFA_NODEITEM_Parent); if (!pParentNode || pParentNode->GetElementType() == XFA_Element::PageArea) - return XFA_ATTRIBUTEENUM_ContentArea; - if (pParentNode->GetIntact() == XFA_ATTRIBUTEENUM_None) { - XFA_ATTRIBUTEENUM eParLayout = + return XFA_AttributeEnum::ContentArea; + if (pParentNode->GetIntact() == XFA_AttributeEnum::None) { + XFA_AttributeEnum eParLayout = pParentNode->JSNode() ->TryEnum(XFA_Attribute::Layout, true) - .value_or(XFA_ATTRIBUTEENUM_Position); - if (eParLayout == XFA_ATTRIBUTEENUM_Position || - eParLayout == XFA_ATTRIBUTEENUM_Row || - eParLayout == XFA_ATTRIBUTEENUM_Table) { - return XFA_ATTRIBUTEENUM_None; + .value_or(XFA_AttributeEnum::Position); + if (eParLayout == XFA_AttributeEnum::Position || + eParLayout == XFA_AttributeEnum::Row || + eParLayout == XFA_AttributeEnum::Table) { + return XFA_AttributeEnum::None; } XFA_VERSION version = m_pDocument->GetCurVersionMode(); - if (eParLayout == XFA_ATTRIBUTEENUM_Tb && version < XFA_VERSION_208) { + if (eParLayout == XFA_AttributeEnum::Tb && version < XFA_VERSION_208) { pdfium::Optional<CXFA_Measurement> measureH = JSNode()->TryMeasure(XFA_Attribute::H, false); if (measureH) - return XFA_ATTRIBUTEENUM_ContentArea; + return XFA_AttributeEnum::ContentArea; } - return XFA_ATTRIBUTEENUM_None; + return XFA_AttributeEnum::None; } - return XFA_ATTRIBUTEENUM_ContentArea; + return XFA_AttributeEnum::ContentArea; } case XFA_Element::Draw: - return XFA_ATTRIBUTEENUM_ContentArea; + return XFA_AttributeEnum::ContentArea; default: break; } - return XFA_ATTRIBUTEENUM_None; + return XFA_AttributeEnum::None; } CXFA_Node* CXFA_Node::GetDataDescriptionNode() { @@ -958,7 +956,7 @@ bool CXFA_Node::RemoveChild(CXFA_Node* pNode, bool bNotify) { pNode->m_pXMLNode = pNewXMLElement; pNode->JSNode()->SetEnum(XFA_Attribute::Contains, - XFA_ATTRIBUTEENUM_Unknown, false); + XFA_AttributeEnum::Unknown, false); } else { m_pXMLNode->RemoveChildNode(pNode->m_pXMLNode); } @@ -1105,7 +1103,7 @@ void CXFA_Node::ReleaseBindingNodes() { bool CXFA_Node::IsAttributeInXML() { return JSNode()->GetEnum(XFA_Attribute::Contains) == - XFA_ATTRIBUTEENUM_MetaData; + XFA_AttributeEnum::MetaData; } void CXFA_Node::OnRemoved(bool bNotify) { @@ -1357,13 +1355,13 @@ pdfium::Optional<WideString> CXFA_Node::GetDefaultCData( return {WideString(static_cast<const wchar_t*>(*value))}; } -pdfium::Optional<XFA_ATTRIBUTEENUM> CXFA_Node::GetDefaultEnum( +pdfium::Optional<XFA_AttributeEnum> CXFA_Node::GetDefaultEnum( XFA_Attribute attr) const { pdfium::Optional<void*> value = GetDefaultValue(attr, XFA_AttributeType::Enum); if (!value) return {}; - return {static_cast<XFA_ATTRIBUTEENUM>(reinterpret_cast<uintptr_t>(*value))}; + return {static_cast<XFA_AttributeEnum>(reinterpret_cast<uintptr_t>(*value))}; } pdfium::Optional<void*> CXFA_Node::GetDefaultValue( diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h index 4a2a2777a5..ab9f5e2806 100644 --- a/xfa/fxfa/parser/cxfa_node.h +++ b/xfa/fxfa/parser/cxfa_node.h @@ -62,8 +62,8 @@ class CXFA_Node : public CXFA_Object { static WideString ElementToName(XFA_Element elem); #endif // NDEBUG - static WideString AttributeEnumToName(XFA_ATTRIBUTEENUM item); - static pdfium::Optional<XFA_ATTRIBUTEENUM> NameToAttributeEnum( + static WideString AttributeEnumToName(XFA_AttributeEnum item); + static pdfium::Optional<XFA_AttributeEnum> NameToAttributeEnum( const WideStringView& name); static XFA_Attribute NameToAttribute(const WideStringView& name); static WideString AttributeToName(XFA_Attribute attr); @@ -159,7 +159,7 @@ class CXFA_Node : public CXFA_Object { CXFA_WidgetData* GetWidgetData(); CXFA_WidgetData* GetContainerWidgetData(); bool GetLocaleName(WideString& wsLocaleName); - XFA_ATTRIBUTEENUM GetIntact(); + XFA_AttributeEnum GetIntact(); CXFA_Node* GetFirstChildByName(const WideStringView& wsNodeName) const; CXFA_Node* GetFirstChildByName(uint32_t dwNodeNameHash) const; CXFA_Node* GetFirstChildByClass(XFA_Element eType) const; @@ -178,7 +178,7 @@ class CXFA_Node : public CXFA_Object { pdfium::Optional<CXFA_Measurement> GetDefaultMeasurement( XFA_Attribute attr) const; pdfium::Optional<WideString> GetDefaultCData(XFA_Attribute attr) const; - pdfium::Optional<XFA_ATTRIBUTEENUM> GetDefaultEnum(XFA_Attribute attr) const; + pdfium::Optional<XFA_AttributeEnum> GetDefaultEnum(XFA_Attribute attr) const; protected: CXFA_Node(CXFA_Document* pDoc, diff --git a/xfa/fxfa/parser/cxfa_node_unittest.cpp b/xfa/fxfa/parser/cxfa_node_unittest.cpp index 55360a6c47..dedef5df3a 100644 --- a/xfa/fxfa/parser/cxfa_node_unittest.cpp +++ b/xfa/fxfa/parser/cxfa_node_unittest.cpp @@ -19,9 +19,9 @@ TEST(CXFA_NodeTest, NameToAttribute) { TEST(CXFA_NodeTest, GetAttributeEnumByName) { EXPECT_FALSE(!!CXFA_Node::NameToAttributeEnum(L"")); EXPECT_FALSE(!!CXFA_Node::NameToAttributeEnum(L"nonesuch")); - EXPECT_EQ(XFA_ATTRIBUTEENUM_Asterisk, *CXFA_Node::NameToAttributeEnum(L"*")); - EXPECT_EQ(XFA_ATTRIBUTEENUM_Visible, + EXPECT_EQ(XFA_AttributeEnum::Asterisk, *CXFA_Node::NameToAttributeEnum(L"*")); + EXPECT_EQ(XFA_AttributeEnum::Visible, *CXFA_Node::NameToAttributeEnum(L"visible")); - EXPECT_EQ(XFA_ATTRIBUTEENUM_Lowered, + EXPECT_EQ(XFA_AttributeEnum::Lowered, *CXFA_Node::NameToAttributeEnum(L"lowered")); } diff --git a/xfa/fxfa/parser/cxfa_numberpattern.cpp b/xfa/fxfa/parser/cxfa_numberpattern.cpp index 7ca8f05313..6ee2698e2e 100644 --- a/xfa/fxfa/parser/cxfa_numberpattern.cpp +++ b/xfa/fxfa/parser/cxfa_numberpattern.cpp @@ -10,7 +10,7 @@ namespace { const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Name, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Numeric}, + (void*)XFA_AttributeEnum::Numeric}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"numberPattern"; diff --git a/xfa/fxfa/parser/cxfa_numbersymbol.cpp b/xfa/fxfa/parser/cxfa_numbersymbol.cpp index a8c3795fa4..74fdc1bb02 100644 --- a/xfa/fxfa/parser/cxfa_numbersymbol.cpp +++ b/xfa/fxfa/parser/cxfa_numbersymbol.cpp @@ -10,7 +10,7 @@ namespace { const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Name, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Decimal}, + (void*)XFA_AttributeEnum::Decimal}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"numberSymbol"; diff --git a/xfa/fxfa/parser/cxfa_numericedit.cpp b/xfa/fxfa/parser/cxfa_numericedit.cpp index fb0da14f68..a875b04b39 100644 --- a/xfa/fxfa/parser/cxfa_numericedit.cpp +++ b/xfa/fxfa/parser/cxfa_numericedit.cpp @@ -18,7 +18,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::HScrollPolicy, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Auto}, + (void*)XFA_AttributeEnum::Auto}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"numericEdit"; diff --git a/xfa/fxfa/parser/cxfa_oids.cpp b/xfa/fxfa/parser/cxfa_oids.cpp index 57bf593abf..9b72df01c8 100644 --- a/xfa/fxfa/parser/cxfa_oids.cpp +++ b/xfa/fxfa/parser/cxfa_oids.cpp @@ -12,7 +12,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Optional}, + (void*)XFA_AttributeEnum::Optional}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_pagearea.cpp b/xfa/fxfa/parser/cxfa_pagearea.cpp index 2b4b1e1796..b9b7869f59 100644 --- a/xfa/fxfa/parser/cxfa_pagearea.cpp +++ b/xfa/fxfa/parser/cxfa_pagearea.cpp @@ -18,15 +18,15 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Name, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::PagePosition, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Any}, + (void*)XFA_AttributeEnum::Any}, {XFA_Attribute::OddOrEven, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Any}, + (void*)XFA_AttributeEnum::Any}, {XFA_Attribute::Relevant, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::InitialNumber, XFA_AttributeType::Integer, (void*)1}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Numbered, XFA_AttributeType::Integer, (void*)1}, {XFA_Attribute::BlankOrNotBlank, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Any}, + (void*)XFA_AttributeEnum::Any}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"pageArea"; diff --git a/xfa/fxfa/parser/cxfa_pageset.cpp b/xfa/fxfa/parser/cxfa_pageset.cpp index 050790ef53..9de123af12 100644 --- a/xfa/fxfa/parser/cxfa_pageset.cpp +++ b/xfa/fxfa/parser/cxfa_pageset.cpp @@ -16,10 +16,10 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Name, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Relation, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_OrderedOccurrence}, + (void*)XFA_AttributeEnum::OrderedOccurrence}, {XFA_Attribute::Relevant, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::DuplexImposition, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_LongEdge}, + (void*)XFA_AttributeEnum::LongEdge}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_para.cpp b/xfa/fxfa/parser/cxfa_para.cpp index aab8d19c1c..a1e4b8c66e 100644 --- a/xfa/fxfa/parser/cxfa_para.cpp +++ b/xfa/fxfa/parser/cxfa_para.cpp @@ -14,7 +14,7 @@ const CXFA_Node::PropertyData kPropertyData[] = { const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::HAlign, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Left}, + (void*)XFA_AttributeEnum::Left}, {XFA_Attribute::TextIndent, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Widows, XFA_AttributeType::Integer, (void*)0}, @@ -24,7 +24,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Preserve, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::SpaceBelow, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::VAlign, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Top}, + (void*)XFA_AttributeEnum::Top}, {XFA_Attribute::TabDefault, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::TabStops, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Orphans, XFA_AttributeType::Integer, (void*)0}, diff --git a/xfa/fxfa/parser/cxfa_paradata.cpp b/xfa/fxfa/parser/cxfa_paradata.cpp index cb960f8dca..22cb678c99 100644 --- a/xfa/fxfa/parser/cxfa_paradata.cpp +++ b/xfa/fxfa/parser/cxfa_paradata.cpp @@ -11,16 +11,16 @@ CXFA_ParaData::CXFA_ParaData(CXFA_Node* pNode) : CXFA_DataData(pNode) {} -XFA_ATTRIBUTEENUM CXFA_ParaData::GetHorizontalAlign() const { +XFA_AttributeEnum CXFA_ParaData::GetHorizontalAlign() const { return m_pNode->JSNode() ->TryEnum(XFA_Attribute::HAlign, true) - .value_or(XFA_ATTRIBUTEENUM_Left); + .value_or(XFA_AttributeEnum::Left); } -XFA_ATTRIBUTEENUM CXFA_ParaData::GetVerticalAlign() const { +XFA_AttributeEnum CXFA_ParaData::GetVerticalAlign() const { return m_pNode->JSNode() ->TryEnum(XFA_Attribute::VAlign, true) - .value_or(XFA_ATTRIBUTEENUM_Top); + .value_or(XFA_AttributeEnum::Top); } float CXFA_ParaData::GetLineHeight() const { diff --git a/xfa/fxfa/parser/cxfa_paradata.h b/xfa/fxfa/parser/cxfa_paradata.h index b08c5c471f..f5859f3e5d 100644 --- a/xfa/fxfa/parser/cxfa_paradata.h +++ b/xfa/fxfa/parser/cxfa_paradata.h @@ -16,8 +16,8 @@ class CXFA_ParaData : public CXFA_DataData { public: explicit CXFA_ParaData(CXFA_Node* pNode); - XFA_ATTRIBUTEENUM GetHorizontalAlign() const; - XFA_ATTRIBUTEENUM GetVerticalAlign() const; + XFA_AttributeEnum GetHorizontalAlign() const; + XFA_AttributeEnum GetVerticalAlign() const; float GetLineHeight() const; float GetMarginLeft() const; float GetMarginRight() const; diff --git a/xfa/fxfa/parser/cxfa_passwordedit.cpp b/xfa/fxfa/parser/cxfa_passwordedit.cpp index da026ee3fa..dad5a7497c 100644 --- a/xfa/fxfa/parser/cxfa_passwordedit.cpp +++ b/xfa/fxfa/parser/cxfa_passwordedit.cpp @@ -18,7 +18,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::PasswordChar, XFA_AttributeType::CData, (void*)L"*"}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::HScrollPolicy, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Auto}, + (void*)XFA_AttributeEnum::Auto}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"passwordEdit"; diff --git a/xfa/fxfa/parser/cxfa_pattern.cpp b/xfa/fxfa/parser/cxfa_pattern.cpp index b1f14cbbbc..af39958085 100644 --- a/xfa/fxfa/parser/cxfa_pattern.cpp +++ b/xfa/fxfa/parser/cxfa_pattern.cpp @@ -15,7 +15,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_CrossHatch}, + (void*)XFA_AttributeEnum::CrossHatch}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_query.cpp b/xfa/fxfa/parser/cxfa_query.cpp index 09658a66b1..90ad891adb 100644 --- a/xfa/fxfa/parser/cxfa_query.cpp +++ b/xfa/fxfa/parser/cxfa_query.cpp @@ -16,7 +16,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Name, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::CommandType, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Unknown}, + (void*)XFA_AttributeEnum::Unknown}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_radial.cpp b/xfa/fxfa/parser/cxfa_radial.cpp index 3346cf89d1..77679704f3 100644 --- a/xfa/fxfa/parser/cxfa_radial.cpp +++ b/xfa/fxfa/parser/cxfa_radial.cpp @@ -15,7 +15,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_ToEdge}, + (void*)XFA_AttributeEnum::ToEdge}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_reasons.cpp b/xfa/fxfa/parser/cxfa_reasons.cpp index 4db0370261..d1229ca7da 100644 --- a/xfa/fxfa/parser/cxfa_reasons.cpp +++ b/xfa/fxfa/parser/cxfa_reasons.cpp @@ -12,7 +12,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Optional}, + (void*)XFA_AttributeEnum::Optional}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_recordset.cpp b/xfa/fxfa/parser/cxfa_recordset.cpp index ef6667ff5e..807e6cc6a7 100644 --- a/xfa/fxfa/parser/cxfa_recordset.cpp +++ b/xfa/fxfa/parser/cxfa_recordset.cpp @@ -14,16 +14,16 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Max, XFA_AttributeType::Integer, (void*)0}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::EofAction, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_MoveLast}, + (void*)XFA_AttributeEnum::MoveLast}, {XFA_Attribute::CursorType, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_ForwardOnly}, + (void*)XFA_AttributeEnum::ForwardOnly}, {XFA_Attribute::LockType, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_ReadOnly}, + (void*)XFA_AttributeEnum::ReadOnly}, {XFA_Attribute::BofAction, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_MoveFirst}, + (void*)XFA_AttributeEnum::MoveFirst}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::CursorLocation, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Client}, + (void*)XFA_AttributeEnum::Client}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"recordSet"; diff --git a/xfa/fxfa/parser/cxfa_rectangle.cpp b/xfa/fxfa/parser/cxfa_rectangle.cpp index 5a13c8a640..b23e8e9cd0 100644 --- a/xfa/fxfa/parser/cxfa_rectangle.cpp +++ b/xfa/fxfa/parser/cxfa_rectangle.cpp @@ -17,7 +17,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Hand, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Even}, + (void*)XFA_AttributeEnum::Even}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"rectangle"; diff --git a/xfa/fxfa/parser/cxfa_script.cpp b/xfa/fxfa/parser/cxfa_script.cpp index 158b5eeaa5..590d78c29e 100644 --- a/xfa/fxfa/parser/cxfa_script.cpp +++ b/xfa/fxfa/parser/cxfa_script.cpp @@ -19,7 +19,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::ContentType, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::RunAt, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Client}, + (void*)XFA_AttributeEnum::Client}, {XFA_Attribute::Binding, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Desc, XFA_AttributeType::CData, nullptr}, diff --git a/xfa/fxfa/parser/cxfa_scriptdata.cpp b/xfa/fxfa/parser/cxfa_scriptdata.cpp index 40a22b672d..23e94384f0 100644 --- a/xfa/fxfa/parser/cxfa_scriptdata.cpp +++ b/xfa/fxfa/parser/cxfa_scriptdata.cpp @@ -20,7 +20,7 @@ CXFA_ScriptData::Type CXFA_ScriptData::GetContentType() const { return Type::Unknown; } -XFA_ATTRIBUTEENUM CXFA_ScriptData::GetRunAt() const { +XFA_AttributeEnum CXFA_ScriptData::GetRunAt() const { return m_pNode->JSNode()->GetEnum(XFA_Attribute::RunAt); } diff --git a/xfa/fxfa/parser/cxfa_scriptdata.h b/xfa/fxfa/parser/cxfa_scriptdata.h index 2129928fb7..983addbd0c 100644 --- a/xfa/fxfa/parser/cxfa_scriptdata.h +++ b/xfa/fxfa/parser/cxfa_scriptdata.h @@ -25,7 +25,7 @@ class CXFA_ScriptData : public CXFA_DataData { explicit CXFA_ScriptData(CXFA_Node* pNode); Type GetContentType() const; - XFA_ATTRIBUTEENUM GetRunAt() const; + XFA_AttributeEnum GetRunAt() const; WideString GetExpression() const; }; diff --git a/xfa/fxfa/parser/cxfa_signature.cpp b/xfa/fxfa/parser/cxfa_signature.cpp index e5c1645519..7b8c8926dc 100644 --- a/xfa/fxfa/parser/cxfa_signature.cpp +++ b/xfa/fxfa/parser/cxfa_signature.cpp @@ -16,7 +16,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_PDF1_3}, + (void*)XFA_AttributeEnum::PDF1_3}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_signdata.cpp b/xfa/fxfa/parser/cxfa_signdata.cpp index 05d4c19947..82924d5b0c 100644 --- a/xfa/fxfa/parser/cxfa_signdata.cpp +++ b/xfa/fxfa/parser/cxfa_signdata.cpp @@ -16,7 +16,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Ref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Operation, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Sign}, + (void*)XFA_AttributeEnum::Sign}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Target, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_signing.cpp b/xfa/fxfa/parser/cxfa_signing.cpp index 5641efc696..356d8fc254 100644 --- a/xfa/fxfa/parser/cxfa_signing.cpp +++ b/xfa/fxfa/parser/cxfa_signing.cpp @@ -12,7 +12,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Optional}, + (void*)XFA_AttributeEnum::Optional}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_simple_parser.cpp b/xfa/fxfa/parser/cxfa_simple_parser.cpp index 0b8153fc3a..18d6006efc 100644 --- a/xfa/fxfa/parser/cxfa_simple_parser.cpp +++ b/xfa/fxfa/parser/cxfa_simple_parser.cpp @@ -706,7 +706,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_TemplateForm( bool bUseAttribute = true; if (pTemplateChosen && pTemplateChosen->JSNode()->GetEnum(XFA_Attribute::RestoreState) != - XFA_ATTRIBUTEENUM_Auto) { + XFA_AttributeEnum::Auto) { bUseAttribute = false; } if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, bUseAttribute)) @@ -1112,7 +1112,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode, pXFAMetaData->JSNode()->SetCData(XFA_Attribute::Value, it.second, false, false); pXFAMetaData->JSNode()->SetEnum(XFA_Attribute::Contains, - XFA_ATTRIBUTEENUM_MetaData, false); + XFA_AttributeEnum::MetaData, false); pXFAChild->InsertChild(pXFAMetaData, nullptr); pXFAMetaData->SetXMLMappingNode(pXMLElement); pXFAMetaData->SetFlag(XFA_NodeFlag_Initialized, false); diff --git a/xfa/fxfa/parser/cxfa_speak.cpp b/xfa/fxfa/parser/cxfa_speak.cpp index 677fdfa6cf..b4171782ec 100644 --- a/xfa/fxfa/parser/cxfa_speak.cpp +++ b/xfa/fxfa/parser/cxfa_speak.cpp @@ -13,7 +13,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Rid, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Priority, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Custom}, + (void*)XFA_AttributeEnum::Custom}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Disable, XFA_AttributeType::Boolean, (void*)0}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_staple.cpp b/xfa/fxfa/parser/cxfa_staple.cpp index 2e29ad6d23..31736d1d9d 100644 --- a/xfa/fxfa/parser/cxfa_staple.cpp +++ b/xfa/fxfa/parser/cxfa_staple.cpp @@ -10,7 +10,7 @@ namespace { const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Mode, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_UsePrinterSetting}, + (void*)XFA_AttributeEnum::UsePrinterSetting}, {XFA_Attribute::Desc, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Lock, XFA_AttributeType::Integer, (void*)0}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_strokedata.cpp b/xfa/fxfa/parser/cxfa_strokedata.cpp index 061b89e8ef..a0e80cdd5a 100644 --- a/xfa/fxfa/parser/cxfa_strokedata.cpp +++ b/xfa/fxfa/parser/cxfa_strokedata.cpp @@ -14,21 +14,21 @@ bool CXFA_StrokeData::IsVisible() const { if (!m_pNode) return false; - XFA_ATTRIBUTEENUM presence = m_pNode->JSNode() + XFA_AttributeEnum presence = m_pNode->JSNode() ->TryEnum(XFA_Attribute::Presence, true) - .value_or(XFA_ATTRIBUTEENUM_Visible); - return presence == XFA_ATTRIBUTEENUM_Visible; + .value_or(XFA_AttributeEnum::Visible); + return presence == XFA_AttributeEnum::Visible; } -XFA_ATTRIBUTEENUM CXFA_StrokeData::GetCapType() const { +XFA_AttributeEnum CXFA_StrokeData::GetCapType() const { if (!m_pNode) - return XFA_ATTRIBUTEENUM_Square; + return XFA_AttributeEnum::Square; return m_pNode->JSNode()->GetEnum(XFA_Attribute::Cap); } -XFA_ATTRIBUTEENUM CXFA_StrokeData::GetStrokeType() const { +XFA_AttributeEnum CXFA_StrokeData::GetStrokeType() const { return m_pNode ? m_pNode->JSNode()->GetEnum(XFA_Attribute::Stroke) - : XFA_ATTRIBUTEENUM_Solid; + : XFA_AttributeEnum::Solid; } float CXFA_StrokeData::GetThickness() const { @@ -75,9 +75,9 @@ void CXFA_StrokeData::SetColor(FX_ARGB argb) { false); } -XFA_ATTRIBUTEENUM CXFA_StrokeData::GetJoinType() const { +XFA_AttributeEnum CXFA_StrokeData::GetJoinType() const { return m_pNode ? m_pNode->JSNode()->GetEnum(XFA_Attribute::Join) - : XFA_ATTRIBUTEENUM_Square; + : XFA_AttributeEnum::Square; } bool CXFA_StrokeData::IsInverted() const { diff --git a/xfa/fxfa/parser/cxfa_strokedata.h b/xfa/fxfa/parser/cxfa_strokedata.h index b701c25edf..5ac7820239 100644 --- a/xfa/fxfa/parser/cxfa_strokedata.h +++ b/xfa/fxfa/parser/cxfa_strokedata.h @@ -28,9 +28,9 @@ class CXFA_StrokeData : public CXFA_DataData { bool IsVisible() const; bool IsInverted() const; - XFA_ATTRIBUTEENUM GetCapType() const; - XFA_ATTRIBUTEENUM GetStrokeType() const; - XFA_ATTRIBUTEENUM GetJoinType() const; + XFA_AttributeEnum GetCapType() const; + XFA_AttributeEnum GetStrokeType() const; + XFA_AttributeEnum GetJoinType() const; float GetRadius() const; float GetThickness() const; diff --git a/xfa/fxfa/parser/cxfa_subform.cpp b/xfa/fxfa/parser/cxfa_subform.cpp index a66b3159d1..6e932f52ce 100644 --- a/xfa/fxfa/parser/cxfa_subform.cpp +++ b/xfa/fxfa/parser/cxfa_subform.cpp @@ -25,35 +25,35 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Y, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::HAlign, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Left}, + (void*)XFA_AttributeEnum::Left}, {XFA_Attribute::Name, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::AllowMacro, XFA_AttributeType::Boolean, (void*)0}, {XFA_Attribute::ColumnWidths, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Access, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Open}, + (void*)XFA_AttributeEnum::Open}, {XFA_Attribute::Presence, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Visible}, + (void*)XFA_AttributeEnum::Visible}, {XFA_Attribute::VAlign, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Top}, + (void*)XFA_AttributeEnum::Top}, {XFA_Attribute::MaxH, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::MaxW, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::MinH, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::MinW, XFA_AttributeType::Measure, (void*)L"0in"}, {XFA_Attribute::Layout, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Position}, + (void*)XFA_AttributeEnum::Position}, {XFA_Attribute::Relevant, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::MergeMode, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_ConsumeData}, + (void*)XFA_AttributeEnum::ConsumeData}, {XFA_Attribute::ColSpan, XFA_AttributeType::Integer, (void*)1}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Locale, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::AnchorType, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_TopLeft}, + (void*)XFA_AttributeEnum::TopLeft}, {XFA_Attribute::RestoreState, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Manual}, + (void*)XFA_AttributeEnum::Manual}, {XFA_Attribute::Scope, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Name}, + (void*)XFA_AttributeEnum::Name}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"subform"; diff --git a/xfa/fxfa/parser/cxfa_subformset.cpp b/xfa/fxfa/parser/cxfa_subformset.cpp index 74b940c159..69f883879f 100644 --- a/xfa/fxfa/parser/cxfa_subformset.cpp +++ b/xfa/fxfa/parser/cxfa_subformset.cpp @@ -18,7 +18,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Name, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Relation, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Ordered}, + (void*)XFA_AttributeEnum::Ordered}, {XFA_Attribute::Relevant, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_subjectdns.cpp b/xfa/fxfa/parser/cxfa_subjectdns.cpp index 94457522b0..df65a803e6 100644 --- a/xfa/fxfa/parser/cxfa_subjectdns.cpp +++ b/xfa/fxfa/parser/cxfa_subjectdns.cpp @@ -12,7 +12,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Optional}, + (void*)XFA_AttributeEnum::Optional}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_submit.cpp b/xfa/fxfa/parser/cxfa_submit.cpp index deb24aefb8..60717b9dfe 100644 --- a/xfa/fxfa/parser/cxfa_submit.cpp +++ b/xfa/fxfa/parser/cxfa_submit.cpp @@ -14,7 +14,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Format, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Xdp}, + (void*)XFA_AttributeEnum::Xdp}, {XFA_Attribute::EmbedPDF, XFA_AttributeType::Boolean, (void*)0}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Target, XFA_AttributeType::CData, nullptr}, diff --git a/xfa/fxfa/parser/cxfa_submitdata.cpp b/xfa/fxfa/parser/cxfa_submitdata.cpp index e10dec62f0..91c88dd39c 100644 --- a/xfa/fxfa/parser/cxfa_submitdata.cpp +++ b/xfa/fxfa/parser/cxfa_submitdata.cpp @@ -14,7 +14,7 @@ bool CXFA_SubmitData::IsSubmitEmbedPDF() const { return m_pNode->JSNode()->GetBoolean(XFA_Attribute::EmbedPDF); } -XFA_ATTRIBUTEENUM CXFA_SubmitData::GetSubmitFormat() const { +XFA_AttributeEnum CXFA_SubmitData::GetSubmitFormat() const { return m_pNode->JSNode()->GetEnum(XFA_Attribute::Format); } diff --git a/xfa/fxfa/parser/cxfa_submitdata.h b/xfa/fxfa/parser/cxfa_submitdata.h index 039c327b97..55f06f945a 100644 --- a/xfa/fxfa/parser/cxfa_submitdata.h +++ b/xfa/fxfa/parser/cxfa_submitdata.h @@ -18,7 +18,7 @@ class CXFA_SubmitData : public CXFA_DataData { explicit CXFA_SubmitData(CXFA_Node* pNode); bool IsSubmitEmbedPDF() const; - XFA_ATTRIBUTEENUM GetSubmitFormat() const; + XFA_AttributeEnum GetSubmitFormat() const; WideString GetSubmitTarget() const; WideString GetSubmitXDPContent() const; }; diff --git a/xfa/fxfa/parser/cxfa_template.cpp b/xfa/fxfa/parser/cxfa_template.cpp index 28ae61b167..d847bf8e0c 100644 --- a/xfa/fxfa/parser/cxfa_template.cpp +++ b/xfa/fxfa/parser/cxfa_template.cpp @@ -16,7 +16,7 @@ const CXFA_Node::PropertyData kPropertyData[] = { const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Desc, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::BaseProfile, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Full}, + (void*)XFA_AttributeEnum::Full}, {XFA_Attribute::Lock, XFA_AttributeType::Integer, (void*)0}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_textedit.cpp b/xfa/fxfa/parser/cxfa_textedit.cpp index 131fcc79fa..7171af916e 100644 --- a/xfa/fxfa/parser/cxfa_textedit.cpp +++ b/xfa/fxfa/parser/cxfa_textedit.cpp @@ -16,13 +16,13 @@ const CXFA_Node::PropertyData kPropertyData[] = {{XFA_Element::Margin, 1, 0}, const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::VScrollPolicy, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Auto}, + (void*)XFA_AttributeEnum::Auto}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::AllowRichText, XFA_AttributeType::Boolean, (void*)0}, {XFA_Attribute::MultiLine, XFA_AttributeType::Boolean, (void*)0}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::HScrollPolicy, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Auto}, + (void*)XFA_AttributeEnum::Auto}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"textEdit"; diff --git a/xfa/fxfa/parser/cxfa_timepattern.cpp b/xfa/fxfa/parser/cxfa_timepattern.cpp index 9424e8c940..76e3a53265 100644 --- a/xfa/fxfa/parser/cxfa_timepattern.cpp +++ b/xfa/fxfa/parser/cxfa_timepattern.cpp @@ -10,7 +10,7 @@ namespace { const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Name, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Med}, + (void*)XFA_AttributeEnum::Med}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; constexpr wchar_t kName[] = L"timePattern"; diff --git a/xfa/fxfa/parser/cxfa_timestamp.cpp b/xfa/fxfa/parser/cxfa_timestamp.cpp index 369a015678..1d286ed064 100644 --- a/xfa/fxfa/parser/cxfa_timestamp.cpp +++ b/xfa/fxfa/parser/cxfa_timestamp.cpp @@ -12,7 +12,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Type, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Optional}, + (void*)XFA_AttributeEnum::Optional}, {XFA_Attribute::Server, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_traverse.cpp b/xfa/fxfa/parser/cxfa_traverse.cpp index f691ab827b..ad01901fd6 100644 --- a/xfa/fxfa/parser/cxfa_traverse.cpp +++ b/xfa/fxfa/parser/cxfa_traverse.cpp @@ -16,7 +16,7 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Ref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Operation, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Next}, + (void*)XFA_AttributeEnum::Next}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_validate.cpp b/xfa/fxfa/parser/cxfa_validate.cpp index 03066a75da..545491fb7e 100644 --- a/xfa/fxfa/parser/cxfa_validate.cpp +++ b/xfa/fxfa/parser/cxfa_validate.cpp @@ -17,13 +17,13 @@ const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::ScriptTest, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Error}, + (void*)XFA_AttributeEnum::Error}, {XFA_Attribute::NullTest, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Disabled}, + (void*)XFA_AttributeEnum::Disabled}, {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::Desc, XFA_AttributeType::CData, nullptr}, {XFA_Attribute::FormatTest, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Warning}, + (void*)XFA_AttributeEnum::Warning}, {XFA_Attribute::Lock, XFA_AttributeType::Integer, (void*)0}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_validatedata.cpp b/xfa/fxfa/parser/cxfa_validatedata.cpp index dd45b5295b..3f7ce1705a 100644 --- a/xfa/fxfa/parser/cxfa_validatedata.cpp +++ b/xfa/fxfa/parser/cxfa_validatedata.cpp @@ -19,22 +19,22 @@ constexpr wchar_t kScriptTest[] = L"scriptTest"; CXFA_ValidateData::CXFA_ValidateData(CXFA_Node* pNode) : CXFA_DataData(pNode) {} -XFA_ATTRIBUTEENUM CXFA_ValidateData::GetFormatTest() const { +XFA_AttributeEnum CXFA_ValidateData::GetFormatTest() const { return m_pNode->JSNode()->GetEnum(XFA_Attribute::FormatTest); } void CXFA_ValidateData::SetNullTest(const WideString& wsValue) { - pdfium::Optional<XFA_ATTRIBUTEENUM> item = + pdfium::Optional<XFA_AttributeEnum> item = CXFA_Node::NameToAttributeEnum(wsValue.AsStringView()); m_pNode->JSNode()->SetEnum(XFA_Attribute::NullTest, - item ? *item : XFA_ATTRIBUTEENUM_Disabled, false); + item ? *item : XFA_AttributeEnum::Disabled, false); } -XFA_ATTRIBUTEENUM CXFA_ValidateData::GetNullTest() const { +XFA_AttributeEnum CXFA_ValidateData::GetNullTest() const { return m_pNode->JSNode()->GetEnum(XFA_Attribute::NullTest); } -XFA_ATTRIBUTEENUM CXFA_ValidateData::GetScriptTest() const { +XFA_AttributeEnum CXFA_ValidateData::GetScriptTest() const { return m_pNode->JSNode()->GetEnum(XFA_Attribute::ScriptTest); } diff --git a/xfa/fxfa/parser/cxfa_validatedata.h b/xfa/fxfa/parser/cxfa_validatedata.h index e18fcadeaf..309db62ab6 100644 --- a/xfa/fxfa/parser/cxfa_validatedata.h +++ b/xfa/fxfa/parser/cxfa_validatedata.h @@ -18,17 +18,17 @@ class CXFA_ValidateData : public CXFA_DataData { public: explicit CXFA_ValidateData(CXFA_Node* pNode); - XFA_ATTRIBUTEENUM GetFormatTest() const; + XFA_AttributeEnum GetFormatTest() const; WideString GetFormatMessageText() const; void SetFormatMessageText(const WideString& wsMessage); - XFA_ATTRIBUTEENUM GetNullTest() const; + XFA_AttributeEnum GetNullTest() const; void SetNullTest(const WideString& wsValue); WideString GetNullMessageText() const; void SetNullMessageText(const WideString& wsMessage); - XFA_ATTRIBUTEENUM GetScriptTest() const; + XFA_AttributeEnum GetScriptTest() const; WideString GetScriptMessageText() const; void SetScriptMessageText(const WideString& wsMessage); diff --git a/xfa/fxfa/parser/cxfa_versioncontrol.cpp b/xfa/fxfa/parser/cxfa_versioncontrol.cpp index 8830de7818..9cca84a167 100644 --- a/xfa/fxfa/parser/cxfa_versioncontrol.cpp +++ b/xfa/fxfa/parser/cxfa_versioncontrol.cpp @@ -10,11 +10,11 @@ namespace { const CXFA_Node::AttributeData kAttributeData[] = { {XFA_Attribute::SourceBelow, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Update}, + (void*)XFA_AttributeEnum::Update}, {XFA_Attribute::OutputBelow, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Warn}, + (void*)XFA_AttributeEnum::Warn}, {XFA_Attribute::SourceAbove, XFA_AttributeType::Enum, - (void*)XFA_ATTRIBUTEENUM_Warn}, + (void*)XFA_AttributeEnum::Warn}, {XFA_Attribute::Lock, XFA_AttributeType::Integer, (void*)0}, {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}}; diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index 9ceeb61f6c..d147bd97ef 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -179,7 +179,7 @@ CXFA_Node* CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) { break; case XFA_Element::ChoiceList: { eValueType = (pUIChild->JSNode()->GetEnum(XFA_Attribute::Open) == - XFA_ATTRIBUTEENUM_MultiSelect) + XFA_AttributeEnum::MultiSelect) ? XFA_Element::ExData : XFA_Element::Text; break; @@ -227,8 +227,8 @@ bool CXFA_WidgetData::IsOpenAccess() const { for (CXFA_Node* pNode = m_pNode; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_Parent, XFA_ObjectType::ContainerNode)) { - XFA_ATTRIBUTEENUM iAcc = pNode->JSNode()->GetEnum(XFA_Attribute::Access); - if (iAcc != XFA_ATTRIBUTEENUM_Open) + XFA_AttributeEnum iAcc = pNode->JSNode()->GetEnum(XFA_Attribute::Access); + if (iAcc != XFA_AttributeEnum::Open) return false; } return true; @@ -270,13 +270,13 @@ std::vector<CXFA_Node*> CXFA_WidgetData::GetEventList() { } std::vector<CXFA_Node*> CXFA_WidgetData::GetEventByActivity( - XFA_ATTRIBUTEENUM iActivity, + XFA_AttributeEnum iActivity, bool bIsFormReady) { std::vector<CXFA_Node*> events; for (CXFA_Node* pNode : GetEventList()) { CXFA_EventData eventData(pNode); if (eventData.GetActivity() == iActivity) { - if (iActivity == XFA_ATTRIBUTEENUM_Ready) { + if (iActivity == XFA_AttributeEnum::Ready) { WideString wsRef = eventData.GetRef(); if (bIsFormReady) { if (wsRef == WideStringView(L"$form")) @@ -362,7 +362,7 @@ CFX_RectF CXFA_WidgetData::GetUIMargin() { CXFA_BorderData borderData = GetUIBorderData(); if (borderData.HasValidNode() && - borderData.GetPresence() != XFA_ATTRIBUTEENUM_Visible) { + borderData.GetPresence() != XFA_AttributeEnum::Visible) { return CFX_RectF(); } @@ -373,7 +373,7 @@ CFX_RectF CXFA_WidgetData::GetUIMargin() { if (borderData.HasValidNode()) { bool bVisible = false; float fThickness = 0; - int32_t iType = 0; + XFA_AttributeEnum iType = XFA_AttributeEnum::Unknown; std::tie(iType, bVisible, fThickness) = borderData.Get3DStyle(); if (!left || !top || !right || !bottom) { std::vector<CXFA_StrokeData> strokes = borderData.GetStrokes(); @@ -391,11 +391,11 @@ CFX_RectF CXFA_WidgetData::GetUIMargin() { bottom.value_or(0.0)); } -XFA_ATTRIBUTEENUM CXFA_WidgetData::GetButtonHighlight() { +XFA_AttributeEnum CXFA_WidgetData::GetButtonHighlight() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) return pUIChild->JSNode()->GetEnum(XFA_Attribute::Highlight); - return XFA_ATTRIBUTEENUM_Inverted; + return XFA_AttributeEnum::Inverted; } bool CXFA_WidgetData::HasButtonRollover() const { @@ -428,15 +428,15 @@ bool CXFA_WidgetData::IsCheckButtonRound() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) return pUIChild->JSNode()->GetEnum(XFA_Attribute::Shape) == - XFA_ATTRIBUTEENUM_Round; + XFA_AttributeEnum::Round; return false; } -XFA_ATTRIBUTEENUM CXFA_WidgetData::GetCheckButtonMark() { +XFA_AttributeEnum CXFA_WidgetData::GetCheckButtonMark() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) return pUIChild->JSNode()->GetEnum(XFA_Attribute::Mark); - return XFA_ATTRIBUTEENUM_Default; + return XFA_AttributeEnum::Default; } bool CXFA_WidgetData::IsRadioButton() { @@ -646,7 +646,7 @@ bool CXFA_WidgetData::IsChoiceListCommitOnSelect() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) { return pUIChild->JSNode()->GetEnum(XFA_Attribute::CommitOn) == - XFA_ATTRIBUTEENUM_Select; + XFA_AttributeEnum::Select; } return true; } @@ -660,7 +660,7 @@ bool CXFA_WidgetData::IsChoiceListMultiSelect() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) { return pUIChild->JSNode()->GetEnum(XFA_Attribute::Open) == - XFA_ATTRIBUTEENUM_MultiSelect; + XFA_AttributeEnum::MultiSelect; } return false; } @@ -670,9 +670,9 @@ bool CXFA_WidgetData::IsListBox() { if (!pUIChild) return false; - XFA_ATTRIBUTEENUM attr = pUIChild->JSNode()->GetEnum(XFA_Attribute::Open); - return attr == XFA_ATTRIBUTEENUM_Always || - attr == XFA_ATTRIBUTEENUM_MultiSelect; + XFA_AttributeEnum attr = pUIChild->JSNode()->GetEnum(XFA_Attribute::Open); + return attr == XFA_AttributeEnum::Always || + attr == XFA_AttributeEnum::MultiSelect; } int32_t CXFA_WidgetData::CountChoiceListItems(bool bSaveValue) { @@ -949,13 +949,13 @@ void CXFA_WidgetData::InsertItem(const WideString& wsLabel, } else { CXFA_Node* pNode = listitems[0]; pNode->JSNode()->SetBoolean(XFA_Attribute::Save, false, false); - pNode->JSNode()->SetEnum(XFA_Attribute::Presence, XFA_ATTRIBUTEENUM_Visible, - false); + pNode->JSNode()->SetEnum(XFA_Attribute::Presence, + XFA_AttributeEnum::Visible, false); CXFA_Node* pSaveItems = m_pNode->CreateSamePacketNode(XFA_Element::Items); m_pNode->InsertChild(-1, pSaveItems); pSaveItems->JSNode()->SetBoolean(XFA_Attribute::Save, true, false); pSaveItems->JSNode()->SetEnum(XFA_Attribute::Presence, - XFA_ATTRIBUTEENUM_Hidden, false); + XFA_AttributeEnum::Hidden, false); CXFA_Node* pListNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); int32_t i = 0; while (pListNode) { @@ -1102,7 +1102,7 @@ bool CXFA_WidgetData::IsHorizontalScrollPolicyOff() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) { return pUIChild->JSNode()->GetEnum(XFA_Attribute::HScrollPolicy) == - XFA_ATTRIBUTEENUM_Off; + XFA_AttributeEnum::Off; } return false; } @@ -1111,7 +1111,7 @@ bool CXFA_WidgetData::IsVerticalScrollPolicyOff() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) { return pUIChild->JSNode()->GetEnum(XFA_Attribute::VScrollPolicy) == - XFA_ATTRIBUTEENUM_Off; + XFA_AttributeEnum::Off; } return false; } @@ -1146,19 +1146,19 @@ CXFA_WidgetData::GetBarcodeAttribute_CharEncoding() { } pdfium::Optional<bool> CXFA_WidgetData::GetBarcodeAttribute_Checksum() { - pdfium::Optional<XFA_ATTRIBUTEENUM> checksum = + pdfium::Optional<XFA_AttributeEnum> checksum = GetUIChild()->JSNode()->TryEnum(XFA_Attribute::Checksum, true); if (!checksum) return {}; switch (*checksum) { - case XFA_ATTRIBUTEENUM_None: + case XFA_AttributeEnum::None: return {false}; - case XFA_ATTRIBUTEENUM_Auto: + case XFA_AttributeEnum::Auto: return {true}; - case XFA_ATTRIBUTEENUM_1mod10: - case XFA_ATTRIBUTEENUM_1mod10_1mod11: - case XFA_ATTRIBUTEENUM_2mod10: + case XFA_AttributeEnum::Checksum_1mod10: + case XFA_AttributeEnum::Checksum_1mod10_1mod11: + case XFA_AttributeEnum::Checksum_2mod10: default: break; } @@ -1225,21 +1225,21 @@ pdfium::Optional<bool> CXFA_WidgetData::GetBarcodeAttribute_PrintChecksum() { pdfium::Optional<BC_TEXT_LOC> CXFA_WidgetData::GetBarcodeAttribute_TextLocation() { - pdfium::Optional<XFA_ATTRIBUTEENUM> textLocation = + pdfium::Optional<XFA_AttributeEnum> textLocation = GetUIChild()->JSNode()->TryEnum(XFA_Attribute::TextLocation, true); if (!textLocation) return {}; switch (*textLocation) { - case XFA_ATTRIBUTEENUM_None: + case XFA_AttributeEnum::None: return {BC_TEXT_LOC_NONE}; - case XFA_ATTRIBUTEENUM_Above: + case XFA_AttributeEnum::Above: return {BC_TEXT_LOC_ABOVE}; - case XFA_ATTRIBUTEENUM_Below: + case XFA_AttributeEnum::Below: return {BC_TEXT_LOC_BELOW}; - case XFA_ATTRIBUTEENUM_AboveEmbedded: + case XFA_AttributeEnum::AboveEmbedded: return {BC_TEXT_LOC_ABOVEEMBED}; - case XFA_ATTRIBUTEENUM_BelowEmbedded: + case XFA_AttributeEnum::BelowEmbedded: return {BC_TEXT_LOC_BELOWEMBED}; default: break; diff --git a/xfa/fxfa/parser/cxfa_widgetdata.h b/xfa/fxfa/parser/cxfa_widgetdata.h index 7e17323ec8..fab11ce235 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.h +++ b/xfa/fxfa/parser/cxfa_widgetdata.h @@ -69,7 +69,7 @@ class CXFA_WidgetData : public CXFA_DataData { CXFA_ValidateData GetValidateData(bool bModified); CXFA_BorderData GetUIBorderData(); - std::vector<CXFA_Node*> GetEventByActivity(XFA_ATTRIBUTEENUM iActivity, + std::vector<CXFA_Node*> GetEventByActivity(XFA_AttributeEnum iActivity, bool bIsFormReady); pdfium::Optional<float> TryWidth(); @@ -79,12 +79,12 @@ class CXFA_WidgetData : public CXFA_DataData { pdfium::Optional<float> TryMaxWidth(); pdfium::Optional<float> TryMaxHeight(); - XFA_ATTRIBUTEENUM GetButtonHighlight(); + XFA_AttributeEnum GetButtonHighlight(); bool HasButtonRollover() const; bool HasButtonDown() const; bool IsCheckButtonRound(); - XFA_ATTRIBUTEENUM GetCheckButtonMark(); + XFA_AttributeEnum GetCheckButtonMark(); float GetCheckButtonSize(); XFA_CHECKSTATE GetCheckState(); diff --git a/xfa/fxfa/parser/xfa_basic_data.h b/xfa/fxfa/parser/xfa_basic_data.h index 60f31ca563..02fbc99392 100644 --- a/xfa/fxfa/parser/xfa_basic_data.h +++ b/xfa/fxfa/parser/xfa_basic_data.h @@ -11,7 +11,7 @@ #include "xfa/fxfa/fxfa_basic.h" -extern const XFA_ATTRIBUTEENUMINFO g_XFAEnumData[]; +extern const XFA_AttributeEnumInfo g_XFAEnumData[]; extern const int32_t g_iXFAEnumCount; extern const XFA_SCRIPTHIERARCHY g_XFAScriptIndex[]; diff --git a/xfa/fxfa/parser/xfa_basic_data_enum.cpp b/xfa/fxfa/parser/xfa_basic_data_enum.cpp index 06cd764e6d..35e6700ef8 100644 --- a/xfa/fxfa/parser/xfa_basic_data_enum.cpp +++ b/xfa/fxfa/parser/xfa_basic_data_enum.cpp @@ -8,274 +8,275 @@ #include "xfa/fxfa/fxfa_basic.h" -const XFA_ATTRIBUTEENUMINFO g_XFAEnumData[] = { - {0x2a, L"*", XFA_ATTRIBUTEENUM_Asterisk}, - {0x2f, L"/", XFA_ATTRIBUTEENUM_Slash}, - {0x5c, L"\\", XFA_ATTRIBUTEENUM_Backslash}, - {0x239bd, L"on", XFA_ATTRIBUTEENUM_On}, - {0x25356, L"tb", XFA_ATTRIBUTEENUM_Tb}, - {0x25885, L"up", XFA_ATTRIBUTEENUM_Up}, - {0x91b281, L"metaData", XFA_ATTRIBUTEENUM_MetaData}, - {0x1f8dedb, L"delegate", XFA_ATTRIBUTEENUM_Delegate}, - {0x2a6c55a, L"postSubmit", XFA_ATTRIBUTEENUM_PostSubmit}, - {0x31b19c1, L"name", XFA_ATTRIBUTEENUM_Name}, - {0x378a38a, L"cross", XFA_ATTRIBUTEENUM_Cross}, - {0x3848b3f, L"next", XFA_ATTRIBUTEENUM_Next}, - {0x48b6670, L"none", XFA_ATTRIBUTEENUM_None}, - {0x51aafe5, L"shortEdge", XFA_ATTRIBUTEENUM_ShortEdge}, - {0x55264c4, L"1mod10_1mod11", XFA_ATTRIBUTEENUM_1mod10_1mod11}, - {0x5a5c519, L"height", XFA_ATTRIBUTEENUM_Height}, - {0x89ce549, L"crossDiagonal", XFA_ATTRIBUTEENUM_CrossDiagonal}, - {0x9f9d0f9, L"all", XFA_ATTRIBUTEENUM_All}, - {0x9f9db48, L"any", XFA_ATTRIBUTEENUM_Any}, - {0xa126261, L"toRight", XFA_ATTRIBUTEENUM_ToRight}, - {0xa36de29, L"matchTemplate", XFA_ATTRIBUTEENUM_MatchTemplate}, - {0xa48d040, L"dpl", XFA_ATTRIBUTEENUM_Dpl}, - {0xa559c05, L"invisible", XFA_ATTRIBUTEENUM_Invisible}, - {0xa7d48e3, L"fit", XFA_ATTRIBUTEENUM_Fit}, - {0xa8a8f80, L"width", XFA_ATTRIBUTEENUM_Width}, - {0xab466bb, L"preSubmit", XFA_ATTRIBUTEENUM_PreSubmit}, - {0xacc5785, L"ipl", XFA_ATTRIBUTEENUM_Ipl}, - {0xafab0f8, L"flateCompress", XFA_ATTRIBUTEENUM_FlateCompress}, - {0xb355816, L"med", XFA_ATTRIBUTEENUM_Med}, - {0xb69ef77, L"odd", XFA_ATTRIBUTEENUM_Odd}, - {0xb69f9bb, L"off", XFA_ATTRIBUTEENUM_Off}, - {0xb843dba, L"pdf", XFA_ATTRIBUTEENUM_Pdf}, - {0xbb912b8, L"row", XFA_ATTRIBUTEENUM_Row}, - {0xbedaf33, L"top", XFA_ATTRIBUTEENUM_Top}, - {0xc56afcc, L"xdp", XFA_ATTRIBUTEENUM_Xdp}, - {0xc56ba02, L"xfd", XFA_ATTRIBUTEENUM_Xfd}, - {0xc56ddf1, L"xml", XFA_ATTRIBUTEENUM_Xml}, - {0xc8b65f3, L"zip", XFA_ATTRIBUTEENUM_Zip}, - {0xc8b89d6, L"zpl", XFA_ATTRIBUTEENUM_Zpl}, - {0xf55d7ee, L"visible", XFA_ATTRIBUTEENUM_Visible}, - {0xfe3596a, L"exclude", XFA_ATTRIBUTEENUM_Exclude}, - {0x109d7ce7, L"mouseEnter", XFA_ATTRIBUTEENUM_MouseEnter}, - {0x10f1bc0c, L"pair", XFA_ATTRIBUTEENUM_Pair}, - {0x1154efe6, L"filter", XFA_ATTRIBUTEENUM_Filter}, - {0x125bc94b, L"moveLast", XFA_ATTRIBUTEENUM_MoveLast}, - {0x12e1f1f0, L"exportAndImport", XFA_ATTRIBUTEENUM_ExportAndImport}, - {0x13000c60, L"push", XFA_ATTRIBUTEENUM_Push}, - {0x138ee315, L"portrait", XFA_ATTRIBUTEENUM_Portrait}, - {0x14da2125, L"default", XFA_ATTRIBUTEENUM_Default}, - {0x157749a5, L"storedProc", XFA_ATTRIBUTEENUM_StoredProc}, - {0x16641198, L"stayBOF", XFA_ATTRIBUTEENUM_StayBOF}, - {0x16b2fc5b, L"stayEOF", XFA_ATTRIBUTEENUM_StayEOF}, - {0x17fad373, L"postPrint", XFA_ATTRIBUTEENUM_PostPrint}, - {0x193207d0, L"usCarrier", XFA_ATTRIBUTEENUM_UsCarrier}, - {0x193ade3e, L"right", XFA_ATTRIBUTEENUM_Right}, - {0x1bfc72d9, L"preOpen", XFA_ATTRIBUTEENUM_PreOpen}, - {0x1cc9317a, L"actual", XFA_ATTRIBUTEENUM_Actual}, - {0x1f31df1e, L"rest", XFA_ATTRIBUTEENUM_Rest}, - {0x1fb1bf14, L"topCenter", XFA_ATTRIBUTEENUM_TopCenter}, - {0x207de667, L"standardSymbol", XFA_ATTRIBUTEENUM_StandardSymbol}, - {0x2196a452, L"initialize", XFA_ATTRIBUTEENUM_Initialize}, - {0x23bd40c7, L"justifyAll", XFA_ATTRIBUTEENUM_JustifyAll}, - {0x247cf3e9, L"normal", XFA_ATTRIBUTEENUM_Normal}, - {0x25aa946b, L"landscape", XFA_ATTRIBUTEENUM_Landscape}, - {0x2739b5c9, L"nonInteractive", XFA_ATTRIBUTEENUM_NonInteractive}, - {0x27410f03, L"mouseExit", XFA_ATTRIBUTEENUM_MouseExit}, - {0x2854e62c, L"minus", XFA_ATTRIBUTEENUM_Minus}, - {0x287e936a, L"diagonalLeft", XFA_ATTRIBUTEENUM_DiagonalLeft}, - {0x2972a98f, L"simplexPaginated", XFA_ATTRIBUTEENUM_SimplexPaginated}, - {0x29d8225f, L"document", XFA_ATTRIBUTEENUM_Document}, - {0x2a9d3016, L"warning", XFA_ATTRIBUTEENUM_Warning}, - {0x2b35b6d9, L"auto", XFA_ATTRIBUTEENUM_Auto}, - {0x2c1653d9, L"below", XFA_ATTRIBUTEENUM_Below}, - {0x2c1f0540, L"bottomLeft", XFA_ATTRIBUTEENUM_BottomLeft}, - {0x2c44e816, L"bottomCenter", XFA_ATTRIBUTEENUM_BottomCenter}, - {0x2cd3e9f3, L"tcpl", XFA_ATTRIBUTEENUM_Tcpl}, - {0x2d08af85, L"text", XFA_ATTRIBUTEENUM_Text}, - {0x2dc478eb, L"grouping", XFA_ATTRIBUTEENUM_Grouping}, - {0x2ef3afdd, L"secureSymbol", XFA_ATTRIBUTEENUM_SecureSymbol}, - {0x2f2dd29a, L"preExecute", XFA_ATTRIBUTEENUM_PreExecute}, - {0x33c43dec, L"docClose", XFA_ATTRIBUTEENUM_DocClose}, - {0x33f25bb5, L"keyset", XFA_ATTRIBUTEENUM_Keyset}, - {0x34e363da, L"vertical", XFA_ATTRIBUTEENUM_Vertical}, - {0x361fa1b6, L"preSave", XFA_ATTRIBUTEENUM_PreSave}, - {0x36f1c6d8, L"preSign", XFA_ATTRIBUTEENUM_PreSign}, - {0x399f02b5, L"bottom", XFA_ATTRIBUTEENUM_Bottom}, - {0x3b0ab096, L"toTop", XFA_ATTRIBUTEENUM_ToTop}, - {0x3c752495, L"verify", XFA_ATTRIBUTEENUM_Verify}, - {0x3ce05d68, L"first", XFA_ATTRIBUTEENUM_First}, - {0x3ecead94, L"contentArea", XFA_ATTRIBUTEENUM_ContentArea}, - {0x40623b5b, L"solid", XFA_ATTRIBUTEENUM_Solid}, - {0x42c6cd8d, L"pessimistic", XFA_ATTRIBUTEENUM_Pessimistic}, - {0x43ddc6bf, L"duplexPaginated", XFA_ATTRIBUTEENUM_DuplexPaginated}, - {0x442f68c8, L"round", XFA_ATTRIBUTEENUM_Round}, - {0x45efb847, L"remerge", XFA_ATTRIBUTEENUM_Remerge}, - {0x46972265, L"ordered", XFA_ATTRIBUTEENUM_Ordered}, - {0x46f95531, L"percent", XFA_ATTRIBUTEENUM_Percent}, - {0x46fd25ae, L"even", XFA_ATTRIBUTEENUM_Even}, - {0x4731d6ba, L"exit", XFA_ATTRIBUTEENUM_Exit}, - {0x4977356b, L"toolTip", XFA_ATTRIBUTEENUM_ToolTip}, - {0x49b980ee, L"orderedOccurrence", XFA_ATTRIBUTEENUM_OrderedOccurrence}, - {0x4a7e2dfe, L"readOnly", XFA_ATTRIBUTEENUM_ReadOnly}, - {0x4c4e8acb, L"currency", XFA_ATTRIBUTEENUM_Currency}, - {0x4dcf25f8, L"concat", XFA_ATTRIBUTEENUM_Concat}, - {0x4febb826, L"Thai", XFA_ATTRIBUTEENUM_Thai}, - {0x50ef95b2, L"embossed", XFA_ATTRIBUTEENUM_Embossed}, - {0x516e35ce, L"formdata", XFA_ATTRIBUTEENUM_Formdata}, - {0x52fa6f0e, L"Greek", XFA_ATTRIBUTEENUM_Greek}, - {0x54034c2f, L"decimal", XFA_ATTRIBUTEENUM_Decimal}, - {0x542c7300, L"select", XFA_ATTRIBUTEENUM_Select}, - {0x551f0ae5, L"longEdge", XFA_ATTRIBUTEENUM_LongEdge}, - {0x55520a8a, L"protected", XFA_ATTRIBUTEENUM_Protected}, - {0x559f76f3, L"bottomRight", XFA_ATTRIBUTEENUM_BottomRight}, - {0x568cb500, L"zero", XFA_ATTRIBUTEENUM_Zero}, - {0x56bcecb7, L"forwardOnly", XFA_ATTRIBUTEENUM_ForwardOnly}, - {0x56bf456b, L"docReady", XFA_ATTRIBUTEENUM_DocReady}, - {0x573cb40c, L"hidden", XFA_ATTRIBUTEENUM_Hidden}, - {0x582e3424, L"include", XFA_ATTRIBUTEENUM_Include}, - {0x58a3dd29, L"dashed", XFA_ATTRIBUTEENUM_Dashed}, - {0x5955b22b, L"multiSelect", XFA_ATTRIBUTEENUM_MultiSelect}, - {0x598d5c53, L"inactive", XFA_ATTRIBUTEENUM_Inactive}, - {0x59c8f27d, L"embed", XFA_ATTRIBUTEENUM_Embed}, - {0x5e7555e8, L"static", XFA_ATTRIBUTEENUM_Static}, - {0x606d4def, L"onEntry", XFA_ATTRIBUTEENUM_OnEntry}, - {0x6195eafb, L"Cyrillic", XFA_ATTRIBUTEENUM_Cyrillic}, - {0x6491b0f3, L"nonBlank", XFA_ATTRIBUTEENUM_NonBlank}, - {0x67bef031, L"topRight", XFA_ATTRIBUTEENUM_TopRight}, - {0x67df5ebd, L"Hebrew", XFA_ATTRIBUTEENUM_Hebrew}, - {0x6aea98be, L"topLeft", XFA_ATTRIBUTEENUM_TopLeft}, - {0x6c51afc1, L"center", XFA_ATTRIBUTEENUM_Center}, - {0x7145e6bf, L"moveFirst", XFA_ATTRIBUTEENUM_MoveFirst}, - {0x7375465c, L"diamond", XFA_ATTRIBUTEENUM_Diamond}, - {0x7461aef4, L"pageOdd", XFA_ATTRIBUTEENUM_PageOdd}, - {0x75f8aeb2, L"1mod10", XFA_ATTRIBUTEENUM_1mod10}, - {0x76d708e0, L"Korean", XFA_ATTRIBUTEENUM_Korean}, - {0x789f14d7, L"aboveEmbedded", XFA_ATTRIBUTEENUM_AboveEmbedded}, - {0x792ea39f, L"zipCompress", XFA_ATTRIBUTEENUM_ZipCompress}, - {0x7a5b7193, L"numeric", XFA_ATTRIBUTEENUM_Numeric}, - {0x7abec0d2, L"circle", XFA_ATTRIBUTEENUM_Circle}, - {0x7afbba38, L"toBottom", XFA_ATTRIBUTEENUM_ToBottom}, - {0x7b95e661, L"inverted", XFA_ATTRIBUTEENUM_Inverted}, - {0x7baca2e3, L"update", XFA_ATTRIBUTEENUM_Update}, - {0x7eb5da2c, L"isoname", XFA_ATTRIBUTEENUM_Isoname}, - {0x7f6fd3d7, L"server", XFA_ATTRIBUTEENUM_Server}, - {0x814f82b5, L"position", XFA_ATTRIBUTEENUM_Position}, - {0x82deacf0, L"middleCenter", XFA_ATTRIBUTEENUM_MiddleCenter}, - {0x83a49dc6, L"optional", XFA_ATTRIBUTEENUM_Optional}, - {0x861a116f, L"usePrinterSetting", XFA_ATTRIBUTEENUM_UsePrinterSetting}, - {0x86701ce0, L"outline", XFA_ATTRIBUTEENUM_Outline}, - {0x8808385e, L"indexChange", XFA_ATTRIBUTEENUM_IndexChange}, - {0x891f4606, L"change", XFA_ATTRIBUTEENUM_Change}, - {0x89939f36, L"pageArea", XFA_ATTRIBUTEENUM_PageArea}, - {0x8b5c3b25, L"once", XFA_ATTRIBUTEENUM_Once}, - {0x8b5c6962, L"only", XFA_ATTRIBUTEENUM_Only}, - {0x8b90e1f2, L"open", XFA_ATTRIBUTEENUM_Open}, - {0x8bcfe96e, L"caption", XFA_ATTRIBUTEENUM_Caption}, - {0x8ce83ef8, L"raised", XFA_ATTRIBUTEENUM_Raised}, - {0x8d269cae, L"justify", XFA_ATTRIBUTEENUM_Justify}, - {0x8fd520dc, L"refAndDescendants", XFA_ATTRIBUTEENUM_RefAndDescendants}, - {0x9041d4b0, L"short", XFA_ATTRIBUTEENUM_Short}, - {0x90c94426, L"pageFront", XFA_ATTRIBUTEENUM_PageFront}, - {0x936beee5, L"monospace", XFA_ATTRIBUTEENUM_Monospace}, - {0x947fa00f, L"middle", XFA_ATTRIBUTEENUM_Middle}, - {0x9528a7b4, L"prePrint", XFA_ATTRIBUTEENUM_PrePrint}, - {0x959ab231, L"always", XFA_ATTRIBUTEENUM_Always}, - {0x96d61bf0, L"unknown", XFA_ATTRIBUTEENUM_Unknown}, - {0x997194ee, L"toLeft", XFA_ATTRIBUTEENUM_ToLeft}, - {0x9a83a3cd, L"above", XFA_ATTRIBUTEENUM_Above}, - {0x9d0d71c7, L"dashDot", XFA_ATTRIBUTEENUM_DashDot}, - {0x9df56f3e, L"gregorian", XFA_ATTRIBUTEENUM_Gregorian}, - {0x9f6723fd, L"Roman", XFA_ATTRIBUTEENUM_Roman}, - {0x9f693b21, L"mouseDown", XFA_ATTRIBUTEENUM_MouseDown}, - {0xa1429b36, L"symbol", XFA_ATTRIBUTEENUM_Symbol}, - {0xa5aa45cb, L"pageEven", XFA_ATTRIBUTEENUM_PageEven}, - {0xa68635f1, L"sign", XFA_ATTRIBUTEENUM_Sign}, - {0xa7315093, L"addNew", XFA_ATTRIBUTEENUM_AddNew}, - {0xa7a773fa, L"star", XFA_ATTRIBUTEENUM_Star}, - {0xa7d57b45, L"optimistic", XFA_ATTRIBUTEENUM_Optimistic}, - {0xa8077321, L"rl-tb", XFA_ATTRIBUTEENUM_Rl_tb}, - {0xa8f1468d, L"middleRight", XFA_ATTRIBUTEENUM_MiddleRight}, - {0xaa84a1f1, L"maintain", XFA_ATTRIBUTEENUM_Maintain}, - {0xab40b12c, L"package", XFA_ATTRIBUTEENUM_Package}, - {0xac8b4d85, L"SimplifiedChinese", XFA_ATTRIBUTEENUM_SimplifiedChinese}, - {0xadae6744, L"toCenter", XFA_ATTRIBUTEENUM_ToCenter}, - {0xb0129df1, L"back", XFA_ATTRIBUTEENUM_Back}, - {0xb0f088cf, L"unspecified", XFA_ATTRIBUTEENUM_Unspecified}, - {0xb1271067, L"batchOptimistic", XFA_ATTRIBUTEENUM_BatchOptimistic}, - {0xb18313a1, L"bold", XFA_ATTRIBUTEENUM_Bold}, - {0xb1833cad, L"both", XFA_ATTRIBUTEENUM_Both}, - {0xb221123f, L"butt", XFA_ATTRIBUTEENUM_Butt}, - {0xb40c36bf, L"client", XFA_ATTRIBUTEENUM_Client}, - {0xb56c7053, L"2mod10", XFA_ATTRIBUTEENUM_2mod10}, - {0xb683a345, L"imageOnly", XFA_ATTRIBUTEENUM_ImageOnly}, - {0xb7732dea, L"horizontal", XFA_ATTRIBUTEENUM_Horizontal}, - {0xb88652a4, L"dotted", XFA_ATTRIBUTEENUM_Dotted}, - {0xbb2f2880, L"userControl", XFA_ATTRIBUTEENUM_UserControl}, - {0xbbb79c5d, L"diagonalRight", XFA_ATTRIBUTEENUM_DiagonalRight}, - {0xbd077154, L"consumeData", XFA_ATTRIBUTEENUM_ConsumeData}, - {0xbd3fb11e, L"check", XFA_ATTRIBUTEENUM_Check}, - {0xbde9abda, L"data", XFA_ATTRIBUTEENUM_Data}, - {0xbf5a02d8, L"down", XFA_ATTRIBUTEENUM_Down}, - {0xbf7450ee, L"sansSerif", XFA_ATTRIBUTEENUM_SansSerif}, - {0xc02d649f, L"inline", XFA_ATTRIBUTEENUM_Inline}, - {0xc11a9e3a, L"TraditionalChinese", XFA_ATTRIBUTEENUM_TraditionalChinese}, - {0xc16169d8, L"warn", XFA_ATTRIBUTEENUM_Warn}, - {0xc16f071f, L"refOnly", XFA_ATTRIBUTEENUM_RefOnly}, - {0xc27c8ba5, L"interactiveForms", XFA_ATTRIBUTEENUM_InteractiveForms}, - {0xc2d1b15c, L"word", XFA_ATTRIBUTEENUM_Word}, - {0xc3621288, L"unordered", XFA_ATTRIBUTEENUM_Unordered}, - {0xc5251981, L"required", XFA_ATTRIBUTEENUM_Required}, - {0xc7088e7d, L"importOnly", XFA_ATTRIBUTEENUM_ImportOnly}, - {0xc72cf0e3, L"belowEmbedded", XFA_ATTRIBUTEENUM_BelowEmbedded}, - {0xc819cf07, L"Japanese", XFA_ATTRIBUTEENUM_Japanese}, - {0xcdce56b3, L"full", XFA_ATTRIBUTEENUM_Full}, - {0xce0122e3, L"rl-row", XFA_ATTRIBUTEENUM_Rl_row}, - {0xcf7d71f1, L"Vietnamese", XFA_ATTRIBUTEENUM_Vietnamese}, - {0xcfde3e09, L"EastEuropeanRoman", XFA_ATTRIBUTEENUM_EastEuropeanRoman}, - {0xd576d08e, L"mouseUp", XFA_ATTRIBUTEENUM_MouseUp}, - {0xd7a92904, L"exportOnly", XFA_ATTRIBUTEENUM_ExportOnly}, - {0xd8ed1467, L"clear", XFA_ATTRIBUTEENUM_Clear}, - {0xd95657a6, L"click", XFA_ATTRIBUTEENUM_Click}, - {0xd96c7de5, L"base64", XFA_ATTRIBUTEENUM_Base64}, - {0xd9f47f36, L"close", XFA_ATTRIBUTEENUM_Close}, - {0xdb075bde, L"host", XFA_ATTRIBUTEENUM_Host}, - {0xdb103411, L"global", XFA_ATTRIBUTEENUM_Global}, - {0xdb647188, L"blank", XFA_ATTRIBUTEENUM_Blank}, - {0xdb9be968, L"table", XFA_ATTRIBUTEENUM_Table}, - {0xdf590fbb, L"import", XFA_ATTRIBUTEENUM_Import}, - {0xe0e573fb, L"custom", XFA_ATTRIBUTEENUM_Custom}, - {0xe0ecc79a, L"middleLeft", XFA_ATTRIBUTEENUM_MiddleLeft}, - {0xe1452019, L"postExecute", XFA_ATTRIBUTEENUM_PostExecute}, - {0xe1911d98, L"radix", XFA_ATTRIBUTEENUM_Radix}, - {0xe25fa7b8, L"postOpen", XFA_ATTRIBUTEENUM_PostOpen}, - {0xe28dce7e, L"enter", XFA_ATTRIBUTEENUM_Enter}, - {0xe2c44de4, L"ignore", XFA_ATTRIBUTEENUM_Ignore}, - {0xe2cd8c61, L"lr-tb", XFA_ATTRIBUTEENUM_Lr_tb}, - {0xe2da8336, L"fantasy", XFA_ATTRIBUTEENUM_Fantasy}, - {0xe31d5396, L"italic", XFA_ATTRIBUTEENUM_Italic}, - {0xe7ada113, L"author", XFA_ATTRIBUTEENUM_Author}, - {0xe8e7cc18, L"toEdge", XFA_ATTRIBUTEENUM_ToEdge}, - {0xe97aa98b, L"choice", XFA_ATTRIBUTEENUM_Choice}, - {0xeafd2a38, L"disabled", XFA_ATTRIBUTEENUM_Disabled}, - {0xeb2b7972, L"crossHatch", XFA_ATTRIBUTEENUM_CrossHatch}, - {0xeb2db2d7, L"dataRef", XFA_ATTRIBUTEENUM_DataRef}, - {0xec35dc6e, L"dashDotDot", XFA_ATTRIBUTEENUM_DashDotDot}, - {0xef85d351, L"square", XFA_ATTRIBUTEENUM_Square}, - {0xf2102445, L"dynamic", XFA_ATTRIBUTEENUM_Dynamic}, - {0xf272c7be, L"manual", XFA_ATTRIBUTEENUM_Manual}, - {0xf2bbb64d, L"etched", XFA_ATTRIBUTEENUM_Etched}, - {0xf3b8fc6c, L"validationState", XFA_ATTRIBUTEENUM_ValidationState}, - {0xf42f2b81, L"cursive", XFA_ATTRIBUTEENUM_Cursive}, - {0xf54481d4, L"last", XFA_ATTRIBUTEENUM_Last}, - {0xf5ad782b, L"left", XFA_ATTRIBUTEENUM_Left}, - {0xf616da2e, L"link", XFA_ATTRIBUTEENUM_Link}, - {0xf6b4afb0, L"long", XFA_ATTRIBUTEENUM_Long}, +const XFA_AttributeEnumInfo g_XFAEnumData[] = { + {0x2a, L"*", XFA_AttributeEnum::Asterisk}, + {0x2f, L"/", XFA_AttributeEnum::Slash}, + {0x5c, L"\\", XFA_AttributeEnum::Backslash}, + {0x239bd, L"on", XFA_AttributeEnum::On}, + {0x25356, L"tb", XFA_AttributeEnum::Tb}, + {0x25885, L"up", XFA_AttributeEnum::Up}, + {0x91b281, L"metaData", XFA_AttributeEnum::MetaData}, + {0x1f8dedb, L"delegate", XFA_AttributeEnum::Delegate}, + {0x2a6c55a, L"postSubmit", XFA_AttributeEnum::PostSubmit}, + {0x31b19c1, L"name", XFA_AttributeEnum::Name}, + {0x378a38a, L"cross", XFA_AttributeEnum::Cross}, + {0x3848b3f, L"next", XFA_AttributeEnum::Next}, + {0x48b6670, L"none", XFA_AttributeEnum::None}, + {0x51aafe5, L"shortEdge", XFA_AttributeEnum::ShortEdge}, + {0x55264c4, L"Checksum_1mod10_1mod11", + XFA_AttributeEnum::Checksum_1mod10_1mod11}, + {0x5a5c519, L"height", XFA_AttributeEnum::Height}, + {0x89ce549, L"crossDiagonal", XFA_AttributeEnum::CrossDiagonal}, + {0x9f9d0f9, L"all", XFA_AttributeEnum::All}, + {0x9f9db48, L"any", XFA_AttributeEnum::Any}, + {0xa126261, L"toRight", XFA_AttributeEnum::ToRight}, + {0xa36de29, L"matchTemplate", XFA_AttributeEnum::MatchTemplate}, + {0xa48d040, L"dpl", XFA_AttributeEnum::Dpl}, + {0xa559c05, L"invisible", XFA_AttributeEnum::Invisible}, + {0xa7d48e3, L"fit", XFA_AttributeEnum::Fit}, + {0xa8a8f80, L"width", XFA_AttributeEnum::Width}, + {0xab466bb, L"preSubmit", XFA_AttributeEnum::PreSubmit}, + {0xacc5785, L"ipl", XFA_AttributeEnum::Ipl}, + {0xafab0f8, L"flateCompress", XFA_AttributeEnum::FlateCompress}, + {0xb355816, L"med", XFA_AttributeEnum::Med}, + {0xb69ef77, L"odd", XFA_AttributeEnum::Odd}, + {0xb69f9bb, L"off", XFA_AttributeEnum::Off}, + {0xb843dba, L"pdf", XFA_AttributeEnum::Pdf}, + {0xbb912b8, L"row", XFA_AttributeEnum::Row}, + {0xbedaf33, L"top", XFA_AttributeEnum::Top}, + {0xc56afcc, L"xdp", XFA_AttributeEnum::Xdp}, + {0xc56ba02, L"xfd", XFA_AttributeEnum::Xfd}, + {0xc56ddf1, L"xml", XFA_AttributeEnum::Xml}, + {0xc8b65f3, L"zip", XFA_AttributeEnum::Zip}, + {0xc8b89d6, L"zpl", XFA_AttributeEnum::Zpl}, + {0xf55d7ee, L"visible", XFA_AttributeEnum::Visible}, + {0xfe3596a, L"exclude", XFA_AttributeEnum::Exclude}, + {0x109d7ce7, L"mouseEnter", XFA_AttributeEnum::MouseEnter}, + {0x10f1bc0c, L"pair", XFA_AttributeEnum::Pair}, + {0x1154efe6, L"filter", XFA_AttributeEnum::Filter}, + {0x125bc94b, L"moveLast", XFA_AttributeEnum::MoveLast}, + {0x12e1f1f0, L"exportAndImport", XFA_AttributeEnum::ExportAndImport}, + {0x13000c60, L"push", XFA_AttributeEnum::Push}, + {0x138ee315, L"portrait", XFA_AttributeEnum::Portrait}, + {0x14da2125, L"default", XFA_AttributeEnum::Default}, + {0x157749a5, L"storedProc", XFA_AttributeEnum::StoredProc}, + {0x16641198, L"stayBOF", XFA_AttributeEnum::StayBOF}, + {0x16b2fc5b, L"stayEOF", XFA_AttributeEnum::StayEOF}, + {0x17fad373, L"postPrint", XFA_AttributeEnum::PostPrint}, + {0x193207d0, L"usCarrier", XFA_AttributeEnum::UsCarrier}, + {0x193ade3e, L"right", XFA_AttributeEnum::Right}, + {0x1bfc72d9, L"preOpen", XFA_AttributeEnum::PreOpen}, + {0x1cc9317a, L"actual", XFA_AttributeEnum::Actual}, + {0x1f31df1e, L"rest", XFA_AttributeEnum::Rest}, + {0x1fb1bf14, L"topCenter", XFA_AttributeEnum::TopCenter}, + {0x207de667, L"standardSymbol", XFA_AttributeEnum::StandardSymbol}, + {0x2196a452, L"initialize", XFA_AttributeEnum::Initialize}, + {0x23bd40c7, L"justifyAll", XFA_AttributeEnum::JustifyAll}, + {0x247cf3e9, L"normal", XFA_AttributeEnum::Normal}, + {0x25aa946b, L"landscape", XFA_AttributeEnum::Landscape}, + {0x2739b5c9, L"nonInteractive", XFA_AttributeEnum::NonInteractive}, + {0x27410f03, L"mouseExit", XFA_AttributeEnum::MouseExit}, + {0x2854e62c, L"minus", XFA_AttributeEnum::Minus}, + {0x287e936a, L"diagonalLeft", XFA_AttributeEnum::DiagonalLeft}, + {0x2972a98f, L"simplexPaginated", XFA_AttributeEnum::SimplexPaginated}, + {0x29d8225f, L"document", XFA_AttributeEnum::Document}, + {0x2a9d3016, L"warning", XFA_AttributeEnum::Warning}, + {0x2b35b6d9, L"auto", XFA_AttributeEnum::Auto}, + {0x2c1653d9, L"below", XFA_AttributeEnum::Below}, + {0x2c1f0540, L"bottomLeft", XFA_AttributeEnum::BottomLeft}, + {0x2c44e816, L"bottomCenter", XFA_AttributeEnum::BottomCenter}, + {0x2cd3e9f3, L"tcpl", XFA_AttributeEnum::Tcpl}, + {0x2d08af85, L"text", XFA_AttributeEnum::Text}, + {0x2dc478eb, L"grouping", XFA_AttributeEnum::Grouping}, + {0x2ef3afdd, L"secureSymbol", XFA_AttributeEnum::SecureSymbol}, + {0x2f2dd29a, L"preExecute", XFA_AttributeEnum::PreExecute}, + {0x33c43dec, L"docClose", XFA_AttributeEnum::DocClose}, + {0x33f25bb5, L"keyset", XFA_AttributeEnum::Keyset}, + {0x34e363da, L"vertical", XFA_AttributeEnum::Vertical}, + {0x361fa1b6, L"preSave", XFA_AttributeEnum::PreSave}, + {0x36f1c6d8, L"preSign", XFA_AttributeEnum::PreSign}, + {0x399f02b5, L"bottom", XFA_AttributeEnum::Bottom}, + {0x3b0ab096, L"toTop", XFA_AttributeEnum::ToTop}, + {0x3c752495, L"verify", XFA_AttributeEnum::Verify}, + {0x3ce05d68, L"first", XFA_AttributeEnum::First}, + {0x3ecead94, L"contentArea", XFA_AttributeEnum::ContentArea}, + {0x40623b5b, L"solid", XFA_AttributeEnum::Solid}, + {0x42c6cd8d, L"pessimistic", XFA_AttributeEnum::Pessimistic}, + {0x43ddc6bf, L"duplexPaginated", XFA_AttributeEnum::DuplexPaginated}, + {0x442f68c8, L"round", XFA_AttributeEnum::Round}, + {0x45efb847, L"remerge", XFA_AttributeEnum::Remerge}, + {0x46972265, L"ordered", XFA_AttributeEnum::Ordered}, + {0x46f95531, L"percent", XFA_AttributeEnum::Percent}, + {0x46fd25ae, L"even", XFA_AttributeEnum::Even}, + {0x4731d6ba, L"exit", XFA_AttributeEnum::Exit}, + {0x4977356b, L"toolTip", XFA_AttributeEnum::ToolTip}, + {0x49b980ee, L"orderedOccurrence", XFA_AttributeEnum::OrderedOccurrence}, + {0x4a7e2dfe, L"readOnly", XFA_AttributeEnum::ReadOnly}, + {0x4c4e8acb, L"currency", XFA_AttributeEnum::Currency}, + {0x4dcf25f8, L"concat", XFA_AttributeEnum::Concat}, + {0x4febb826, L"Thai", XFA_AttributeEnum::Thai}, + {0x50ef95b2, L"embossed", XFA_AttributeEnum::Embossed}, + {0x516e35ce, L"formdata", XFA_AttributeEnum::Formdata}, + {0x52fa6f0e, L"Greek", XFA_AttributeEnum::Greek}, + {0x54034c2f, L"decimal", XFA_AttributeEnum::Decimal}, + {0x542c7300, L"select", XFA_AttributeEnum::Select}, + {0x551f0ae5, L"longEdge", XFA_AttributeEnum::LongEdge}, + {0x55520a8a, L"protected", XFA_AttributeEnum::Protected}, + {0x559f76f3, L"bottomRight", XFA_AttributeEnum::BottomRight}, + {0x568cb500, L"zero", XFA_AttributeEnum::Zero}, + {0x56bcecb7, L"forwardOnly", XFA_AttributeEnum::ForwardOnly}, + {0x56bf456b, L"docReady", XFA_AttributeEnum::DocReady}, + {0x573cb40c, L"hidden", XFA_AttributeEnum::Hidden}, + {0x582e3424, L"include", XFA_AttributeEnum::Include}, + {0x58a3dd29, L"dashed", XFA_AttributeEnum::Dashed}, + {0x5955b22b, L"multiSelect", XFA_AttributeEnum::MultiSelect}, + {0x598d5c53, L"inactive", XFA_AttributeEnum::Inactive}, + {0x59c8f27d, L"embed", XFA_AttributeEnum::Embed}, + {0x5e7555e8, L"static", XFA_AttributeEnum::Static}, + {0x606d4def, L"onEntry", XFA_AttributeEnum::OnEntry}, + {0x6195eafb, L"Cyrillic", XFA_AttributeEnum::Cyrillic}, + {0x6491b0f3, L"nonBlank", XFA_AttributeEnum::NonBlank}, + {0x67bef031, L"topRight", XFA_AttributeEnum::TopRight}, + {0x67df5ebd, L"Hebrew", XFA_AttributeEnum::Hebrew}, + {0x6aea98be, L"topLeft", XFA_AttributeEnum::TopLeft}, + {0x6c51afc1, L"center", XFA_AttributeEnum::Center}, + {0x7145e6bf, L"moveFirst", XFA_AttributeEnum::MoveFirst}, + {0x7375465c, L"diamond", XFA_AttributeEnum::Diamond}, + {0x7461aef4, L"pageOdd", XFA_AttributeEnum::PageOdd}, + {0x75f8aeb2, L"Checksum_1mod10", XFA_AttributeEnum::Checksum_1mod10}, + {0x76d708e0, L"Korean", XFA_AttributeEnum::Korean}, + {0x789f14d7, L"aboveEmbedded", XFA_AttributeEnum::AboveEmbedded}, + {0x792ea39f, L"zipCompress", XFA_AttributeEnum::ZipCompress}, + {0x7a5b7193, L"numeric", XFA_AttributeEnum::Numeric}, + {0x7abec0d2, L"circle", XFA_AttributeEnum::Circle}, + {0x7afbba38, L"toBottom", XFA_AttributeEnum::ToBottom}, + {0x7b95e661, L"inverted", XFA_AttributeEnum::Inverted}, + {0x7baca2e3, L"update", XFA_AttributeEnum::Update}, + {0x7eb5da2c, L"isoname", XFA_AttributeEnum::Isoname}, + {0x7f6fd3d7, L"server", XFA_AttributeEnum::Server}, + {0x814f82b5, L"position", XFA_AttributeEnum::Position}, + {0x82deacf0, L"middleCenter", XFA_AttributeEnum::MiddleCenter}, + {0x83a49dc6, L"optional", XFA_AttributeEnum::Optional}, + {0x861a116f, L"usePrinterSetting", XFA_AttributeEnum::UsePrinterSetting}, + {0x86701ce0, L"outline", XFA_AttributeEnum::Outline}, + {0x8808385e, L"indexChange", XFA_AttributeEnum::IndexChange}, + {0x891f4606, L"change", XFA_AttributeEnum::Change}, + {0x89939f36, L"pageArea", XFA_AttributeEnum::PageArea}, + {0x8b5c3b25, L"once", XFA_AttributeEnum::Once}, + {0x8b5c6962, L"only", XFA_AttributeEnum::Only}, + {0x8b90e1f2, L"open", XFA_AttributeEnum::Open}, + {0x8bcfe96e, L"caption", XFA_AttributeEnum::Caption}, + {0x8ce83ef8, L"raised", XFA_AttributeEnum::Raised}, + {0x8d269cae, L"justify", XFA_AttributeEnum::Justify}, + {0x8fd520dc, L"refAndDescendants", XFA_AttributeEnum::RefAndDescendants}, + {0x9041d4b0, L"short", XFA_AttributeEnum::Short}, + {0x90c94426, L"pageFront", XFA_AttributeEnum::PageFront}, + {0x936beee5, L"monospace", XFA_AttributeEnum::Monospace}, + {0x947fa00f, L"middle", XFA_AttributeEnum::Middle}, + {0x9528a7b4, L"prePrint", XFA_AttributeEnum::PrePrint}, + {0x959ab231, L"always", XFA_AttributeEnum::Always}, + {0x96d61bf0, L"unknown", XFA_AttributeEnum::Unknown}, + {0x997194ee, L"toLeft", XFA_AttributeEnum::ToLeft}, + {0x9a83a3cd, L"above", XFA_AttributeEnum::Above}, + {0x9d0d71c7, L"dashDot", XFA_AttributeEnum::DashDot}, + {0x9df56f3e, L"gregorian", XFA_AttributeEnum::Gregorian}, + {0x9f6723fd, L"Roman", XFA_AttributeEnum::Roman}, + {0x9f693b21, L"mouseDown", XFA_AttributeEnum::MouseDown}, + {0xa1429b36, L"symbol", XFA_AttributeEnum::Symbol}, + {0xa5aa45cb, L"pageEven", XFA_AttributeEnum::PageEven}, + {0xa68635f1, L"sign", XFA_AttributeEnum::Sign}, + {0xa7315093, L"addNew", XFA_AttributeEnum::AddNew}, + {0xa7a773fa, L"star", XFA_AttributeEnum::Star}, + {0xa7d57b45, L"optimistic", XFA_AttributeEnum::Optimistic}, + {0xa8077321, L"rl-tb", XFA_AttributeEnum::Rl_tb}, + {0xa8f1468d, L"middleRight", XFA_AttributeEnum::MiddleRight}, + {0xaa84a1f1, L"maintain", XFA_AttributeEnum::Maintain}, + {0xab40b12c, L"package", XFA_AttributeEnum::Package}, + {0xac8b4d85, L"SimplifiedChinese", XFA_AttributeEnum::SimplifiedChinese}, + {0xadae6744, L"toCenter", XFA_AttributeEnum::ToCenter}, + {0xb0129df1, L"back", XFA_AttributeEnum::Back}, + {0xb0f088cf, L"unspecified", XFA_AttributeEnum::Unspecified}, + {0xb1271067, L"batchOptimistic", XFA_AttributeEnum::BatchOptimistic}, + {0xb18313a1, L"bold", XFA_AttributeEnum::Bold}, + {0xb1833cad, L"both", XFA_AttributeEnum::Both}, + {0xb221123f, L"butt", XFA_AttributeEnum::Butt}, + {0xb40c36bf, L"client", XFA_AttributeEnum::Client}, + {0xb56c7053, L"Checksum_2mod10", XFA_AttributeEnum::Checksum_2mod10}, + {0xb683a345, L"imageOnly", XFA_AttributeEnum::ImageOnly}, + {0xb7732dea, L"horizontal", XFA_AttributeEnum::Horizontal}, + {0xb88652a4, L"dotted", XFA_AttributeEnum::Dotted}, + {0xbb2f2880, L"userControl", XFA_AttributeEnum::UserControl}, + {0xbbb79c5d, L"diagonalRight", XFA_AttributeEnum::DiagonalRight}, + {0xbd077154, L"consumeData", XFA_AttributeEnum::ConsumeData}, + {0xbd3fb11e, L"check", XFA_AttributeEnum::Check}, + {0xbde9abda, L"data", XFA_AttributeEnum::Data}, + {0xbf5a02d8, L"down", XFA_AttributeEnum::Down}, + {0xbf7450ee, L"sansSerif", XFA_AttributeEnum::SansSerif}, + {0xc02d649f, L"inline", XFA_AttributeEnum::Inline}, + {0xc11a9e3a, L"TraditionalChinese", XFA_AttributeEnum::TraditionalChinese}, + {0xc16169d8, L"warn", XFA_AttributeEnum::Warn}, + {0xc16f071f, L"refOnly", XFA_AttributeEnum::RefOnly}, + {0xc27c8ba5, L"interactiveForms", XFA_AttributeEnum::InteractiveForms}, + {0xc2d1b15c, L"word", XFA_AttributeEnum::Word}, + {0xc3621288, L"unordered", XFA_AttributeEnum::Unordered}, + {0xc5251981, L"required", XFA_AttributeEnum::Required}, + {0xc7088e7d, L"importOnly", XFA_AttributeEnum::ImportOnly}, + {0xc72cf0e3, L"belowEmbedded", XFA_AttributeEnum::BelowEmbedded}, + {0xc819cf07, L"Japanese", XFA_AttributeEnum::Japanese}, + {0xcdce56b3, L"full", XFA_AttributeEnum::Full}, + {0xce0122e3, L"rl-row", XFA_AttributeEnum::Rl_row}, + {0xcf7d71f1, L"Vietnamese", XFA_AttributeEnum::Vietnamese}, + {0xcfde3e09, L"EastEuropeanRoman", XFA_AttributeEnum::EastEuropeanRoman}, + {0xd576d08e, L"mouseUp", XFA_AttributeEnum::MouseUp}, + {0xd7a92904, L"exportOnly", XFA_AttributeEnum::ExportOnly}, + {0xd8ed1467, L"clear", XFA_AttributeEnum::Clear}, + {0xd95657a6, L"click", XFA_AttributeEnum::Click}, + {0xd96c7de5, L"base64", XFA_AttributeEnum::Base64}, + {0xd9f47f36, L"close", XFA_AttributeEnum::Close}, + {0xdb075bde, L"host", XFA_AttributeEnum::Host}, + {0xdb103411, L"global", XFA_AttributeEnum::Global}, + {0xdb647188, L"blank", XFA_AttributeEnum::Blank}, + {0xdb9be968, L"table", XFA_AttributeEnum::Table}, + {0xdf590fbb, L"import", XFA_AttributeEnum::Import}, + {0xe0e573fb, L"custom", XFA_AttributeEnum::Custom}, + {0xe0ecc79a, L"middleLeft", XFA_AttributeEnum::MiddleLeft}, + {0xe1452019, L"postExecute", XFA_AttributeEnum::PostExecute}, + {0xe1911d98, L"radix", XFA_AttributeEnum::Radix}, + {0xe25fa7b8, L"postOpen", XFA_AttributeEnum::PostOpen}, + {0xe28dce7e, L"enter", XFA_AttributeEnum::Enter}, + {0xe2c44de4, L"ignore", XFA_AttributeEnum::Ignore}, + {0xe2cd8c61, L"lr-tb", XFA_AttributeEnum::Lr_tb}, + {0xe2da8336, L"fantasy", XFA_AttributeEnum::Fantasy}, + {0xe31d5396, L"italic", XFA_AttributeEnum::Italic}, + {0xe7ada113, L"author", XFA_AttributeEnum::Author}, + {0xe8e7cc18, L"toEdge", XFA_AttributeEnum::ToEdge}, + {0xe97aa98b, L"choice", XFA_AttributeEnum::Choice}, + {0xeafd2a38, L"disabled", XFA_AttributeEnum::Disabled}, + {0xeb2b7972, L"crossHatch", XFA_AttributeEnum::CrossHatch}, + {0xeb2db2d7, L"dataRef", XFA_AttributeEnum::DataRef}, + {0xec35dc6e, L"dashDotDot", XFA_AttributeEnum::DashDotDot}, + {0xef85d351, L"square", XFA_AttributeEnum::Square}, + {0xf2102445, L"dynamic", XFA_AttributeEnum::Dynamic}, + {0xf272c7be, L"manual", XFA_AttributeEnum::Manual}, + {0xf2bbb64d, L"etched", XFA_AttributeEnum::Etched}, + {0xf3b8fc6c, L"validationState", XFA_AttributeEnum::ValidationState}, + {0xf42f2b81, L"cursive", XFA_AttributeEnum::Cursive}, + {0xf54481d4, L"last", XFA_AttributeEnum::Last}, + {0xf5ad782b, L"left", XFA_AttributeEnum::Left}, + {0xf616da2e, L"link", XFA_AttributeEnum::Link}, + {0xf6b4afb0, L"long", XFA_AttributeEnum::Long}, {0xf8636460, L"internationalCarrier", - XFA_ATTRIBUTEENUM_InternationalCarrier}, - {0xf9fb37ac, L"PDF1.3", XFA_ATTRIBUTEENUM_PDF1_3}, - {0xf9fb37af, L"PDF1.6", XFA_ATTRIBUTEENUM_PDF1_6}, - {0xfbce7f19, L"serif", XFA_ATTRIBUTEENUM_Serif}, - {0xfc82d695, L"postSave", XFA_ATTRIBUTEENUM_PostSave}, - {0xfcef86b5, L"ready", XFA_ATTRIBUTEENUM_Ready}, - {0xfd54fbb7, L"postSign", XFA_ATTRIBUTEENUM_PostSign}, - {0xfdc0aae2, L"Arabic", XFA_ATTRIBUTEENUM_Arabic}, - {0xfe06d2ca, L"error", XFA_ATTRIBUTEENUM_Error}, - {0xfefc4885, L"urlencoded", XFA_ATTRIBUTEENUM_Urlencoded}, - {0xff795ad2, L"lowered", XFA_ATTRIBUTEENUM_Lowered}, + XFA_AttributeEnum::InternationalCarrier}, + {0xf9fb37ac, L"PDF1.3", XFA_AttributeEnum::PDF1_3}, + {0xf9fb37af, L"PDF1.6", XFA_AttributeEnum::PDF1_6}, + {0xfbce7f19, L"serif", XFA_AttributeEnum::Serif}, + {0xfc82d695, L"postSave", XFA_AttributeEnum::PostSave}, + {0xfcef86b5, L"ready", XFA_AttributeEnum::Ready}, + {0xfd54fbb7, L"postSign", XFA_AttributeEnum::PostSign}, + {0xfdc0aae2, L"Arabic", XFA_AttributeEnum::Arabic}, + {0xfe06d2ca, L"error", XFA_AttributeEnum::Error}, + {0xfefc4885, L"urlencoded", XFA_AttributeEnum::Urlencoded}, + {0xff795ad2, L"lowered", XFA_AttributeEnum::Lowered}, }; const int32_t g_iXFAEnumCount = - sizeof(g_XFAEnumData) / sizeof(XFA_ATTRIBUTEENUMINFO); + sizeof(g_XFAEnumData) / sizeof(XFA_AttributeEnumInfo); diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp index 55a642584b..21812347ff 100644 --- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp @@ -557,7 +557,7 @@ CXFA_Node* FindMatchingDataNode( CXFA_TraverseStrategy_XFAContainerNode>* pIterator, bool& bSelfMatch, - XFA_ATTRIBUTEENUM& eBindMatch, + XFA_AttributeEnum& eBindMatch, bool bUpLevel) { CXFA_Node* pResult = nullptr; CXFA_Node* pCurTemplateNode = pIterator->GetCurrent(); @@ -596,16 +596,16 @@ CXFA_Node* FindMatchingDataNode( CXFA_Node* pTemplateNodeBind = pCurTemplateNode->GetFirstChildByClass(XFA_Element::Bind); - XFA_ATTRIBUTEENUM eMatch = + XFA_AttributeEnum eMatch = pTemplateNodeBind ? pTemplateNodeBind->JSNode()->GetEnum(XFA_Attribute::Match) - : XFA_ATTRIBUTEENUM_Once; + : XFA_AttributeEnum::Once; eBindMatch = eMatch; switch (eMatch) { - case XFA_ATTRIBUTEENUM_None: + case XFA_AttributeEnum::None: pCurTemplateNode = pIterator->MoveToNext(); continue; - case XFA_ATTRIBUTEENUM_Global: + case XFA_AttributeEnum::Global: bAccessedDataDOM = true; if (!bForceBind) { pCurTemplateNode = pIterator->MoveToNext(); @@ -625,7 +625,7 @@ CXFA_Node* FindMatchingDataNode( pResult = pGlobalBindNode; break; } - case XFA_ATTRIBUTEENUM_Once: { + case XFA_AttributeEnum::Once: { bAccessedDataDOM = true; CXFA_Node* pOnceBindNode = FindOnceDataNode( pDocument, @@ -638,7 +638,7 @@ CXFA_Node* FindMatchingDataNode( pResult = pOnceBindNode; break; } - case XFA_ATTRIBUTEENUM_DataRef: { + case XFA_AttributeEnum::DataRef: { bAccessedDataDOM = true; CXFA_Node* pDataRefBindNode = FindDataRefDataNode( pDocument, @@ -741,12 +741,12 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, if (!bOneInstance && pOccurNode) std::tie(iMin, iMax, iInit) = CXFA_OccurData(pOccurNode).GetOccurInfo(); - XFA_ATTRIBUTEENUM eRelation = + XFA_AttributeEnum eRelation = eType == XFA_Element::SubformSet ? pTemplateNode->JSNode()->GetEnum(XFA_Attribute::Relation) - : XFA_ATTRIBUTEENUM_Ordered; + : XFA_AttributeEnum::Ordered; int32_t iCurRepeatIndex = 0; - XFA_ATTRIBUTEENUM eParentBindMatch = XFA_ATTRIBUTEENUM_None; + XFA_AttributeEnum eParentBindMatch = XFA_AttributeEnum::None; if (bDataMerge) { CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFAContainerNode> sNodeIterator(pTemplateNode); @@ -758,7 +758,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, std::vector<CXFA_Node*> nodeArray; for (; iMax < 0 || iCurRepeatIndex < iMax; iCurRepeatIndex++) { bool bSelfMatch = false; - XFA_ATTRIBUTEENUM eBindMatch = XFA_ATTRIBUTEENUM_None; + XFA_AttributeEnum eBindMatch = XFA_AttributeEnum::None; CXFA_Node* pDataNode = FindMatchingDataNode( pDocument, pTemplateNode, pDataScope, bAccessedDataDOM, false, &sNodeIterator, bSelfMatch, eBindMatch, true); @@ -800,19 +800,19 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, for (; iMax < 0 || iCurRepeatIndex < iMax; iCurRepeatIndex++) { bool bSelfMatch = false; - XFA_ATTRIBUTEENUM eBindMatch = XFA_ATTRIBUTEENUM_None; + XFA_AttributeEnum eBindMatch = XFA_AttributeEnum::None; if (!FindMatchingDataNode(pDocument, pTemplateNode, pDataScope, bAccessedDataDOM, false, &sNodeIterator, bSelfMatch, eBindMatch, true)) { break; } - if (eBindMatch == XFA_ATTRIBUTEENUM_DataRef && - eParentBindMatch == XFA_ATTRIBUTEENUM_DataRef) { + if (eBindMatch == XFA_AttributeEnum::DataRef && + eParentBindMatch == XFA_AttributeEnum::DataRef) { break; } - if (eRelation == XFA_ATTRIBUTEENUM_Choice || - eRelation == XFA_ATTRIBUTEENUM_Unordered) { + if (eRelation == XFA_AttributeEnum::Choice || + eRelation == XFA_AttributeEnum::Unordered) { CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer( pDocument, pFormParentNode, pTemplateNode, false, pSearchArray); ASSERT(pSubformSetNode); @@ -830,8 +830,8 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, pTemplateChild, true, nullptr); } else if (pTemplateChild->IsContainerNode()) { bSelfMatch = false; - eBindMatch = XFA_ATTRIBUTEENUM_None; - if (eRelation != XFA_ATTRIBUTEENUM_Ordered) { + eBindMatch = XFA_AttributeEnum::None; + if (eRelation != XFA_AttributeEnum::Ordered) { CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFAContainerNode> sChildIter(pTemplateChild); @@ -854,7 +854,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, } switch (eRelation) { - case XFA_ATTRIBUTEENUM_Choice: { + case XFA_AttributeEnum::Choice: { ASSERT(!rgItemMatchList.empty()); SortRecurseRecord(&rgItemMatchList, pDataScope, true); pDocument->DataMerge_CopyContainer( @@ -862,7 +862,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, pDataScope, false, true, true); break; } - case XFA_ATTRIBUTEENUM_Unordered: { + case XFA_AttributeEnum::Unordered: { if (!rgItemMatchList.empty()) { SortRecurseRecord(&rgItemMatchList, pDataScope, false); for (const auto& matched : rgItemMatchList) { @@ -961,7 +961,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, XFA_NodeMerge_CloneOrMergeContainer(pDocument, pSubformSetNode, pTemplateChild, true, nullptr); } else if (pTemplateChild->IsContainerNode()) { - if (bFound && eRelation == XFA_ATTRIBUTEENUM_Choice) + if (bFound && eRelation == XFA_AttributeEnum::Choice) continue; pDocument->DataMerge_CopyContainer(pTemplateChild, pSubformSetNode, @@ -1000,7 +1000,7 @@ CXFA_Node* CopyContainer_Field(CXFA_Document* pDocument, if (bDataMerge) { bool bAccessedDataDOM = false; bool bSelfMatch = false; - XFA_ATTRIBUTEENUM eBindMatch; + XFA_AttributeEnum eBindMatch; CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFAContainerNode> sNodeIter(pTemplateNode); CXFA_Node* pDataNode = FindMatchingDataNode( @@ -1058,9 +1058,9 @@ CXFA_Node* MaybeCreateDataNode(CXFA_Document* pDocument, pDataNode->CreateXMLMappingNode(); if (eNodeType == XFA_Element::DataValue && pDDNode->JSNode()->GetEnum(XFA_Attribute::Contains) == - XFA_ATTRIBUTEENUM_MetaData) { + XFA_AttributeEnum::MetaData) { pDataNode->JSNode()->SetEnum(XFA_Attribute::Contains, - XFA_ATTRIBUTEENUM_MetaData, false); + XFA_AttributeEnum::MetaData, false); } pDataParent->InsertChild(pDataNode, nullptr); pDataNode->SetDataDescriptionNode(pDDNode); @@ -1084,21 +1084,21 @@ void UpdateBindingRelations(CXFA_Document* pDocument, CXFA_Node* pTemplateNodeBind = pTemplateNode ? pTemplateNode->GetFirstChildByClass(XFA_Element::Bind) : nullptr; - XFA_ATTRIBUTEENUM eMatch = + XFA_AttributeEnum eMatch = pTemplateNodeBind ? pTemplateNodeBind->JSNode()->GetEnum(XFA_Attribute::Match) - : XFA_ATTRIBUTEENUM_Once; + : XFA_AttributeEnum::Once; switch (eMatch) { - case XFA_ATTRIBUTEENUM_None: + case XFA_AttributeEnum::None: if (!bDataRef || bParentDataRef) FormValueNode_MatchNoneCreateChild(pFormNode); break; - case XFA_ATTRIBUTEENUM_Once: + case XFA_AttributeEnum::Once: if (!bDataRef || bParentDataRef) { if (!pDataNode) { if (pFormNode->GetNameHash() != 0 && pFormNode->JSNode()->GetEnum(XFA_Attribute::Scope) != - XFA_ATTRIBUTEENUM_None) { + XFA_AttributeEnum::None) { XFA_Element eDataNodeType = (eType == XFA_Element::Subform || XFA_FieldIsMultiListBox(pFormNode)) ? XFA_Element::DataGroup @@ -1124,7 +1124,7 @@ void UpdateBindingRelations(CXFA_Document* pDocument, } } break; - case XFA_ATTRIBUTEENUM_Global: + case XFA_AttributeEnum::Global: if (!bDataRef || bParentDataRef) { uint32_t dwNameHash = pFormNode->GetNameHash(); if (dwNameHash != 0 && !pDataNode) { @@ -1153,7 +1153,7 @@ void UpdateBindingRelations(CXFA_Document* pDocument, FormValueNode_MatchNoneCreateChild(pFormNode); } break; - case XFA_ATTRIBUTEENUM_DataRef: { + case XFA_AttributeEnum::DataRef: { bMatchRef = bDataRef; bParentDataRef = true; if (!pDataNode && bDataRef) { diff --git a/xfa/fxfa/parser/xfa_utils.cpp b/xfa/fxfa/parser/xfa_utils.cpp index 529420a93a..dbb9748fbf 100644 --- a/xfa/fxfa/parser/xfa_utils.cpp +++ b/xfa/fxfa/parser/xfa_utils.cpp @@ -143,7 +143,7 @@ bool XFA_FieldIsMultiListBox(CXFA_Node* pFieldNode) { if (pFirstChild && pFirstChild->GetElementType() == XFA_Element::ChoiceList) { bRet = pFirstChild->JSNode()->GetEnum(XFA_Attribute::Open) == - XFA_ATTRIBUTEENUM_MultiSelect; + XFA_AttributeEnum::MultiSelect; } } return bRet; |