Remove default value from CJX_Node::HasAttribute

The attribute is always false, removed and simplified the code.

Change-Id: Ic20ffe8d91fc3fcd66835e1bc2b1bce3da69be16
Reviewed-on: https://pdfium-review.googlesource.com/17316
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
diff --git a/fxjs/cjx_node.cpp b/fxjs/cjx_node.cpp
index 1f39245..929a946 100644
--- a/fxjs/cjx_node.cpp
+++ b/fxjs/cjx_node.cpp
@@ -191,9 +191,9 @@
   return static_cast<const CXFA_Node*>(GetXFAObject());
 }
 
-bool CJX_Node::HasAttribute(XFA_ATTRIBUTE eAttr, bool bCanInherit) {
+bool CJX_Node::HasAttribute(XFA_ATTRIBUTE eAttr) {
   void* pKey = GetMapKey_Element(GetXFANode()->GetElementType(), eAttr);
-  return HasMapModuleKey(pKey, bCanInherit);
+  return HasMapModuleKey(pKey);
 }
 
 bool CJX_Node::SetAttribute(XFA_ATTRIBUTE eAttr,
@@ -3709,23 +3709,10 @@
   return true;
 }
 
-bool CJX_Node::HasMapModuleKey(void* pKey, bool bProtoAlso) {
-  for (CXFA_Node* pNode = GetXFANode(); pNode;
-       pNode = pNode->GetTemplateNode()) {
-    XFA_MAPMODULEDATA* pModule = pNode->JSNode()->GetMapModuleData();
-    if (pModule) {
-      auto it1 = pModule->m_ValueMap.find(pKey);
-      if (it1 != pModule->m_ValueMap.end())
-        return true;
-
-      auto it2 = pModule->m_BufferMap.find(pKey);
-      if (it2 != pModule->m_BufferMap.end())
-        return true;
-    }
-    if (!bProtoAlso || pNode->GetPacketID() == XFA_XDPPACKET_Datasets)
-      break;
-  }
-  return false;
+bool CJX_Node::HasMapModuleKey(void* pKey) {
+  XFA_MAPMODULEDATA* pModule = GetXFANode()->JSNode()->GetMapModuleData();
+  return pModule && (pdfium::ContainsKey(pModule->m_ValueMap, pKey) ||
+                     pdfium::ContainsKey(pModule->m_BufferMap, pKey));
 }
 
 void CJX_Node::RemoveMapModuleKey(void* pKey) {
diff --git a/fxjs/cjx_node.h b/fxjs/cjx_node.h
index a70cec3..abac540 100644
--- a/fxjs/cjx_node.h
+++ b/fxjs/cjx_node.h
@@ -52,7 +52,7 @@
   CXFA_Node* GetXFANode();
   const CXFA_Node* GetXFANode() const;
 
-  bool HasAttribute(XFA_ATTRIBUTE eAttr, bool bCanInherit = false);
+  bool HasAttribute(XFA_ATTRIBUTE eAttr);
   bool SetAttribute(XFA_ATTRIBUTE eAttr,
                     const WideStringView& wsValue,
                     bool bNotify = false);
@@ -490,7 +490,7 @@
                           void*& pValue,
                           int32_t& iBytes,
                           bool bProtoAlso = true) const;
-  bool HasMapModuleKey(void* pKey, bool bProtoAlso = false);
+  bool HasMapModuleKey(void* pKey);
   void RemoveMapModuleKey(void* pKey = nullptr);
   void MoveBufferMapData(CXFA_Node* pDstModule, void* pKey);
   void MoveBufferMapData(CXFA_Node* pSrcModule,
diff --git a/xfa/fxfa/parser/cxfa_dataexporter.cpp b/xfa/fxfa/parser/cxfa_dataexporter.cpp
index aeee2c1..70f9513 100644
--- a/xfa/fxfa/parser/cxfa_dataexporter.cpp
+++ b/xfa/fxfa/parser/cxfa_dataexporter.cpp
@@ -91,9 +91,8 @@
                    bool bProto,
                    WideString& wsOutput) {
   WideString wsValue;
-  if ((!bProto &&
-       !pNode->JSNode()->HasAttribute((XFA_ATTRIBUTE)eName, bProto)) ||
-      !pNode->JSNode()->GetAttribute((XFA_ATTRIBUTE)eName, wsValue, false)) {
+  if ((!bProto && !pNode->JSNode()->HasAttribute(eName)) ||
+      !pNode->JSNode()->GetAttribute(eName, wsValue, false)) {
     return;
   }
   wsValue = ExportEncodeAttribute(wsValue);