summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_utils.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-13 18:29:02 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-13 18:29:02 +0000
commit2614250d4f11ed02033a7da095a1694ece12ab78 (patch)
treecc41c5770c17ea47537856991fa44cd1e2acfeb8 /xfa/fxfa/parser/xfa_utils.cpp
parent14768f3264a4cff8ca0096a27e41f1861b2c422b (diff)
downloadpdfium-2614250d4f11ed02033a7da095a1694ece12ab78.tar.xz
Methods are on CJX_Object not CJX_Node now
This CL converts all of the JSNode() to JSObject() calls as all of the original CJX_Node methods have been moved to CJX_Object. This fixes potential bad casts from things like CJX_Content which do not inhert from CJX_Node. Bug: pdfium:793372 Change-Id: I6c7f63a78f3d47bb6bad74faed3fd8c535bf095e Reviewed-on: https://pdfium-review.googlesource.com/21090 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/xfa_utils.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_utils.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/xfa/fxfa/parser/xfa_utils.cpp b/xfa/fxfa/parser/xfa_utils.cpp
index 4dbed96f25..6706bb64ee 100644
--- a/xfa/fxfa/parser/xfa_utils.cpp
+++ b/xfa/fxfa/parser/xfa_utils.cpp
@@ -127,7 +127,7 @@ bool AttributeSaveInDataModel(CXFA_Node* pNode, XFA_Attribute eAttribute) {
bool ContentNodeNeedtoExport(CXFA_Node* pContentNode) {
pdfium::Optional<WideString> wsContent =
- pContentNode->JSNode()->TryContent(false, false);
+ pContentNode->JSObject()->TryContent(false, false);
if (!wsContent)
return false;
@@ -154,11 +154,11 @@ void SaveAttribute(CXFA_Node* pNode,
const WideString& wsName,
bool bProto,
WideString& wsOutput) {
- if (!bProto && !pNode->JSNode()->HasAttribute(eName))
+ if (!bProto && !pNode->JSObject()->HasAttribute(eName))
return;
pdfium::Optional<WideString> value =
- pNode->JSNode()->TryAttribute(eName, false);
+ pNode->JSObject()->TryAttribute(eName, false);
if (!value)
return;
@@ -205,7 +205,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode,
break;
pdfium::Optional<WideString> contentType =
- pNode->JSNode()->TryAttribute(XFA_Attribute::ContentType, false);
+ pNode->JSObject()->TryAttribute(XFA_Attribute::ContentType, false);
if (pRawValueNode->GetElementType() == XFA_Element::SharpxHTML &&
(contentType && *contentType == L"text/html")) {
CFX_XMLNode* pExDataXML = pNode->GetXMLMappingNode();
@@ -228,7 +228,8 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode,
} else if (pRawValueNode->GetElementType() == XFA_Element::Sharpxml &&
(contentType && *contentType == L"text/xml")) {
pdfium::Optional<WideString> rawValue =
- pRawValueNode->JSNode()->TryAttribute(XFA_Attribute::Value, false);
+ pRawValueNode->JSObject()->TryAttribute(XFA_Attribute::Value,
+ false);
if (!rawValue || rawValue->IsEmpty())
break;
@@ -251,7 +252,8 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode,
pParentNode->GetNodeItem(XFA_NODEITEM_Parent);
ASSERT(pGrandparentNode);
WideString bodyTagName;
- bodyTagName = pGrandparentNode->JSNode()->GetCData(XFA_Attribute::Name);
+ bodyTagName =
+ pGrandparentNode->JSObject()->GetCData(XFA_Attribute::Name);
if (bodyTagName.IsEmpty())
bodyTagName = L"ListBox1";
@@ -271,7 +273,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode,
buf.Clear();
} else {
WideString wsValue =
- pRawValueNode->JSNode()->GetCData(XFA_Attribute::Value);
+ pRawValueNode->JSObject()->GetCData(XFA_Attribute::Value);
wsChildren += ExportEncodeContent(wsValue);
}
break;
@@ -279,7 +281,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode,
case XFA_ObjectType::TextNode:
case XFA_ObjectType::NodeC:
case XFA_ObjectType::NodeV: {
- WideString wsValue = pNode->JSNode()->GetCData(XFA_Attribute::Value);
+ WideString wsValue = pNode->JSObject()->GetCData(XFA_Attribute::Value);
wsChildren += ExportEncodeContent(wsValue);
break;
}
@@ -316,7 +318,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode,
}
if (!wsChildren.IsEmpty() || !wsAttrs.IsEmpty() ||
- pNode->JSNode()->HasAttribute(XFA_Attribute::Name)) {
+ pNode->JSObject()->HasAttribute(XFA_Attribute::Name)) {
WideStringView wsElement = pNode->GetClassName();
WideString wsName;
SaveAttribute(pNode, XFA_Attribute::Name, L"name", true, wsName);
@@ -396,7 +398,7 @@ void RecognizeXFAVersionNumber(CXFA_Node* pTemplateRoot,
return;
pdfium::Optional<WideString> templateNS =
- pTemplateRoot->JSNode()->TryNamespace();
+ pTemplateRoot->JSObject()->TryNamespace();
if (!templateNS)
return;
@@ -571,7 +573,7 @@ bool XFA_FieldIsMultiListBox(CXFA_Node* pFieldNode) {
CXFA_Node* pFirstChild = pUIChild->GetNodeItem(XFA_NODEITEM_FirstChild);
if (pFirstChild &&
pFirstChild->GetElementType() == XFA_Element::ChoiceList) {
- bRet = pFirstChild->JSNode()->GetEnum(XFA_Attribute::Open) ==
+ bRet = pFirstChild->JSObject()->GetEnum(XFA_Attribute::Open) ==
XFA_AttributeEnum::MultiSelect;
}
}