diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-30 20:36:50 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-30 20:36:50 +0000 |
commit | 7311006b16f30da32fed5145e2e1c2c04a5cea41 (patch) | |
tree | c5a62d46d630fe9913817d99ea0ba4147196b867 /xfa/fxfa/parser | |
parent | 802eaea7696e2e1aa8d6d76d1fee39fbe1c7794b (diff) | |
download | pdfium-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/parser')
-rw-r--r-- | xfa/fxfa/parser/cxfa_checkbutton.cpp | 8 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_checkbutton.h | 3 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_node.cpp | 15 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_node.h | 2 |
4 files changed, 11 insertions, 17 deletions
diff --git a/xfa/fxfa/parser/cxfa_checkbutton.cpp b/xfa/fxfa/parser/cxfa_checkbutton.cpp index 0e40e574b2..59afe5ac98 100644 --- a/xfa/fxfa/parser/cxfa_checkbutton.cpp +++ b/xfa/fxfa/parser/cxfa_checkbutton.cpp @@ -47,3 +47,11 @@ CXFA_CheckButton::~CXFA_CheckButton() {} XFA_FFWidgetType CXFA_CheckButton::GetDefaultFFWidgetType() const { return XFA_FFWidgetType::kCheckButton; } + +bool CXFA_CheckButton::IsRound() { + return JSObject()->GetEnum(XFA_Attribute::Shape) == XFA_AttributeEnum::Round; +} + +XFA_AttributeEnum CXFA_CheckButton::GetMark() { + return JSObject()->GetEnum(XFA_Attribute::Mark); +} diff --git a/xfa/fxfa/parser/cxfa_checkbutton.h b/xfa/fxfa/parser/cxfa_checkbutton.h index f107de3206..b603dd0ca1 100644 --- a/xfa/fxfa/parser/cxfa_checkbutton.h +++ b/xfa/fxfa/parser/cxfa_checkbutton.h @@ -15,6 +15,9 @@ class CXFA_CheckButton : public CXFA_Node { ~CXFA_CheckButton() override; XFA_FFWidgetType GetDefaultFFWidgetType() const override; + + bool IsRound(); + XFA_AttributeEnum GetMark(); }; #endif // XFA_FXFA_PARSER_CXFA_CHECKBUTTON_H_ diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 1b53b6b7b0..0c28f4b5c6 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -3556,21 +3556,6 @@ bool CXFA_Node::HasButtonDown() { return false; } -bool CXFA_Node::IsCheckButtonRound() { - CXFA_Node* pUIChild = GetUIChildNode(); - if (pUIChild) - return pUIChild->JSObject()->GetEnum(XFA_Attribute::Shape) == - XFA_AttributeEnum::Round; - return false; -} - -XFA_AttributeEnum CXFA_Node::GetCheckButtonMark() { - CXFA_Node* pUIChild = GetUIChildNode(); - if (pUIChild) - return pUIChild->JSObject()->GetEnum(XFA_Attribute::Mark); - return XFA_AttributeEnum::Default; -} - bool CXFA_Node::IsRadioButton() { CXFA_Node* pParent = GetParent(); return pParent && pParent->GetElementType() == XFA_Element::ExclGroup; diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h index 87f5a475bd..819b2f9a40 100644 --- a/xfa/fxfa/parser/cxfa_node.h +++ b/xfa/fxfa/parser/cxfa_node.h @@ -318,8 +318,6 @@ class CXFA_Node : public CXFA_Object { bool HasButtonRollover(); bool HasButtonDown(); - bool IsCheckButtonRound(); - XFA_AttributeEnum GetCheckButtonMark(); float GetCheckButtonSize(); XFA_CHECKSTATE GetCheckState(); |