diff options
author | dsinclair <dsinclair@chromium.org> | 2016-06-20 11:11:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-20 11:11:12 -0700 |
commit | c5a8f217fedc1224104b34f7577044776a9d83d8 (patch) | |
tree | 0b457b9ccc3511ad45f75fe0f385425af8d6272d /xfa/fxfa/app/xfa_ffdocview.cpp | |
parent | 950e68f14aa6db5022919c55ce80f346a94a762e (diff) | |
download | pdfium-c5a8f217fedc1224104b34f7577044776a9d83d8.tar.xz |
Split the XFA_OBJECTTYPE enum into two parts.
Currently the object type and the node flags are both mixed into the single
XFA_OBJECTTYPE_* enum. These two things are un-related and should not share
a single type. This Cl creates an XFA_ObjectType enum class and a
XFA_NodeFlag enum to hold the two types.
Accessors are added to determine if the flags are set (or called where they
already existed.
Review-Url: https://codereview.chromium.org/2083453003
Diffstat (limited to 'xfa/fxfa/app/xfa_ffdocview.cpp')
-rw-r--r-- | xfa/fxfa/app/xfa_ffdocview.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp index 90ab7cd81f..7a5397f683 100644 --- a/xfa/fxfa/app/xfa_ffdocview.cpp +++ b/xfa/fxfa/app/xfa_ffdocview.cpp @@ -217,7 +217,7 @@ FX_BOOL CXFA_FFDocView::ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc) { pWidgetAcc->UpdateUIDisplay(); if (CXFA_Validate validate = pWidgetAcc->GetValidate()) { AddValidateWidget(pWidgetAcc); - validate.GetNode()->SetFlag(XFA_NODEFLAG_NeedsInitApp, false); + validate.GetNode()->SetFlag(XFA_NodeFlag_NeedsInitApp, false); } return TRUE; } @@ -417,9 +417,9 @@ static int32_t XFA_ProcessEvent(CXFA_FFDocView* pDocView, if (!calc) { return XFA_EVENTERROR_NotExist; } - if (pWidgetAcc->GetNode()->HasFlag(XFA_NODEFLAG_UserInteractive)) { + if (pWidgetAcc->GetNode()->IsUserInteractive()) return XFA_EVENTERROR_Disabled; - } + CXFA_Script script = calc.GetScript(); return pWidgetAcc->ExecuteScript(script, pParam); } @@ -456,9 +456,9 @@ int32_t CXFA_FFDocView::ExecEventActivityByDeepFirst(CXFA_Node* pFormNode, } if (bRecursive) { for (CXFA_Node* pNode = pFormNode->GetNodeItem( - XFA_NODEITEM_FirstChild, XFA_OBJECTTYPE_ContainerNode); + XFA_NODEITEM_FirstChild, XFA_ObjectType::ContainerNode); pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling, - XFA_OBJECTTYPE_ContainerNode)) { + XFA_ObjectType::ContainerNode)) { elementType = pNode->GetClassID(); if (elementType != XFA_ELEMENT_Variables && elementType != XFA_ELEMENT_Draw) { @@ -634,9 +634,9 @@ void CXFA_FFDocView::AddCalculateNodeNotify(CXFA_Node* pNodeChange) { int32_t iCount = pGlobalData ? pGlobalData->m_Globals.GetSize() : 0; for (int32_t i = 0; i < iCount; i++) { CXFA_WidgetAcc* pResultAcc = pGlobalData->m_Globals[i]; - if (pResultAcc->GetNode()->HasFlag(XFA_NODEFLAG_HasRemoved)) { + if (pResultAcc->GetNode()->HasRemovedChildren()) continue; - } + int32_t iAccs = m_CalculateAccs.GetSize(); CXFA_WidgetAcc* pCurrentAcc = iAccs > 0 ? m_CalculateAccs[iAccs - 1] : nullptr; @@ -703,9 +703,9 @@ FX_BOOL CXFA_FFDocView::RunValidate() { int32_t iCounts = m_ValidateAccs.GetSize(); for (int32_t i = 0; i < iCounts; i++) { CXFA_WidgetAcc* pAcc = m_ValidateAccs[i]; - if (pAcc->GetNode()->HasFlag(XFA_NODEFLAG_HasRemoved)) { + if (pAcc->GetNode()->HasRemovedChildren()) continue; - } + pAcc->ProcessValidate(); } m_ValidateAccs.RemoveAll(); @@ -723,7 +723,7 @@ FX_BOOL CXFA_FFDocView::RunEventLayoutReady() { } void CXFA_FFDocView::RunBindItems() { for (int32_t i = 0; i < m_BindItems.GetSize(); i++) { - if (m_BindItems[i]->HasFlag(XFA_NODEFLAG_HasRemoved)) + if (m_BindItems[i]->HasRemovedChildren()) continue; CXFA_Node* pWidgetNode = m_BindItems[i]->GetNodeItem(XFA_NODEITEM_Parent); |