From aee28693976cc246eea8230a999906802e52cab7 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 14 Nov 2017 21:19:44 +0000 Subject: Cleanup XFA default value code This CL adds helper methods to CXFA_Node to retrieve the default values for attributes with the correct data types. Change-Id: I644435b4b430819f1060a95fa4fffe4ba2826cfe Reviewed-on: https://pdfium-review.googlesource.com/18450 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_document.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_document.cpp') diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp index c374b762ba..f5a72bde9a 100644 --- a/xfa/fxfa/parser/cxfa_document.cpp +++ b/xfa/fxfa/parser/cxfa_document.cpp @@ -333,7 +333,7 @@ CXFA_Node* CXFA_Document::GetNodeByID(CXFA_Node* pRoot, CXFA_NodeIterator sIterator(pRoot); for (CXFA_Node* pNode = sIterator.GetCurrent(); pNode; pNode = sIterator.MoveToNext()) { - WideStringView wsIDVal; + WideString wsIDVal; if (pNode->JSNode()->TryCData(XFA_Attribute::Id, wsIDVal, true) && !wsIDVal.IsEmpty()) { if (wsIDVal == wsID) @@ -353,12 +353,12 @@ void CXFA_Document::DoProtoMerge() { CXFA_NodeIterator sIterator(pTemplateRoot); for (CXFA_Node* pNode = sIterator.GetCurrent(); pNode; pNode = sIterator.MoveToNext()) { - WideStringView wsIDVal; + WideString wsIDVal; if (pNode->JSNode()->TryCData(XFA_Attribute::Id, wsIDVal, true) && !wsIDVal.IsEmpty()) { - mIDMap[FX_HashCode_GetW(wsIDVal, false)] = pNode; + mIDMap[FX_HashCode_GetW(wsIDVal.AsStringView(), false)] = pNode; } - WideStringView wsUseVal; + WideString wsUseVal; if (pNode->JSNode()->TryCData(XFA_Attribute::Use, wsUseVal, true) && !wsUseVal.IsEmpty()) { sUseNodes.insert(pNode); -- cgit v1.2.3