diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-01 21:08:08 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-01 21:08:08 +0000 |
commit | 68bc6ad5a70fdb35ae5c088bd3ca977e15ea9573 (patch) | |
tree | bf9fe46760662f178bd97f77d5e9537947109f88 /fxjs/cjx_node.cpp | |
parent | 14fe518ae67eac22cc169517e69092f62a195913 (diff) | |
download | pdfium-68bc6ad5a70fdb35ae5c088bd3ca977e15ea9573.tar.xz |
Remove default value from CJX_Node::HasAttributechromium/3256
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>
Diffstat (limited to 'fxjs/cjx_node.cpp')
-rw-r--r-- | fxjs/cjx_node.cpp | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/fxjs/cjx_node.cpp b/fxjs/cjx_node.cpp index 1f39245c73..929a946c09 100644 --- a/fxjs/cjx_node.cpp +++ b/fxjs/cjx_node.cpp @@ -191,9 +191,9 @@ const CXFA_Node* CJX_Node::GetXFANode() const { 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 @@ bool CJX_Node::GetMapModuleBuffer(void* pKey, 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) { |