Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cxfa_treelist.cpp
Go to the documentation of this file.
1// Copyright 2017 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#include "xfa/fxfa/parser/cxfa_treelist.h"
8
9#include "core/fxcrt/fx_extension.h"
10#include "fxjs/xfa/cjx_treelist.h"
11#include "xfa/fxfa/parser/cxfa_document.h"
12#include "xfa/fxfa/parser/cxfa_node.h"
13
21
22CXFA_TreeList::~CXFA_TreeList() = default;
23
24CXFA_Node* CXFA_TreeList::NamedItem(WideStringView wsName) {
25 uint32_t dwHashCode = FX_HashCode_GetW(wsName);
26 size_t count = GetLength();
27 for (size_t i = 0; i < count; i++) {
28 CXFA_Node* ret = Item(i);
29 if (dwHashCode == ret->GetNameHash())
30 return ret;
31 }
32 return nullptr;
33}
uint32_t GetNameHash() const
Definition cxfa_node.h:190
~CXFA_TreeList() override
CXFA_Node * NamedItem(WideStringView wsName)
CXFA_TreeList(CXFA_Document *pDocument)