From 9d608ff14177cd665f6b2ead639415bda935fbe2 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 16 Nov 2017 14:17:17 +0000 Subject: Cleanup CJX_Node::GetAttribute This CL renames GetAttribute to TryAttribute and changes to return a pdfium::Optional instead of a boolean with an out parameter. GetAttribute is then added to call TryAttribute to mirror the other methods in the file. Change-Id: I875dac120776af7c53fe069e4dd36e5486838447 Reviewed-on: https://pdfium-review.googlesource.com/18514 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- xfa/fxfa/parser/cxfa_nodelocale.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_nodelocale.cpp') diff --git a/xfa/fxfa/parser/cxfa_nodelocale.cpp b/xfa/fxfa/parser/cxfa_nodelocale.cpp index 25086922a7..da64c4a04c 100644 --- a/xfa/fxfa/parser/cxfa_nodelocale.cpp +++ b/xfa/fxfa/parser/cxfa_nodelocale.cpp @@ -135,11 +135,9 @@ CXFA_Node* CXFA_NodeLocale::GetNodeByName(CXFA_Node* pParent, CXFA_Node* pChild = pParent ? pParent->GetNodeItem(XFA_NODEITEM_FirstChild) : nullptr; while (pChild) { - WideString wsChild; - if (pChild->JSNode()->GetAttribute(XFA_Attribute::Name, wsChild, true)) { - if (wsChild == wsName) - return pChild; - } + if (pChild->JSNode()->GetAttribute(XFA_Attribute::Name) == wsName) + return pChild; + pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling); } return nullptr; -- cgit v1.2.3