summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffnotify.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-30 21:38:40 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-30 21:38:40 +0000
commit90d9386825b872a0b668eac5dff3e268fa7ad16c (patch)
treeb615bf156a49b6d4b4dc9d4dd1b628967044f0b2 /xfa/fxfa/cxfa_ffnotify.cpp
parent7311006b16f30da32fed5145e2e1c2c04a5cea41 (diff)
downloadpdfium-90d9386825b872a0b668eac5dff3e268fa7ad16c.tar.xz
Shuffle more code out of CXFA_Node
This CL moves more code out of the CXFA_Node class and into specific subclasses. Change-Id: Idca36f251431bf7efd4da045aeabf097ab23f0ce Reviewed-on: https://pdfium-review.googlesource.com/24714 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffnotify.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffnotify.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/xfa/fxfa/cxfa_ffnotify.cpp b/xfa/fxfa/cxfa_ffnotify.cpp
index a929e1a57c..6802fd32b3 100644
--- a/xfa/fxfa/cxfa_ffnotify.cpp
+++ b/xfa/fxfa/cxfa_ffnotify.cpp
@@ -37,8 +37,10 @@
#include "xfa/fxfa/cxfa_textprovider.h"
#include "xfa/fxfa/parser/cxfa_barcode.h"
#include "xfa/fxfa/parser/cxfa_binditems.h"
+#include "xfa/fxfa/parser/cxfa_button.h"
#include "xfa/fxfa/parser/cxfa_checkbutton.h"
#include "xfa/fxfa/parser/cxfa_node.h"
+#include "xfa/fxfa/parser/cxfa_passwordedit.h"
namespace {
@@ -118,9 +120,12 @@ CXFA_ContentLayoutItem* CXFA_FFNotify::OnCreateContentLayoutItem(
pWidget = new CXFA_FFBarcode(pNode, static_cast<CXFA_Barcode*>(child));
break;
}
- case XFA_FFWidgetType::kButton:
- pWidget = new CXFA_FFPushButton(pNode);
+ case XFA_FFWidgetType::kButton: {
+ CXFA_Node* child = pNode->GetUIChildNode();
+ ASSERT(child->GetElementType() == XFA_Element::Button);
+ pWidget = new CXFA_FFPushButton(pNode, static_cast<CXFA_Button*>(child));
break;
+ }
case XFA_FFWidgetType::kCheckButton: {
CXFA_Node* child = pNode->GetUIChildNode();
ASSERT(child->GetElementType() == XFA_Element::CheckButton);
@@ -143,9 +148,13 @@ CXFA_ContentLayoutItem* CXFA_FFNotify::OnCreateContentLayoutItem(
case XFA_FFWidgetType::kNumericEdit:
pWidget = new CXFA_FFNumericEdit(pNode);
break;
- case XFA_FFWidgetType::kPasswordEdit:
- pWidget = new CXFA_FFPasswordEdit(pNode);
+ case XFA_FFWidgetType::kPasswordEdit: {
+ CXFA_Node* child = pNode->GetUIChildNode();
+ ASSERT(child->GetElementType() == XFA_Element::PasswordEdit);
+ pWidget = new CXFA_FFPasswordEdit(pNode,
+ static_cast<CXFA_PasswordEdit*>(child));
break;
+ }
case XFA_FFWidgetType::kSignature:
pWidget = new CXFA_FFSignature(pNode);
break;