summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_node.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/parser/cxfa_node.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/parser/cxfa_node.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp34
1 files changed, 7 insertions, 27 deletions
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 0c28f4b5c6..451c98f8f0 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -3523,13 +3523,6 @@ RetainPtr<CFGAS_GEFont> CXFA_Node::GetFDEFont(CXFA_FFDoc* doc) {
dwFontStyle);
}
-XFA_AttributeEnum CXFA_Node::GetButtonHighlight() {
- CXFA_Node* pUIChild = GetUIChildNode();
- if (pUIChild)
- return pUIChild->JSObject()->GetEnum(XFA_Attribute::Highlight);
- return XFA_AttributeEnum::Inverted;
-}
-
bool CXFA_Node::HasButtonRollover() {
CXFA_Items* pItems = GetChild<CXFA_Items>(0, XFA_Element::Items, false);
if (!pItems)
@@ -3571,12 +3564,6 @@ float CXFA_Node::GetCheckButtonSize() {
return CXFA_Measurement(10, XFA_Unit::Pt).ToUnit(XFA_Unit::Pt);
}
-bool CXFA_Node::IsAllowNeutral() {
- CXFA_Node* pUIChild = GetUIChildNode();
- return pUIChild &&
- pUIChild->JSObject()->GetBoolean(XFA_Attribute::AllowNeutral);
-}
-
XFA_CHECKSTATE CXFA_Node::GetCheckState() {
WideString wsValue = GetRawValue();
if (wsValue.IsEmpty())
@@ -4232,12 +4219,6 @@ Optional<int32_t> CXFA_Node::GetNumberOfCells() {
return {};
}
-WideString CXFA_Node::GetPasswordChar() {
- CXFA_Node* pUIChild = GetUIChildNode();
- return pUIChild ? pUIChild->JSObject()->GetCData(XFA_Attribute::PasswordChar)
- : L"*";
-}
-
bool CXFA_Node::IsMultiLine() {
CXFA_Node* pUIChild = GetUIChildNode();
return pUIChild && pUIChild->JSObject()->GetBoolean(XFA_Attribute::MultiLine);
@@ -4327,13 +4308,11 @@ bool CXFA_Node::SetValue(XFA_VALUEPICTURE eValueType,
bSyncData = true;
}
- } else {
- if (eType == XFA_Element::NumericEdit) {
- if (wsNewText != L"0")
- wsNewText = NumericLimit(wsNewText, GetLeadDigits(), GetFracDigits());
+ } else if (eType == XFA_Element::NumericEdit) {
+ if (wsNewText != L"0")
+ wsNewText = NumericLimit(wsNewText, GetLeadDigits(), GetFracDigits());
- bSyncData = true;
- }
+ bSyncData = true;
}
if (eType != XFA_Element::NumericEdit || bSyncData)
SyncValue(wsNewText, true);
@@ -4432,7 +4411,7 @@ WideString CXFA_Node::GetValue(XFA_VALUEPICTURE eValueType) {
if (!pNode)
return wsValue;
- switch (GetUIChildNode()->GetElementType()) {
+ switch (pNode->GetElementType()) {
case XFA_Element::ChoiceList: {
if (eValueType == XFA_VALUEPICTURE_Display) {
int32_t iSelItemIndex = GetSelectedItem(0);
@@ -4441,7 +4420,8 @@ WideString CXFA_Node::GetValue(XFA_VALUEPICTURE eValueType) {
wsPicture.clear();
}
}
- } break;
+ break;
+ }
case XFA_Element::NumericEdit:
if (eValueType != XFA_VALUEPICTURE_Raw && wsPicture.IsEmpty()) {
IFX_Locale* pLocale = GetLocale();