summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_simple_parser.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-02-14 16:20:01 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-14 16:20:01 +0000
commit2fa6441d686e1205eb25ed2cbfc4cf47d96efec6 (patch)
treead5ebfd6bb73d0db5c5b81b61597c7b0f18f9a0f /xfa/fxfa/parser/cxfa_simple_parser.cpp
parentd8d6f55140bd4f0a67de833346113cfa6e03c4bd (diff)
downloadpdfium-2fa6441d686e1205eb25ed2cbfc4cf47d96efec6.tar.xz
Cleanup CXFA_Node::SetFlag
The SetFlag method has a signature of (flag, bool) which, looking at the callsites makes you think it will set the flag to the boolean. This isn't what happens, the flag is always set to true and the boolean decides if we execute some notification code. This CL splits SetFlag into SetFlag(flag) and SetFlagAndNotify(flag) to make it a lot clearer what is happening. Change-Id: I3e067c87532cce10b94bda10cc88feb62b948eb0 Reviewed-on: https://pdfium-review.googlesource.com/26750 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_simple_parser.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_simple_parser.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/xfa/fxfa/parser/cxfa_simple_parser.cpp b/xfa/fxfa/parser/cxfa_simple_parser.cpp
index 42498695e9..7424913114 100644
--- a/xfa/fxfa/parser/cxfa_simple_parser.cpp
+++ b/xfa/fxfa/parser/cxfa_simple_parser.cpp
@@ -429,7 +429,7 @@ void CXFA_SimpleParser::ConstructXFANode(CXFA_Node* pXFANode,
pXFANode->InsertChild(pXFAChild, nullptr);
pXFAChild->SetXMLMappingNode(pXMLChild);
- pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false);
+ pXFAChild->SetFlag(XFA_NodeFlag_Initialized);
break;
}
}
@@ -760,7 +760,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Data(
pNode->SetXMLMappingNode(pDataXMLNode);
if (pDataXMLNode != pXMLDocumentNode)
- pNode->SetFlag(XFA_NodeFlag_OwnXMLNode, false);
+ pNode->SetFlag(XFA_NodeFlag_OwnXMLNode);
return pNode;
}
return nullptr;
@@ -1067,7 +1067,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode,
XFA_AttributeEnum::MetaData, false);
pXFAChild->InsertChild(pXFAMetaData, nullptr);
pXFAMetaData->SetXMLMappingNode(pXMLElement);
- pXFAMetaData->SetFlag(XFA_NodeFlag_Initialized, false);
+ pXFAMetaData->SetFlag(XFA_NodeFlag_Initialized);
}
if (!bNeedValue) {
@@ -1081,7 +1081,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode,
ParseDataValue(pXFAChild, pXMLChild, XFA_PacketType::Datasets);
pXFAChild->SetXMLMappingNode(pXMLElement);
- pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false);
+ pXFAChild->SetFlag(XFA_NodeFlag_Initialized);
continue;
}
case FX_XMLNODE_CharData:
@@ -1100,7 +1100,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode,
false);
pXFANode->InsertChild(pXFAChild, nullptr);
pXFAChild->SetXMLMappingNode(pXMLText);
- pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false);
+ pXFAChild->SetFlag(XFA_NodeFlag_Initialized);
continue;
}
default:
@@ -1151,7 +1151,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode,
false, false);
pXFANode->InsertChild(pXFAChild, nullptr);
pXFAChild->SetXMLMappingNode(pXMLCurValueNode);
- pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false);
+ pXFAChild->SetFlag(XFA_NodeFlag_Initialized);
wsValueTextBuf << wsCurValue;
wsCurValueTextBuf.Clear();
}
@@ -1169,7 +1169,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode,
ParseDataValue(pXFAChild, pXMLChild, ePacketID);
pXFANode->InsertChild(pXFAChild, nullptr);
pXFAChild->SetXMLMappingNode(pXMLChild);
- pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false);
+ pXFAChild->SetFlag(XFA_NodeFlag_Initialized);
WideString wsCurValue =
pXFAChild->JSObject()->GetCData(XFA_Attribute::Value);
wsValueTextBuf << wsCurValue;
@@ -1189,7 +1189,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode,
false);
pXFANode->InsertChild(pXFAChild, nullptr);
pXFAChild->SetXMLMappingNode(pXMLCurValueNode);
- pXFAChild->SetFlag(XFA_NodeFlag_Initialized, false);
+ pXFAChild->SetFlag(XFA_NodeFlag_Initialized);
}
wsValueTextBuf << wsCurValue;
wsCurValueTextBuf.Clear();