summaryrefslogtreecommitdiff
path: root/fxjs/cfxjse_formcalc_context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs/cfxjse_formcalc_context.cpp')
-rw-r--r--fxjs/cfxjse_formcalc_context.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/fxjs/cfxjse_formcalc_context.cpp b/fxjs/cfxjse_formcalc_context.cpp
index 4bfe7d8b8b..e7d44d179f 100644
--- a/fxjs/cfxjse_formcalc_context.cpp
+++ b/fxjs/cfxjse_formcalc_context.cpp
@@ -10,6 +10,7 @@
#include <algorithm>
#include <string>
+#include <utility>
#include "core/fxcrt/cfx_decimal.h"
#include "core/fxcrt/cfx_widetextbuf.h"
@@ -5999,18 +6000,21 @@ void CFXJSE_FormCalcContext::ParseResolveResult(
return;
}
- CXFA_ValueArray objectProperties(pIsolate);
- int32_t iRet = resolveNodeRS.GetAttributeResult(&objectProperties);
*bAttribute = true;
- if (iRet != 0) {
- *bAttribute = false;
- for (int32_t i = 0; i < iRet; i++) {
- resultValues->push_back(pdfium::MakeUnique<CFXJSE_Value>(pIsolate));
- resultValues->back()->Assign(objectProperties.m_Values[i].get());
+ if (resolveNodeRS.pScriptAttribute &&
+ resolveNodeRS.pScriptAttribute->eValueType == XFA_ScriptType::Object) {
+ for (CXFA_Object* pObject : resolveNodeRS.objects) {
+ auto pValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ CJX_Object* jsObject = pObject->JSObject();
+ (jsObject->*(resolveNodeRS.pScriptAttribute->callback))(
+ pValue.get(), false, resolveNodeRS.pScriptAttribute->attribute);
+
+ resultValues->push_back(std::move(pValue));
+ *bAttribute = false;
}
- return;
}
-
+ if (!*bAttribute)
+ return;
if (!pParentValue || !pParentValue->IsObject())
return;