From 8b0cf76f00c6e89e8bb7bf4bcf2189b27baac31c Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Mon, 16 Apr 2018 21:24:57 +0000 Subject: Merge CFX_XMLElement and CFX_XMLAttributeNode CFX_XMLElement is the only subclass of CFX_XMLAttributeNode. This CL merges the two classes together. The {Set|Get}String method has been renamed to {Set|Get}Attribute to make it clearer what you're retrieving. Change-Id: I158c961d4d8c5f563d937a3e7a35321a33622562 Reviewed-on: https://pdfium-review.googlesource.com/30710 Commit-Queue: dsinclair Reviewed-by: Henrique Nakashima --- fxjs/xfa/cjx_object.cpp | 12 ++++++------ fxjs/xfa/cjx_packet.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'fxjs') diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp index ab22e8b7e7..2ea69d43c8 100644 --- a/fxjs/xfa/cjx_object.cpp +++ b/fxjs/xfa/cjx_object.cpp @@ -343,7 +343,7 @@ bool CJX_Object::SetBoolean(XFA_Attribute eAttr, bool bValue, bool bNotify) { CFX_XMLElement* elem = SetValue(eAttr, XFA_AttributeType::Boolean, (void*)(uintptr_t)bValue, bNotify); if (elem) - elem->SetString(CXFA_Node::AttributeToName(eAttr), bValue ? L"1" : L"0"); + elem->SetAttribute(CXFA_Node::AttributeToName(eAttr), bValue ? L"1" : L"0"); return true; } @@ -355,8 +355,8 @@ bool CJX_Object::SetInteger(XFA_Attribute eAttr, int32_t iValue, bool bNotify) { CFX_XMLElement* elem = SetValue(eAttr, XFA_AttributeType::Integer, (void*)(uintptr_t)iValue, bNotify); if (elem) { - elem->SetString(CXFA_Node::AttributeToName(eAttr), - WideString::Format(L"%d", iValue)); + elem->SetAttribute(CXFA_Node::AttributeToName(eAttr), + WideString::Format(L"%d", iValue)); } return true; } @@ -397,8 +397,8 @@ bool CJX_Object::SetEnum(XFA_Attribute eAttr, CFX_XMLElement* elem = SetValue(eAttr, XFA_AttributeType::Enum, (void*)(uintptr_t)eValue, bNotify); if (elem) { - elem->SetString(CXFA_Node::AttributeToName(eAttr), - CXFA_Node::AttributeEnumToName(eValue)); + elem->SetAttribute(CXFA_Node::AttributeToName(eAttr), + CXFA_Node::AttributeEnumToName(eValue)); } return true; } @@ -487,7 +487,7 @@ bool CJX_Object::SetCData(XFA_Attribute eAttr, if (eAttr == XFA_Attribute::ContentType) wsAttrName = L"xfa:" + wsAttrName; - elem->SetString(wsAttrName, wsValue); + elem->SetAttribute(wsAttrName, wsValue); return true; } diff --git a/fxjs/xfa/cjx_packet.cpp b/fxjs/xfa/cjx_packet.cpp index 80b391c87b..bd39ec0538 100644 --- a/fxjs/xfa/cjx_packet.cpp +++ b/fxjs/xfa/cjx_packet.cpp @@ -32,7 +32,7 @@ CJS_Return CJX_Packet::getAttribute( WideString attributeValue; CFX_XMLNode* pXMLNode = GetXFANode()->GetXMLMappingNode(); if (pXMLNode && pXMLNode->GetType() == FX_XMLNODE_Element) { - attributeValue = static_cast(pXMLNode)->GetString( + attributeValue = static_cast(pXMLNode)->GetAttribute( runtime->ToWideString(params[0]).c_str()); } return CJS_Return( @@ -47,7 +47,7 @@ CJS_Return CJX_Packet::setAttribute( CFX_XMLNode* pXMLNode = GetXFANode()->GetXMLMappingNode(); if (pXMLNode && pXMLNode->GetType() == FX_XMLNODE_Element) { - static_cast(pXMLNode)->SetString( + static_cast(pXMLNode)->SetAttribute( runtime->ToWideString(params[1]), runtime->ToWideString(params[0])); } return CJS_Return(runtime->NewNull()); -- cgit v1.2.3