summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffnotify.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-30 20:36:50 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-30 20:36:50 +0000
commit7311006b16f30da32fed5145e2e1c2c04a5cea41 (patch)
treec5a62d46d630fe9913817d99ea0ba4147196b867 /xfa/fxfa/cxfa_ffnotify.cpp
parent802eaea7696e2e1aa8d6d76d1fee39fbe1c7794b (diff)
downloadpdfium-7311006b16f30da32fed5145e2e1c2c04a5cea41.tar.xz
Move CheckButton code from CXFA_Node to CXFA_CheckButton
This CL moves some of the code specific to CheckButtons out of CXFA_Node and into the CXFA_CheckButton class. The CheckButton is passed as a parameter to the CXFA_FFCheckButton class. Change-Id: I3344c484d90e3b8d1024024a2851685044113a23 Reviewed-on: https://pdfium-review.googlesource.com/24711 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.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/xfa/fxfa/cxfa_ffnotify.cpp b/xfa/fxfa/cxfa_ffnotify.cpp
index a7cb91185b..a929e1a57c 100644
--- a/xfa/fxfa/cxfa_ffnotify.cpp
+++ b/xfa/fxfa/cxfa_ffnotify.cpp
@@ -37,6 +37,7 @@
#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_checkbutton.h"
#include "xfa/fxfa/parser/cxfa_node.h"
namespace {
@@ -111,17 +112,22 @@ CXFA_ContentLayoutItem* CXFA_FFNotify::OnCreateContentLayoutItem(
CXFA_FFWidget* pWidget = nullptr;
switch (pNode->GetFFWidgetType()) {
- case XFA_FFWidgetType::kBarcode:
- ASSERT(pNode->GetUIChildNode()->GetElementType() == XFA_Element::Barcode);
- pWidget = new CXFA_FFBarcode(
- pNode, static_cast<CXFA_Barcode*>(pNode->GetUIChildNode()));
+ case XFA_FFWidgetType::kBarcode: {
+ CXFA_Node* child = pNode->GetUIChildNode();
+ ASSERT(child->GetElementType() == XFA_Element::Barcode);
+ pWidget = new CXFA_FFBarcode(pNode, static_cast<CXFA_Barcode*>(child));
break;
+ }
case XFA_FFWidgetType::kButton:
pWidget = new CXFA_FFPushButton(pNode);
break;
- case XFA_FFWidgetType::kCheckButton:
- pWidget = new CXFA_FFCheckButton(pNode);
+ case XFA_FFWidgetType::kCheckButton: {
+ CXFA_Node* child = pNode->GetUIChildNode();
+ ASSERT(child->GetElementType() == XFA_Element::CheckButton);
+ pWidget =
+ new CXFA_FFCheckButton(pNode, static_cast<CXFA_CheckButton*>(child));
break;
+ }
case XFA_FFWidgetType::kChoiceList: {
if (pNode->IsListBox())
pWidget = new CXFA_FFListBox(pNode);