summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-22 18:41:36 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-22 18:41:36 +0000
commitd7d584df24fda9c9a28330959cc28f94dc0294e2 (patch)
tree114c9f6dbbd0d0cd9b0d964c95978bca95b7708d /xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
parent434e28dd41e37dc829440aab1eb4cb4ec561962b (diff)
downloadpdfium-d7d584df24fda9c9a28330959cc28f94dc0294e2.tar.xz
Add flag to notify if a node widget is ready
This CL updates CXFA_Object to have a flag which annotates if the node is ready. Ready means that we've gone through the OnNodeReady call in CXFA_FFNotify. Previously we'd check if the WidgetAcc exists on the node which is created in OnNodeReady. This CL replaces all the points where we check for a WidgetAcc existing with a IsWidgetReady() call. Change-Id: I54e8160269c3104cdae7a516c1814c13bee15130 Reviewed-on: https://pdfium-review.googlesource.com/23190 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/xfa_document_datamerger_imp.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_document_datamerger_imp.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
index f6f165fe59..422ba4e58a 100644
--- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
@@ -70,9 +70,8 @@ CXFA_Node* FormValueNode_CreateChild(CXFA_Node* pValueNode, XFA_Element iType) {
}
void FormValueNode_MatchNoneCreateChild(CXFA_Node* pFormNode) {
- CXFA_WidgetAcc* pWidgetAcc = pFormNode->GetWidgetAcc();
- ASSERT(pWidgetAcc);
- pWidgetAcc->GetUIType();
+ ASSERT(pFormNode->IsWidgetReady());
+ pFormNode->GetWidgetAcc()->GetUIType();
}
bool FormValueNode_SetChildContent(CXFA_Node* pValueNode,
@@ -132,8 +131,8 @@ void CreateDataBinding(CXFA_Node* pFormNode,
if (eType != XFA_Element::Field && eType != XFA_Element::ExclGroup)
return;
+ ASSERT(pFormNode->IsWidgetReady());
CXFA_WidgetAcc* pWidgetAcc = pFormNode->GetWidgetAcc();
- ASSERT(pWidgetAcc);
XFA_Element eUIType = pWidgetAcc->GetUIType();
auto* defValue = pFormNode->JSObject()->GetOrCreateProperty<CXFA_Value>(
0, XFA_Element::Value);