From b14a2f2e28d94d4a85b762a5eac9414b2a328bc6 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 12 Oct 2018 23:21:58 +0000 Subject: 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 Commit-Queue: Tom Sepez --- fxjs/cjs_field.cpp | 22 +++++++++++----------- fxjs/cjs_field.h | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'fxjs') 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 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 vp) { - return CJS_Result::Success(); -} - void CJS_Field::AddDelay_Int(FIELD_PROP prop, int32_t n) { auto pNewData = pdfium::MakeUnique(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); -- cgit v1.2.3