summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_object_imp.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-05-31 11:34:04 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-31 11:34:04 -0700
commit86fad999ba59b1f8780582cc683b008880aab42e (patch)
treebc63f57e472a4aca6c2316eea4707d0aa415c122 /xfa/fxfa/parser/xfa_object_imp.cpp
parent4dce6d4689d464c3a8825a5d6aa790adfc9228ee (diff)
downloadpdfium-86fad999ba59b1f8780582cc683b008880aab42e.tar.xz
Replace CFXJSE_Value create/destroy with new and delete.
In most cases, the destroy calls were removed and the object wrapped in a unique_ptr. Review-Url: https://codereview.chromium.org/2014323003
Diffstat (limited to 'xfa/fxfa/parser/xfa_object_imp.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_object_imp.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp
index 53c8847be8..0b1209734f 100644
--- a/xfa/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/fxfa/parser/xfa_object_imp.cpp
@@ -654,20 +654,19 @@ void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) {
if (iRet < 1) {
return FXJSE_Value_SetNull(pArguments->GetReturnValue());
}
- CFXJSE_Value* pValue = nullptr;
if (resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) {
CXFA_Object* pNode = resoveNodeRS.nodes[0];
- pValue = pScriptContext->GetJSValueFromMap(pNode);
- FXJSE_Value_Set(pArguments->GetReturnValue(), pValue);
+ FXJSE_Value_Set(pArguments->GetReturnValue(),
+ pScriptContext->GetJSValueFromMap(pNode));
} else {
const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo =
resoveNodeRS.pScriptAttribute;
if (lpAttributeInfo && lpAttributeInfo->eValueType == XFA_SCRIPT_Object) {
- pValue = FXJSE_Value_Create(pScriptContext->GetRuntime());
+ std::unique_ptr<CFXJSE_Value> pValue(
+ new CFXJSE_Value(pScriptContext->GetRuntime()));
(resoveNodeRS.nodes[0]->*(lpAttributeInfo->lpfnCallback))(
- pValue, FALSE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
- FXJSE_Value_Set(pArguments->GetReturnValue(), pValue);
- FXJSE_Value_Release(pValue);
+ pValue.get(), FALSE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
+ FXJSE_Value_Set(pArguments->GetReturnValue(), pValue.get());
} else {
FXJSE_Value_SetNull(pArguments->GetReturnValue());
}