summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-31 14:38:04 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-31 14:38:04 +0000
commit4b0c5b935471897e12a21c680aff0ba17d0686e8 (patch)
tree3e04a41c5e36da8b8c85f7506aaad04fd425dd6a
parent2334660053e044ca79a1831a6c73f69891f039e0 (diff)
downloadpdfium-4b0c5b935471897e12a21c680aff0ba17d0686e8.tar.xz
Remove NumericLimit params which are always the same
This CL removes the two params from NumericLmits which are always set to the same value and retrieves the values in the method itself. Change-Id: Ibeabdc7187faa58e93ffbe00063171fec0842256 Reviewed-on: https://pdfium-review.googlesource.com/24717 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
-rw-r--r--fxjs/xfa/cjx_field.cpp8
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp11
-rw-r--r--xfa/fxfa/parser/cxfa_node.h4
3 files changed, 9 insertions, 14 deletions
diff --git a/fxjs/xfa/cjx_field.cpp b/fxjs/xfa/cjx_field.cpp
index 078def3cf9..2b755b7d53 100644
--- a/fxjs/xfa/cjx_field.cpp
+++ b/fxjs/xfa/cjx_field.cpp
@@ -248,12 +248,8 @@ void CJX_Field::defaultValue(CFXJSE_Value* pValue,
WideString wsNewText;
if (pValue && !(pValue->IsNull() || pValue->IsUndefined()))
wsNewText = pValue->ToWideString();
-
- if (xfaNode->GetUIChildNode()->GetElementType() ==
- XFA_Element::NumericEdit) {
- wsNewText = xfaNode->NumericLimit(wsNewText, xfaNode->GetLeadDigits(),
- xfaNode->GetFracDigits());
- }
+ if (xfaNode->GetUIChildNode()->GetElementType() == XFA_Element::NumericEdit)
+ wsNewText = xfaNode->NumericLimit(wsNewText);
CXFA_Node* pContainerNode = xfaNode->GetContainerNode();
WideString wsFormatText(wsNewText);
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 451c98f8f0..ec9be78a5c 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -4304,13 +4304,13 @@ bool CXFA_Node::SetValue(XFA_VALUEPICTURE eValueType,
wsPicture, pLocale, pLocalMgr);
wsNewText = widgetValue.GetValue();
if (eType == XFA_Element::NumericEdit)
- wsNewText = NumericLimit(wsNewText, GetLeadDigits(), GetFracDigits());
+ wsNewText = NumericLimit(wsNewText);
bSyncData = true;
}
} else if (eType == XFA_Element::NumericEdit) {
if (wsNewText != L"0")
- wsNewText = NumericLimit(wsNewText, GetLeadDigits(), GetFracDigits());
+ wsNewText = NumericLimit(wsNewText);
bSyncData = true;
}
@@ -4629,9 +4629,10 @@ void CXFA_Node::InsertListTextItem(CXFA_Node* pItems,
pText->JSObject()->SetContent(wsText, wsText, false, false, false);
}
-WideString CXFA_Node::NumericLimit(const WideString& wsValue,
- int32_t iLead,
- int32_t iTread) const {
+WideString CXFA_Node::NumericLimit(const WideString& wsValue) {
+ int32_t iLead = GetLeadDigits();
+ int32_t iTread = GetFracDigits();
+
if ((iLead == -1) && (iTread == -1))
return wsValue;
diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h
index dfe5ab0127..415ad94fb8 100644
--- a/xfa/fxfa/parser/cxfa_node.h
+++ b/xfa/fxfa/parser/cxfa_node.h
@@ -377,9 +377,7 @@ class CXFA_Node : public CXFA_Object {
int32_t GetFracDigits();
int32_t GetLeadDigits();
- WideString NumericLimit(const WideString& wsValue,
- int32_t iLead,
- int32_t iTread) const;
+ WideString NumericLimit(const WideString& wsValue);
protected:
virtual XFA_Element GetValueNodeType() const;