diff options
author | Ryan Harrison <rharrison@chromium.org> | 2018-01-04 15:38:54 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-04 20:54:11 +0000 |
commit | 24d779283af803077d8377fbdc49d9d07da335e7 (patch) | |
tree | b41866170ca658bd41d72dae67e031ef34466709 /xfa/fxfa/parser/cxfa_node.cpp | |
parent | 492ad362da4953ddcbd5c12a6517aabd1f513454 (diff) | |
download | pdfium-24d779283af803077d8377fbdc49d9d07da335e7.tar.xz |
Convert CXFA_Node::GetChild to take a size_t for the indexchromium/3312
Change-Id: I99ab62f03a42bb1dc5f4d228cd60c0e254a8c70b
Reviewed-on: https://pdfium-review.googlesource.com/22259
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_node.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_node.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 3d132fedbc..08af2004a1 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -796,22 +796,20 @@ size_t CXFA_Node::CountChildren(XFA_Element eType, bool bOnlyChild) { return count; } -CXFA_Node* CXFA_Node::GetChildInternal(int32_t index, +CXFA_Node* CXFA_Node::GetChildInternal(size_t index, XFA_Element eType, bool bOnlyChild) { - ASSERT(index > -1); - - int32_t iCount = 0; + size_t count = 0; for (CXFA_Node* pNode = m_pChild; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { if (pNode->GetElementType() != eType && eType != XFA_Element::Unknown) continue; if (bOnlyChild && HasProperty(pNode->GetElementType())) continue; - if (iCount == index) + if (count == index) return pNode; - ++iCount; + ++count; } return nullptr; } |