diff options
author | tsepez <tsepez@chromium.org> | 2016-08-11 19:50:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-11 19:50:57 -0700 |
commit | d0b6ed1a0842386e474c5fcd6bdbb260bb631bd1 (patch) | |
tree | 6d7282f78ac953fc965e17815bcbef7995dd59ec /fpdfsdk/javascript/Document.cpp | |
parent | 229d05df5bc5deb3890b26b614113c25d9b6935e (diff) | |
download | pdfium-d0b6ed1a0842386e474c5fcd6bdbb260bb631bd1.tar.xz |
Make FXJS_GetObjectElement return std::vector<CFX_WideString>.chromium/2829chromium/2828
Analogous to getting the length of JS array, this result
should be a C++-side object only.
Also rename to FXJS_GetObjectProperty to match JS nomenclature.
Review-Url: https://codereview.chromium.org/2242593002
Diffstat (limited to 'fpdfsdk/javascript/Document.cpp')
-rw-r--r-- | fpdfsdk/javascript/Document.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp index ea77e1cfad..a55bf81139 100644 --- a/fpdfsdk/javascript/Document.cpp +++ b/fpdfsdk/javascript/Document.cpp @@ -615,17 +615,17 @@ FX_BOOL Document::submitForm(IJS_Context* cc, } else if (v.GetType() == CJS_Value::VT_object) { v8::Local<v8::Object> pObj = params[0].ToV8Object(pIsolate); v8::Local<v8::Value> pValue = - FXJS_GetObjectElement(pIsolate, pObj, L"cURL"); + FXJS_GetObjectProperty(pIsolate, pObj, L"cURL"); if (!pValue.IsEmpty()) strURL = CJS_Value(pRuntime, pValue).ToCFXWideString(pIsolate); - pValue = FXJS_GetObjectElement(pIsolate, pObj, L"bFDF"); + pValue = FXJS_GetObjectProperty(pIsolate, pObj, L"bFDF"); bFDF = CJS_Value(pRuntime, pValue).ToBool(pIsolate); - pValue = FXJS_GetObjectElement(pIsolate, pObj, L"bEmpty"); + pValue = FXJS_GetObjectProperty(pIsolate, pObj, L"bEmpty"); bEmpty = CJS_Value(pRuntime, pValue).ToBool(pIsolate); - pValue = FXJS_GetObjectElement(pIsolate, pObj, L"aFields"); + pValue = FXJS_GetObjectProperty(pIsolate, pObj, L"aFields"); aFields.Attach(CJS_Value(pRuntime, pValue).ToV8Array(pIsolate)); } @@ -712,22 +712,23 @@ FX_BOOL Document::mailDoc(IJS_Context* cc, if (params.size() >= 1 && params[0].GetType() == CJS_Value::VT_object) { v8::Local<v8::Object> pObj = params[0].ToV8Object(pIsolate); - v8::Local<v8::Value> pValue = FXJS_GetObjectElement(pIsolate, pObj, L"bUI"); + v8::Local<v8::Value> pValue = + FXJS_GetObjectProperty(pIsolate, pObj, L"bUI"); bUI = CJS_Value(pRuntime, pValue).ToInt(pIsolate); - pValue = FXJS_GetObjectElement(pIsolate, pObj, L"cTo"); + pValue = FXJS_GetObjectProperty(pIsolate, pObj, L"cTo"); cTo = CJS_Value(pRuntime, pValue).ToCFXWideString(pIsolate); - pValue = FXJS_GetObjectElement(pIsolate, pObj, L"cCc"); + pValue = FXJS_GetObjectProperty(pIsolate, pObj, L"cCc"); cCc = CJS_Value(pRuntime, pValue).ToCFXWideString(pIsolate); - pValue = FXJS_GetObjectElement(pIsolate, pObj, L"cBcc"); + pValue = FXJS_GetObjectProperty(pIsolate, pObj, L"cBcc"); cBcc = CJS_Value(pRuntime, pValue).ToCFXWideString(pIsolate); - pValue = FXJS_GetObjectElement(pIsolate, pObj, L"cSubject"); + pValue = FXJS_GetObjectProperty(pIsolate, pObj, L"cSubject"); cSubject = CJS_Value(pRuntime, pValue).ToCFXWideString(pIsolate); - pValue = FXJS_GetObjectElement(pIsolate, pObj, L"cMsg"); + pValue = FXJS_GetObjectProperty(pIsolate, pObj, L"cMsg"); cMsg = CJS_Value(pRuntime, pValue).ToCFXWideString(pIsolate); } |