diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-22 18:41:36 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-22 18:41:36 +0000 |
commit | d7d584df24fda9c9a28330959cc28f94dc0294e2 (patch) | |
tree | 114c9f6dbbd0d0cd9b0d964c95978bca95b7708d /fxjs/xfa/cjx_template.cpp | |
parent | 434e28dd41e37dc829440aab1eb4cb4ec561962b (diff) | |
download | pdfium-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 'fxjs/xfa/cjx_template.cpp')
-rw-r--r-- | fxjs/xfa/cjx_template.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fxjs/xfa/cjx_template.cpp b/fxjs/xfa/cjx_template.cpp index 816c9d487b..d909567c51 100644 --- a/fxjs/xfa/cjx_template.cpp +++ b/fxjs/xfa/cjx_template.cpp @@ -50,8 +50,7 @@ CJS_Return CJX_Template::execInitialize( const std::vector<v8::Local<v8::Value>>& params) { if (!params.empty()) return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); - return CJS_Return( - runtime->NewBoolean(!!ToNode(GetXFAObject())->GetWidgetAcc())); + return CJS_Return(runtime->NewBoolean(GetXFANode()->IsWidgetReady())); } CJS_Return CJX_Template::recalculate( @@ -67,8 +66,7 @@ CJS_Return CJX_Template::execCalculate( const std::vector<v8::Local<v8::Value>>& params) { if (!params.empty()) return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); - return CJS_Return( - runtime->NewBoolean(!!ToNode(GetXFAObject())->GetWidgetAcc())); + return CJS_Return(runtime->NewBoolean(GetXFANode()->IsWidgetReady())); } CJS_Return CJX_Template::execValidate( @@ -76,6 +74,5 @@ CJS_Return CJX_Template::execValidate( const std::vector<v8::Local<v8::Value>>& params) { if (!params.empty()) return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); - return CJS_Return( - runtime->NewBoolean(!!ToNode(GetXFAObject())->GetWidgetAcc())); + return CJS_Return(runtime->NewBoolean(GetXFANode()->IsWidgetReady())); } |