summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_treelist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_treelist.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_treelist.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/xfa/fxfa/parser/cxfa_treelist.cpp b/xfa/fxfa/parser/cxfa_treelist.cpp
index 754c80d661..941020fe27 100644
--- a/xfa/fxfa/parser/cxfa_treelist.cpp
+++ b/xfa/fxfa/parser/cxfa_treelist.cpp
@@ -11,6 +11,7 @@
#include "core/fxcrt/fx_extension.h"
#include "fxjs/cfxjse_engine.h"
#include "fxjs/xfa/cjx_treelist.h"
+#include "third_party/base/numerics/safe_conversions.h"
#include "xfa/fxfa/parser/cxfa_document.h"
#include "xfa/fxfa/parser/cxfa_list.h"
#include "xfa/fxfa/parser/cxfa_node.h"
@@ -26,9 +27,9 @@ CXFA_TreeList::~CXFA_TreeList() {}
CXFA_Node* CXFA_TreeList::NamedItem(const WideStringView& wsName) {
uint32_t dwHashCode = FX_HashCode_GetW(wsName, false);
- int32_t iCount = GetLength();
- for (int32_t i = 0; i < iCount; i++) {
- CXFA_Node* ret = Item(i);
+ size_t count = GetLength();
+ for (size_t i = 0; i < count; i++) {
+ CXFA_Node* ret = Item(pdfium::base::checked_cast<int32_t>(i));
if (dwHashCode == ret->GetNameHash())
return ret;
}