diff options
author | Lei Zhang <thestig@chromium.org> | 2015-10-20 10:21:36 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-10-20 10:21:36 -0700 |
commit | 23378cdf2c0be861bddfffd82aed8cd6b07d77bf (patch) | |
tree | 325cc64b1d407e56bd603b01f3a08ec32144f2f1 /xfa/src/fxfa | |
parent | dd11f8615fc20e638fbb6f6281c4564ed8927af3 (diff) | |
download | pdfium-23378cdf2c0be861bddfffd82aed8cd6b07d77bf.tar.xz |
XFA: Remove cond ? TRUE : FALSE.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1409323003 .
Diffstat (limited to 'xfa/src/fxfa')
6 files changed, 10 insertions, 12 deletions
diff --git a/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp b/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp index 42652ad57a..8da91847fc 100644 --- a/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp @@ -1201,7 +1201,7 @@ static void XFA_DataMerge_UpdateBindingRelations(CXFA_Document* pDocument, if (pDataNode) {
XFA_DataMerge_CreateDataBinding(
pFormNode, pDataNode,
- rs.dwFlags == XFA_RESOVENODE_RSTYPE_ExistNodes ? TRUE : FALSE);
+ rs.dwFlags == XFA_RESOVENODE_RSTYPE_ExistNodes);
} else {
XFA_DataMerge_FormValueNode_MatchNoneCreateChild(pFormNode);
}
diff --git a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp index 1894480068..4ab1dc96f2 100644 --- a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp +++ b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp @@ -1432,7 +1432,7 @@ FX_BOOL CXFA_LayoutPageMgr::GetNextAvailContentHeight(FX_FLOAT fChildHeight) { if (pCurContentNode) {
FX_FLOAT fNextContentHeight =
pCurContentNode->GetMeasure(XFA_ATTRIBUTE_H).ToUnit(XFA_UNIT_Pt);
- return fNextContentHeight > fChildHeight ? TRUE : FALSE;
+ return fNextContentHeight > fChildHeight;
}
CXFA_Node* pPageNode = GetCurrentContainerRecord()->pCurPageArea->m_pFormNode;
CXFA_Node* pOccurNode = pPageNode->GetFirstChildByClass(XFA_ELEMENT_Occur);
diff --git a/xfa/src/fxfa/src/parser/xfa_object_imp.cpp b/xfa/src/fxfa/src/parser/xfa_object_imp.cpp index db059675f8..0bacfcd074 100644 --- a/xfa/src/fxfa/src/parser/xfa_object_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_object_imp.cpp @@ -1752,8 +1752,7 @@ void CXFA_Node::Script_Boolean_Value(FXJSE_HVALUE hValue, SetScriptContent(wsNewValue, wsFormatValue, TRUE, TRUE);
} else {
CFX_WideString wsValue = GetScriptContent(TRUE);
- FXJSE_Value_SetBoolean(hValue,
- wsValue.Equal(FX_WSTRC(L"1")) ? TRUE : FALSE);
+ FXJSE_Value_SetBoolean(hValue, wsValue.Equal(FX_WSTRC(L"1")));
}
}
struct XFA_ExecEventParaInfo {
@@ -5449,8 +5448,7 @@ CXFA_AttachNodeList::CXFA_AttachNodeList(CXFA_Document* pDocument, }
int32_t CXFA_AttachNodeList::GetLength() {
return m_pAttachNode->CountChildren(
- XFA_ELEMENT_UNKNOWN,
- m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform ? TRUE : FALSE);
+ XFA_ELEMENT_UNKNOWN, m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform);
}
FX_BOOL CXFA_AttachNodeList::Append(CXFA_Node* pNode) {
CXFA_Node* pParent = pNode->GetNodeItem(XFA_NODEITEM_Parent);
@@ -5473,5 +5471,5 @@ FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) { CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) {
return m_pAttachNode->GetChild(
iIndex, XFA_ELEMENT_UNKNOWN,
- m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform ? TRUE : FALSE);
+ m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform);
}
diff --git a/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp b/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp index ab9e3331ca..c239ac1d70 100644 --- a/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp @@ -837,7 +837,7 @@ int32_t CXFA_Line::GetHand() { }
FX_BOOL CXFA_Line::GetSlop() {
XFA_ATTRIBUTEENUM eSlop = m_pNode->GetEnum(XFA_ATTRIBUTE_Slope);
- return (eSlop == XFA_ATTRIBUTEENUM_Slash) ? TRUE : FALSE;
+ return eSlop == XFA_ATTRIBUTEENUM_Slash;
}
CXFA_Edge CXFA_Line::GetEdge() {
return CXFA_Edge(m_pNode->GetChild(0, XFA_ELEMENT_Edge));
diff --git a/xfa/src/fxfa/src/parser/xfa_script_imp.cpp b/xfa/src/fxfa/src/parser/xfa_script_imp.cpp index f8b8f76ae9..34668ea66a 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_imp.cpp @@ -672,7 +672,7 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, FX_BOOL bCreate =
m_pResolveProcessor->GetNodeHelper()->XFA_ResolveNodes_CreateNode(
rndFind.m_wsName, rndFind.m_wsCondition,
- nStart == wsExpression.GetLength() ? TRUE : FALSE, this);
+ nStart == wsExpression.GetLength(), this);
if (bCreate) {
continue;
} else {
@@ -732,7 +732,7 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, FX_BOOL bCreate =
m_pResolveProcessor->GetNodeHelper()->XFA_ResolveNodes_CreateNode(
rndFind.m_wsName, rndFind.m_wsCondition,
- nStart == wsExpression.GetLength() ? TRUE : FALSE, this);
+ nStart == wsExpression.GetLength(), this);
if (bCreate) {
continue;
} else {
diff --git a/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.cpp b/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.cpp index dfbf22d7dc..7919395a56 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.cpp @@ -314,7 +314,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Normal( if (m_pNodeHelper->XFA_NodeIsTransparent((CXFA_Node*)curNode)) {
m_pNodeHelper->XFA_CountSiblings(
(CXFA_Node*)nodes[0], XFA_LOGIC_Transparent, &upArrayNodes,
- dwStyles & XFA_RESOLVENODE_TagName ? TRUE : FALSE);
+ !!(dwStyles & XFA_RESOLVENODE_TagName));
}
if (upArrayNodes.GetSize() > nodes.GetSize()) {
upArrayNodes[0] = (CXFA_Node*)nodes[0];
@@ -463,7 +463,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Normal( CXFA_NodeArray upArrayNodes;
m_pNodeHelper->XFA_CountSiblings(
(CXFA_Node*)nodes[0], XFA_LOGIC_Transparent, &upArrayNodes,
- dwStyles & XFA_RESOLVENODE_TagName ? TRUE : FALSE);
+ !!(dwStyles & XFA_RESOLVENODE_TagName));
if (upArrayNodes.GetSize() > nodes.GetSize()) {
upArrayNodes[0] = (CXFA_Node*)nodes[0];
nodes.RemoveAll();
|