summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xfa/fxfa/parser/cxfa_document.cpp31
-rw-r--r--xfa/fxfa/parser/cxfa_document.h5
2 files changed, 19 insertions, 17 deletions
diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp
index 2750157717..d23e2bc2ce 100644
--- a/xfa/fxfa/parser/cxfa_document.cpp
+++ b/xfa/fxfa/parser/cxfa_document.cpp
@@ -131,11 +131,6 @@ bool FormValueNode_SetChildContent(CXFA_Node* pValueNode,
return true;
}
-CXFA_Node* GetGlobalBinding(CXFA_Document* pDocument, uint32_t dwNameHash) {
- auto it = pDocument->m_rgGlobalBinding.find(dwNameHash);
- return it != pDocument->m_rgGlobalBinding.end() ? it->second : nullptr;
-}
-
void MergeNodeRecurse(CXFA_Node* pDestNodeParent, CXFA_Node* pProtoNode) {
CXFA_Node* pExistingNode = nullptr;
for (CXFA_Node* pFormChild = pDestNodeParent->GetFirstChild(); pFormChild;
@@ -298,12 +293,6 @@ CXFA_Node* ScopeMatchGlobalBinding(CXFA_Node* pDataScope,
return nullptr;
}
-void RegisterGlobalBinding(CXFA_Document* pDocument,
- uint32_t dwNameHash,
- CXFA_Node* pDataNode) {
- pDocument->m_rgGlobalBinding[dwNameHash] = pDataNode;
-}
-
CXFA_Node* FindGlobalDataNode(CXFA_Document* pDocument,
const WideString& wsName,
CXFA_Node* pDataScope,
@@ -312,12 +301,12 @@ CXFA_Node* FindGlobalDataNode(CXFA_Document* pDocument,
return nullptr;
uint32_t dwNameHash = FX_HashCode_GetW(wsName.AsStringView(), false);
- CXFA_Node* pBounded = GetGlobalBinding(pDocument, dwNameHash);
+ CXFA_Node* pBounded = pDocument->GetGlobalBinding(dwNameHash);
if (!pBounded) {
pBounded =
ScopeMatchGlobalBinding(pDataScope, dwNameHash, eMatchNodeType, true);
if (pBounded)
- RegisterGlobalBinding(pDocument, dwNameHash, pBounded);
+ pDocument->RegisterGlobalBinding(dwNameHash, pBounded);
}
return pBounded;
}
@@ -1175,7 +1164,7 @@ void UpdateBindingRelations(CXFA_Document* pDocument,
if (!bDataRef || bParentDataRef) {
uint32_t dwNameHash = pFormNode->GetNameHash();
if (dwNameHash != 0 && !pDataNode) {
- pDataNode = GetGlobalBinding(pDocument, dwNameHash);
+ pDataNode = pDocument->GetGlobalBinding(dwNameHash);
if (!pDataNode) {
XFA_Element eDataNodeType = (eType == XFA_Element::Subform ||
XFA_FieldIsMultiListBox(pFormNode))
@@ -1189,8 +1178,8 @@ void UpdateBindingRelations(CXFA_Document* pDocument,
pFormNode->JSObject()->GetCData(XFA_Attribute::Name)));
if (pDataNode) {
CreateDataBinding(pFormNode, pDataNode, false);
- RegisterGlobalBinding(pDocument, pFormNode->GetNameHash(),
- pDataNode);
+ pDocument->RegisterGlobalBinding(pFormNode->GetNameHash(),
+ pDataNode);
}
} else {
CreateDataBinding(pFormNode, pDataNode, true);
@@ -1810,3 +1799,13 @@ void CXFA_Document::DoDataRemerge(bool bDoDataMerge) {
CXFA_LayoutProcessor* pLayoutProcessor = GetLayoutProcessor();
pLayoutProcessor->SetForceReLayout(true);
}
+
+CXFA_Node* CXFA_Document::GetGlobalBinding(uint32_t dwNameHash) {
+ auto it = m_rgGlobalBinding.find(dwNameHash);
+ return it != m_rgGlobalBinding.end() ? it->second : nullptr;
+}
+
+void CXFA_Document::RegisterGlobalBinding(uint32_t dwNameHash,
+ CXFA_Node* pDataNode) {
+ m_rgGlobalBinding[dwNameHash] = pDataNode;
+}
diff --git a/xfa/fxfa/parser/cxfa_document.h b/xfa/fxfa/parser/cxfa_document.h
index c04c31cfce..f924abb989 100644
--- a/xfa/fxfa/parser/cxfa_document.h
+++ b/xfa/fxfa/parser/cxfa_document.h
@@ -95,12 +95,15 @@ class CXFA_Document : public CXFA_NodeOwner {
void ClearLayoutData();
- std::map<uint32_t, CXFA_Node*> m_rgGlobalBinding;
+ CXFA_Node* GetGlobalBinding(uint32_t dwNameHash);
+ void RegisterGlobalBinding(uint32_t dwNameHash, CXFA_Node* pDataNode);
+
std::vector<CXFA_Node*> m_pPendingPageSet;
private:
UnownedPtr<CXFA_FFNotify> notify_;
CXFA_Node* m_pRootNode;
+ std::map<uint32_t, CXFA_Node*> m_rgGlobalBinding;
std::unique_ptr<CFXJSE_Engine> m_pScriptContext;
std::unique_ptr<CXFA_LayoutProcessor> m_pLayoutProcessor;
std::unique_ptr<CXFA_LocaleMgr> m_pLocalMgr;