summaryrefslogtreecommitdiff
path: root/fxjs
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-10-12 23:21:58 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-12 23:21:58 +0000
commitb14a2f2e28d94d4a85b762a5eac9414b2a328bc6 (patch)
treeef149de8a6d89fafca08e6cb98d7ae84a25613ca /fxjs
parentc98c7ec3f2827d92dd0575fb6b340d968dbba6b7 (diff)
downloadpdfium-b14a2f2e28d94d4a85b762a5eac9414b2a328bc6.tar.xz
Beef up coverage in CJS_Field.
Still a long way to go, but hit the easy ones first. Alphabetize property names in cjs_field.cpp file. Change-Id: I1ede770a1e159d464287775cf9e19cbaf9f2a62f Reviewed-on: https://pdfium-review.googlesource.com/c/43978 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs')
-rw-r--r--fxjs/cjs_field.cpp22
-rw-r--r--fxjs/cjs_field.h2
2 files changed, 12 insertions, 12 deletions
diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp
index ca8c62451c..35e2bb51b0 100644
--- a/fxjs/cjs_field.cpp
+++ b/fxjs/cjs_field.cpp
@@ -511,6 +511,7 @@ const JSPropertySpec CJS_Field::PropertySpecs[] = {
{"richText", get_rich_text_static, set_rich_text_static},
{"richValue", get_rich_value_static, set_rich_value_static},
{"rotation", get_rotation_static, set_rotation_static},
+ {"source", get_source_static, set_source_static},
{"strokeColor", get_stroke_color_static, set_stroke_color_static},
{"style", get_style_static, set_style_static},
{"submitName", get_submit_name_static, set_submit_name_static},
@@ -520,8 +521,7 @@ const JSPropertySpec CJS_Field::PropertySpecs[] = {
{"type", get_type_static, set_type_static},
{"userName", get_user_name_static, set_user_name_static},
{"value", get_value_static, set_value_static},
- {"valueAsString", get_value_as_string_static, set_value_as_string_static},
- {"source", get_source_static, set_source_static}};
+ {"valueAsString", get_value_as_string_static, set_value_as_string_static}};
const JSMethodSpec CJS_Field::MethodSpecs[] = {
{"browseForFileToSubmit", browseForFileToSubmit_static},
@@ -1806,6 +1806,15 @@ CJS_Result CJS_Field::set_rotation(CJS_Runtime* pRuntime,
return CJS_Result::Success();
}
+CJS_Result CJS_Field::get_source(CJS_Runtime* pRuntime) {
+ return CJS_Result::Success();
+}
+
+CJS_Result CJS_Field::set_source(CJS_Runtime* pRuntime,
+ v8::Local<v8::Value> vp) {
+ return CJS_Result::Success();
+}
+
CJS_Result CJS_Field::get_stroke_color(CJS_Runtime* pRuntime) {
CPDF_FormField* pFormField = GetFirstFormField();
if (!pFormField)
@@ -2566,15 +2575,6 @@ CJS_Result CJS_Field::signatureValidate(
return CJS_Result::Failure(JSMessage::kNotSupportedError);
}
-CJS_Result CJS_Field::get_source(CJS_Runtime* pRuntime) {
- return CJS_Result::Success();
-}
-
-CJS_Result CJS_Field::set_source(CJS_Runtime* pRuntime,
- v8::Local<v8::Value> vp) {
- return CJS_Result::Success();
-}
-
void CJS_Field::AddDelay_Int(FIELD_PROP prop, int32_t n) {
auto pNewData =
pdfium::MakeUnique<CJS_DelayData>(prop, m_nFormControlIndex, m_FieldName);
diff --git a/fxjs/cjs_field.h b/fxjs/cjs_field.h
index d4abb693bf..290192afaa 100644
--- a/fxjs/cjs_field.h
+++ b/fxjs/cjs_field.h
@@ -80,6 +80,7 @@ class CJS_Field final : public CJS_Object {
JS_STATIC_PROP(richText, rich_text, CJS_Field);
JS_STATIC_PROP(richValue, rich_value, CJS_Field);
JS_STATIC_PROP(rotation, rotation, CJS_Field);
+ JS_STATIC_PROP(source, source, CJS_Field);
JS_STATIC_PROP(strokeColor, stroke_color, CJS_Field);
JS_STATIC_PROP(style, style, CJS_Field);
JS_STATIC_PROP(submitName, submit_name, CJS_Field);
@@ -90,7 +91,6 @@ class CJS_Field final : public CJS_Object {
JS_STATIC_PROP(userName, user_name, CJS_Field);
JS_STATIC_PROP(value, value, CJS_Field);
JS_STATIC_PROP(valueAsString, value_as_string, CJS_Field);
- JS_STATIC_PROP(source, source, CJS_Field);
JS_STATIC_METHOD(browseForFileToSubmit, CJS_Field);
JS_STATIC_METHOD(buttonGetCaption, CJS_Field);