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/parser/xfa_parser_imp.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/parser/xfa_parser_imp.cpp')
-rw-r--r-- | xfa/fxfa/parser/xfa_parser_imp.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/xfa/fxfa/parser/xfa_parser_imp.cpp b/xfa/fxfa/parser/xfa_parser_imp.cpp index 9cc324ae9d..8d6d7b778e 100644 --- a/xfa/fxfa/parser/xfa_parser_imp.cpp +++ b/xfa/fxfa/parser/xfa_parser_imp.cpp @@ -178,7 +178,7 @@ void CXFA_SimpleParser::ConstructXFANode(CXFA_Node* pXFANode, pXFANode->InsertChild(pXFAChild); pXFAChild->SetXMLMappingNode(pXMLChild); - pXFAChild->SetFlag(XFA_NODEFLAG_Initialized, false); + pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false); break; } } @@ -186,7 +186,7 @@ void CXFA_SimpleParser::ConstructXFANode(CXFA_Node* pXFANode, } else { m_pRootNode = DataLoader(pXFANode, pXMLNode, TRUE); } - } else if (pXFANode->GetObjectType() == XFA_OBJECTTYPE_ContentNode) { + } else if (pXFANode->IsContentNode()) { ParseContentNode(pXFANode, pXMLNode, ePacketID); m_pRootNode = pXFANode; } else { @@ -705,7 +705,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Data( } pNode->SetXMLMappingNode(pDataXMLNode); if (pDataXMLNode != pXMLDocumentNode) { - pNode->SetFlag(XFA_NODEFLAG_OwnXMLNode, false); + pNode->SetFlag(XFA_NodeFlag_OwnXMLNode, false); } return pNode; } @@ -891,10 +891,10 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode, break; } switch (pXFAChild->GetObjectType()) { - case XFA_OBJECTTYPE_ContentNode: - case XFA_OBJECTTYPE_TextNode: - case XFA_OBJECTTYPE_NodeC: - case XFA_OBJECTTYPE_NodeV: + case XFA_ObjectType::ContentNode: + case XFA_ObjectType::TextNode: + case XFA_ObjectType::NodeC: + case XFA_ObjectType::NodeV: if (IsNeedValue) { ParseContentNode(pXFAChild, pXMLElement, ePacketID); } @@ -1023,7 +1023,7 @@ void CXFA_SimpleParser::ParseContentNode(CXFA_Node* pXFANode, break; } if (!wsValue.IsEmpty()) { - if (pXFANode->GetObjectType() == XFA_OBJECTTYPE_ContentNode) { + if (pXFANode->IsContentNode()) { CXFA_Node* pContentRawDataNode = m_pFactory->CreateNode(ePacketID, element); ASSERT(pContentRawDataNode); @@ -1156,7 +1156,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode, XFA_ATTRIBUTEENUM_MetaData); pXFAChild->InsertChild(pXFAMetaData); pXFAMetaData->SetXMLMappingNode(pXMLElement); - pXFAMetaData->SetFlag(XFA_NODEFLAG_Initialized, false); + pXFAMetaData->SetFlag(XFA_NodeFlag_Initialized, false); } if (!bNeedValue) { CFX_WideString wsNilName(L"xsi:nil"); @@ -1172,7 +1172,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode, } } pXFAChild->SetXMLMappingNode(pXMLElement); - pXFAChild->SetFlag(XFA_NODEFLAG_Initialized, false); + pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false); } continue; case FDE_XMLNODE_CharData: { @@ -1191,7 +1191,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode, pXFAChild->SetCData(XFA_ATTRIBUTE_Value, wsCharData); pXFANode->InsertChild(pXFAChild); pXFAChild->SetXMLMappingNode(pXMLCharData); - pXFAChild->SetFlag(XFA_NODEFLAG_Initialized, false); + pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false); } continue; case FDE_XMLNODE_Text: { @@ -1209,7 +1209,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode, pXFAChild->SetCData(XFA_ATTRIBUTE_Value, wsText); pXFANode->InsertChild(pXFAChild); pXFAChild->SetXMLMappingNode(pXMLText); - pXFAChild->SetFlag(XFA_NODEFLAG_Initialized, false); + pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false); } continue; case FDE_XMLNODE_Instruction: @@ -1270,7 +1270,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode, pXFAChild->SetCData(XFA_ATTRIBUTE_Value, wsCurValue); pXFANode->InsertChild(pXFAChild); pXFAChild->SetXMLMappingNode(pXMLCurValueNode); - pXFAChild->SetFlag(XFA_NODEFLAG_Initialized, false); + pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false); wsValueTextBuf << wsCurValue; wsCurValueTextBuf.Clear(); } @@ -1287,7 +1287,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode, ParseDataValue(pXFAChild, pXMLChild, ePacketID); pXFANode->InsertChild(pXFAChild); pXFAChild->SetXMLMappingNode(pXMLChild); - pXFAChild->SetFlag(XFA_NODEFLAG_Initialized, false); + pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false); CFX_WideStringC wsCurValue = pXFAChild->GetCData(XFA_ATTRIBUTE_Value); wsValueTextBuf << wsCurValue; } @@ -1305,7 +1305,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode, pXFAChild->SetCData(XFA_ATTRIBUTE_Value, wsCurValue); pXFANode->InsertChild(pXFAChild); pXFAChild->SetXMLMappingNode(pXMLCurValueNode); - pXFAChild->SetFlag(XFA_NODEFLAG_Initialized, false); + pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false); } wsValueTextBuf << wsCurValue; wsCurValueTextBuf.Clear(); |