summaryrefslogtreecommitdiff
path: root/fxjs
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-02 19:09:58 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-02 19:09:58 +0000
commit3ac07ffafea1ee4d3cf985e32692849dd3fcfdfb (patch)
tree3edbd3db87541a57fa0ee172bd50b70d35d45a11 /fxjs
parentbf29e5b532e4ef9a309906083b33b6d4c48ff757 (diff)
downloadpdfium-3ac07ffafea1ee4d3cf985e32692849dd3fcfdfb.tar.xz
Cleanup params to CJX_Node::TryCData
This CL removes the bProto param as it was never set and inlines the value where needed in the methods. The default value was removed from bUseDefault and inlined into callsites as needed. Change-Id: I773261d19aa3799bc607e7df482b5f5e5217bee6 Reviewed-on: https://pdfium-review.googlesource.com/17533 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs')
-rw-r--r--fxjs/cfxjse_engine.cpp2
-rw-r--r--fxjs/cjx_node.cpp16
-rw-r--r--fxjs/cjx_node.h10
3 files changed, 10 insertions, 18 deletions
diff --git a/fxjs/cfxjse_engine.cpp b/fxjs/cfxjse_engine.cpp
index 5fa0a11e21..fb36c6dba0 100644
--- a/fxjs/cfxjse_engine.cpp
+++ b/fxjs/cfxjse_engine.cpp
@@ -483,7 +483,7 @@ bool CFXJSE_Engine::RunVariablesScript(CXFA_Node* pScriptNode) {
return false;
WideStringView wsScript;
- if (!pTextNode->JSNode()->TryCData(XFA_ATTRIBUTE_Value, wsScript))
+ if (!pTextNode->JSNode()->TryCData(XFA_ATTRIBUTE_Value, wsScript, true))
return false;
ByteString btScript = FX_UTF8Encode(wsScript);
diff --git a/fxjs/cjx_node.cpp b/fxjs/cjx_node.cpp
index 0c78f99551..c6e60933f0 100644
--- a/fxjs/cjx_node.cpp
+++ b/fxjs/cjx_node.cpp
@@ -3031,7 +3031,7 @@ CXFA_Measurement CJX_Node::GetMeasure(XFA_ATTRIBUTE eAttr) const {
WideStringView CJX_Node::GetCData(XFA_ATTRIBUTE eAttr) {
WideStringView wsValue;
- return TryCData(eAttr, wsValue) ? wsValue : WideStringView();
+ return TryCData(eAttr, wsValue, true) ? wsValue : WideStringView();
}
bool CJX_Node::SetCData(XFA_ATTRIBUTE eAttr,
@@ -3166,11 +3166,10 @@ bool CJX_Node::SetAttributeValue(const WideString& wsValue,
bool CJX_Node::TryCData(XFA_ATTRIBUTE eAttr,
WideString& wsValue,
- bool bUseDefault,
- bool bProto) {
+ bool bUseDefault) {
void* pKey = GetMapKey_Element(GetXFANode()->GetElementType(), eAttr);
if (eAttr == XFA_ATTRIBUTE_Value) {
- WideString* pStr = (WideString*)GetUserData(pKey, bProto);
+ WideString* pStr = (WideString*)GetUserData(pKey, true);
if (pStr) {
wsValue = *pStr;
return true;
@@ -3197,11 +3196,10 @@ bool CJX_Node::TryCData(XFA_ATTRIBUTE eAttr,
bool CJX_Node::TryCData(XFA_ATTRIBUTE eAttr,
WideStringView& wsValue,
- bool bUseDefault,
- bool bProto) {
+ bool bUseDefault) {
void* pKey = GetMapKey_Element(GetXFANode()->GetElementType(), eAttr);
if (eAttr == XFA_ATTRIBUTE_Value) {
- WideString* pStr = (WideString*)GetUserData(pKey, bProto);
+ WideString* pStr = (WideString*)GetUserData(pKey, true);
if (pStr) {
wsValue = pStr->AsStringView();
return true;
@@ -3556,7 +3554,7 @@ bool CJX_Node::TryContent(WideString& wsContent,
GetXFANode()->InsertChild(pContentRawDataNode);
}
return pContentRawDataNode->JSNode()->TryContent(wsContent, bScriptModify,
- bProto);
+ true);
}
case XFA_ObjectType::NodeC:
case XFA_ObjectType::NodeV:
@@ -3575,7 +3573,7 @@ bool CJX_Node::TryContent(WideString& wsContent,
GetDocument()->GetScriptContext()->AddNodesOfRunScript(GetXFANode());
}
}
- return TryCData(XFA_ATTRIBUTE_Value, wsContent, false, bProto);
+ return TryCData(XFA_ATTRIBUTE_Value, wsContent, false);
}
return false;
}
diff --git a/fxjs/cjx_node.h b/fxjs/cjx_node.h
index 863dcc53af..df360011a4 100644
--- a/fxjs/cjx_node.h
+++ b/fxjs/cjx_node.h
@@ -84,14 +84,8 @@ class CJX_Node : public CJX_Object {
bool SetInteger(XFA_ATTRIBUTE eAttr, int32_t iValue, bool bNotify);
int32_t GetInteger(XFA_ATTRIBUTE eAttr);
- bool TryCData(XFA_ATTRIBUTE eAttr,
- WideStringView& wsValue,
- bool bUseDefault = true,
- bool bProto = true);
- bool TryCData(XFA_ATTRIBUTE eAttr,
- WideString& wsValue,
- bool bUseDefault = true,
- bool bProto = true);
+ bool TryCData(XFA_ATTRIBUTE eAttr, WideStringView& wsValue, bool bUseDefault);
+ bool TryCData(XFA_ATTRIBUTE eAttr, WideString& wsValue, bool bUseDefault);
bool SetCData(XFA_ATTRIBUTE eAttr,
const WideString& wsValue,
bool bNotify = false,