summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-02 19:17:18 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-02 19:17:18 +0000
commit7f571083e35bc4056515f64c7adb7325f1a27b57 (patch)
tree6334314440e13f8ffcff27afc0ae7f58de304ea7 /xfa
parent8946aec4c3e727aae806f9858c2329ce368dd517 (diff)
downloadpdfium-7f571083e35bc4056515f64c7adb7325f1a27b57.tar.xz
Remove default values from CJX_Node::{Set|Try}Enum
This CL removes the default value and inlines into the call sites. Change-Id: Ib6bc2b27189be3596e83a8b29b7a6a744278ed34 Reviewed-on: https://pdfium-review.googlesource.com/17570 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fxfa/cxfa_ffwidgethandler.cpp11
-rw-r--r--xfa/fxfa/parser/cxfa_caption.cpp4
-rw-r--r--xfa/fxfa/parser/cxfa_fill.cpp4
-rw-r--r--xfa/fxfa/parser/cxfa_font.cpp6
-rw-r--r--xfa/fxfa/parser/cxfa_image.cpp3
-rw-r--r--xfa/fxfa/parser/cxfa_layoutpagemgr.cpp4
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp4
-rw-r--r--xfa/fxfa/parser/cxfa_para.cpp4
-rw-r--r--xfa/fxfa/parser/cxfa_simple_parser.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.cpp10
-rw-r--r--xfa/fxfa/parser/xfa_document_datamerger_imp.cpp2
11 files changed, 30 insertions, 24 deletions
diff --git a/xfa/fxfa/cxfa_ffwidgethandler.cpp b/xfa/fxfa/cxfa_ffwidgethandler.cpp
index 37d1adab08..7d0649b140 100644
--- a/xfa/fxfa/cxfa_ffwidgethandler.cpp
+++ b/xfa/fxfa/cxfa_ffwidgethandler.cpp
@@ -336,7 +336,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreatePushButton(CXFA_Node* pParent,
false);
CXFA_Node* pBind = CreateCopyNode(XFA_Element::Bind, pField);
- pBind->JSNode()->SetEnum(XFA_ATTRIBUTE_Match, XFA_ATTRIBUTEENUM_None);
+ pBind->JSNode()->SetEnum(XFA_ATTRIBUTE_Match, XFA_ATTRIBUTEENUM_None, false);
return pField;
}
@@ -356,7 +356,8 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateRadioButton(CXFA_Node* pParent,
CXFA_Node* pField = CreateField(XFA_Element::CheckButton, pParent, pBefore);
CXFA_Node* pUi = pField->GetFirstChildByClass(XFA_Element::Ui);
CXFA_Node* pWidget = pUi->GetFirstChildByClass(XFA_Element::CheckButton);
- pWidget->JSNode()->SetEnum(XFA_ATTRIBUTE_Shape, XFA_ATTRIBUTEENUM_Round);
+ pWidget->JSNode()->SetEnum(XFA_ATTRIBUTE_Shape, XFA_ATTRIBUTEENUM_Round,
+ false);
return pField;
}
@@ -399,8 +400,10 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateListBox(CXFA_Node* pParent,
CXFA_Node* pField = CreateDropdownList(pParent, pBefore);
CXFA_Node* pUi = pField->GetNodeItem(XFA_NODEITEM_FirstChild);
CXFA_Node* pListBox = pUi->GetNodeItem(XFA_NODEITEM_FirstChild);
- pListBox->JSNode()->SetEnum(XFA_ATTRIBUTE_Open, XFA_ATTRIBUTEENUM_Always);
- pListBox->JSNode()->SetEnum(XFA_ATTRIBUTE_CommitOn, XFA_ATTRIBUTEENUM_Exit);
+ pListBox->JSNode()->SetEnum(XFA_ATTRIBUTE_Open, XFA_ATTRIBUTEENUM_Always,
+ false);
+ pListBox->JSNode()->SetEnum(XFA_ATTRIBUTE_CommitOn, XFA_ATTRIBUTEENUM_Exit,
+ false);
return pField;
}
diff --git a/xfa/fxfa/parser/cxfa_caption.cpp b/xfa/fxfa/parser/cxfa_caption.cpp
index 6e28609a37..5348a45be4 100644
--- a/xfa/fxfa/parser/cxfa_caption.cpp
+++ b/xfa/fxfa/parser/cxfa_caption.cpp
@@ -13,13 +13,13 @@ CXFA_Caption::CXFA_Caption(CXFA_Node* pNode) : CXFA_Data(pNode) {}
int32_t CXFA_Caption::GetPresence() {
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Visible;
- m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Presence, eAttr);
+ m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Presence, eAttr, true);
return eAttr;
}
int32_t CXFA_Caption::GetPlacementType() {
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Left;
- m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Placement, eAttr);
+ m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Placement, eAttr, true);
return eAttr;
}
diff --git a/xfa/fxfa/parser/cxfa_fill.cpp b/xfa/fxfa/parser/cxfa_fill.cpp
index 8938a1935e..49e710bcaa 100644
--- a/xfa/fxfa/parser/cxfa_fill.cpp
+++ b/xfa/fxfa/parser/cxfa_fill.cpp
@@ -84,7 +84,7 @@ int32_t CXFA_Fill::GetLinear(FX_ARGB& endColor) {
CXFA_Node* pNode =
m_pNode->JSNode()->GetProperty(0, XFA_Element::Linear, true);
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_ToRight;
- pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Type, eAttr);
+ pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Type, eAttr, true);
if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color)) {
WideStringView wsColor;
pColor->JSNode()->TryCData(XFA_ATTRIBUTE_Value, wsColor, false);
@@ -99,7 +99,7 @@ int32_t CXFA_Fill::GetRadial(FX_ARGB& endColor) {
CXFA_Node* pNode =
m_pNode->JSNode()->GetProperty(0, XFA_Element::Radial, true);
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_ToEdge;
- pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Type, eAttr);
+ pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Type, eAttr, true);
if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color)) {
WideStringView wsColor;
pColor->JSNode()->TryCData(XFA_ATTRIBUTE_Value, wsColor, false);
diff --git a/xfa/fxfa/parser/cxfa_font.cpp b/xfa/fxfa/parser/cxfa_font.cpp
index d54ac0ba72..209a3c6778 100644
--- a/xfa/fxfa/parser/cxfa_font.cpp
+++ b/xfa/fxfa/parser/cxfa_font.cpp
@@ -58,7 +58,7 @@ int32_t CXFA_Font::GetUnderline() {
int32_t CXFA_Font::GetUnderlinePeriod() {
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_All;
- m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_UnderlinePeriod, eAttr);
+ m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_UnderlinePeriod, eAttr, true);
return eAttr;
}
@@ -74,13 +74,13 @@ void CXFA_Font::GetTypeface(WideStringView& wsTypeFace) {
bool CXFA_Font::IsBold() {
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Normal;
- m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Weight, eAttr);
+ m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Weight, eAttr, true);
return eAttr == XFA_ATTRIBUTEENUM_Bold;
}
bool CXFA_Font::IsItalic() {
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Normal;
- m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Posture, eAttr);
+ m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Posture, eAttr, true);
return eAttr == XFA_ATTRIBUTEENUM_Italic;
}
diff --git a/xfa/fxfa/parser/cxfa_image.cpp b/xfa/fxfa/parser/cxfa_image.cpp
index 0e23cb1b38..cd25b5a39e 100644
--- a/xfa/fxfa/parser/cxfa_image.cpp
+++ b/xfa/fxfa/parser/cxfa_image.cpp
@@ -52,7 +52,8 @@ bool CXFA_Image::SetHref(const WideString& wsHref) {
bool CXFA_Image::SetTransferEncoding(int32_t iTransferEncoding) {
if (m_bDefValue) {
return m_pNode->JSNode()->SetEnum(XFA_ATTRIBUTE_TransferEncoding,
- (XFA_ATTRIBUTEENUM)iTransferEncoding);
+ (XFA_ATTRIBUTEENUM)iTransferEncoding,
+ false);
}
return true;
}
diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
index 2def914529..a483d71840 100644
--- a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
+++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
@@ -646,7 +646,7 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() {
pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_PagePosition);
if (eCurChoice == XFA_ATTRIBUTEENUM_Last) {
XFA_ATTRIBUTEENUM eOddOrEven = XFA_ATTRIBUTEENUM_Any;
- pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_OddOrEven, eOddOrEven);
+ pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_OddOrEven, eOddOrEven, true);
XFA_ATTRIBUTEENUM eLastChoice =
pLastPageAreaLayoutItem->m_pFormNode->JSNode()->GetEnum(
XFA_ATTRIBUTE_PagePosition);
@@ -1313,7 +1313,7 @@ bool CXFA_LayoutPageMgr::MatchPageAreaOddOrEven(CXFA_Node* pPageArea,
return true;
XFA_ATTRIBUTEENUM eOddOrEven = XFA_ATTRIBUTEENUM_Any;
- pPageArea->JSNode()->TryEnum(XFA_ATTRIBUTE_OddOrEven, eOddOrEven);
+ pPageArea->JSNode()->TryEnum(XFA_ATTRIBUTE_OddOrEven, eOddOrEven, true);
if (eOddOrEven != XFA_ATTRIBUTEENUM_Any) {
int32_t iPageCount = GetPageCount();
if (bLastMatch) {
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 457b8dd436..1d0b639004 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -197,7 +197,7 @@ CXFA_Node* CXFA_Node::Clone(bool bRecursive) {
}
pCloneXML.reset(pCloneXMLElement.release());
pClone->JSNode()->SetEnum(XFA_ATTRIBUTE_Contains,
- XFA_ATTRIBUTEENUM_Unknown);
+ XFA_ATTRIBUTEENUM_Unknown, false);
} else {
pCloneXML = m_pXMLNode->Clone();
}
@@ -1587,7 +1587,7 @@ bool CXFA_Node::RemoveChild(CXFA_Node* pNode, bool bNotify) {
}
pNode->m_pXMLNode = pNewXMLElement;
pNode->JSNode()->SetEnum(XFA_ATTRIBUTE_Contains,
- XFA_ATTRIBUTEENUM_Unknown);
+ XFA_ATTRIBUTEENUM_Unknown, false);
} else {
m_pXMLNode->RemoveChildNode(pNode->m_pXMLNode);
}
diff --git a/xfa/fxfa/parser/cxfa_para.cpp b/xfa/fxfa/parser/cxfa_para.cpp
index 174563bc64..1d7fe2d63c 100644
--- a/xfa/fxfa/parser/cxfa_para.cpp
+++ b/xfa/fxfa/parser/cxfa_para.cpp
@@ -13,13 +13,13 @@ CXFA_Para::CXFA_Para(CXFA_Node* pNode) : CXFA_Data(pNode) {}
int32_t CXFA_Para::GetHorizontalAlign() {
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Left;
- m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_HAlign, eAttr);
+ m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_HAlign, eAttr, true);
return eAttr;
}
int32_t CXFA_Para::GetVerticalAlign() {
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Top;
- m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_VAlign, eAttr);
+ m_pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_VAlign, eAttr, true);
return eAttr;
}
diff --git a/xfa/fxfa/parser/cxfa_simple_parser.cpp b/xfa/fxfa/parser/cxfa_simple_parser.cpp
index 7758ef2ab9..02f927d053 100644
--- a/xfa/fxfa/parser/cxfa_simple_parser.cpp
+++ b/xfa/fxfa/parser/cxfa_simple_parser.cpp
@@ -1092,7 +1092,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode,
pXFAMetaData->JSNode()->SetCData(XFA_ATTRIBUTE_Value, it.second,
false, false);
pXFAMetaData->JSNode()->SetEnum(XFA_ATTRIBUTE_Contains,
- XFA_ATTRIBUTEENUM_MetaData);
+ XFA_ATTRIBUTEENUM_MetaData, false);
pXFAChild->InsertChild(pXFAMetaData);
pXFAMetaData->SetXMLMappingNode(pXMLElement);
pXFAMetaData->SetFlag(XFA_NodeFlag_Initialized, false);
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index 53ab6b4bfe..2dad661c5a 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -1006,12 +1006,13 @@ void CXFA_WidgetData::InsertItem(const WideString& wsLabel,
} else {
CXFA_Node* pNode = listitems[0];
pNode->JSNode()->SetBoolean(XFA_ATTRIBUTE_Save, false);
- pNode->JSNode()->SetEnum(XFA_ATTRIBUTE_Presence, XFA_ATTRIBUTEENUM_Visible);
+ pNode->JSNode()->SetEnum(XFA_ATTRIBUTE_Presence, XFA_ATTRIBUTEENUM_Visible,
+ false);
CXFA_Node* pSaveItems = m_pNode->CreateSamePacketNode(XFA_Element::Items);
m_pNode->InsertChild(-1, pSaveItems);
pSaveItems->JSNode()->SetBoolean(XFA_ATTRIBUTE_Save, true);
pSaveItems->JSNode()->SetEnum(XFA_ATTRIBUTE_Presence,
- XFA_ATTRIBUTEENUM_Hidden);
+ XFA_ATTRIBUTEENUM_Hidden, false);
CXFA_Node* pListNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
int32_t i = 0;
while (pListNode) {
@@ -1196,7 +1197,7 @@ bool CXFA_WidgetData::GetBarcodeAttribute_CharEncoding(int32_t* val) {
bool CXFA_WidgetData::GetBarcodeAttribute_Checksum(bool* val) {
CXFA_Node* pUIChild = GetUIChild();
XFA_ATTRIBUTEENUM eChecksum;
- if (pUIChild->JSNode()->TryEnum(XFA_ATTRIBUTE_Checksum, eChecksum)) {
+ if (pUIChild->JSNode()->TryEnum(XFA_ATTRIBUTE_Checksum, eChecksum, true)) {
switch (eChecksum) {
case XFA_ATTRIBUTEENUM_None:
*val = false;
@@ -1301,7 +1302,8 @@ bool CXFA_WidgetData::GetBarcodeAttribute_PrintChecksum(bool* val) {
bool CXFA_WidgetData::GetBarcodeAttribute_TextLocation(int32_t* val) {
CXFA_Node* pUIChild = GetUIChild();
XFA_ATTRIBUTEENUM eTextLocation;
- if (pUIChild->JSNode()->TryEnum(XFA_ATTRIBUTE_TextLocation, eTextLocation)) {
+ if (pUIChild->JSNode()->TryEnum(XFA_ATTRIBUTE_TextLocation, eTextLocation,
+ true)) {
switch (eTextLocation) {
case XFA_ATTRIBUTEENUM_None:
*val = BC_TEXT_LOC_NONE;
diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
index 478a1783f6..c7354a7a63 100644
--- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
@@ -1067,7 +1067,7 @@ CXFA_Node* MaybeCreateDataNode(CXFA_Document* pDocument,
pDDNode->JSNode()->GetEnum(XFA_ATTRIBUTE_Contains) ==
XFA_ATTRIBUTEENUM_MetaData) {
pDataNode->JSNode()->SetEnum(XFA_ATTRIBUTE_Contains,
- XFA_ATTRIBUTEENUM_MetaData);
+ XFA_ATTRIBUTEENUM_MetaData, false);
}
pDataParent->InsertChild(pDataNode);
pDataNode->SetDataDescriptionNode(pDDNode);