summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Field.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-23 12:08:34 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-23 18:03:39 +0000
commit0e187d80179fe63c11cfb710ecd18b95b39dfa10 (patch)
tree29d9a0f91ab44c4d6bca5e9c900c01e7bf2d380d /fpdfsdk/javascript/Field.cpp
parent4b172c4934ddda46e06b1c4dc7554e96e1a2f54a (diff)
downloadpdfium-0e187d80179fe63c11cfb710ecd18b95b39dfa10.tar.xz
Cleanup some javascript color code
This CL changes the color conversion methods to return their result instead of taking an out param. Change-Id: I19ca2b395145866533c7f93cbad80cdf4d7df05d Reviewed-on: https://pdfium-review.googlesource.com/16530 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/Field.cpp')
-rw-r--r--fpdfsdk/javascript/Field.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp
index b6c32b5208..155e7cea43 100644
--- a/fpdfsdk/javascript/Field.cpp
+++ b/fpdfsdk/javascript/Field.cpp
@@ -1229,7 +1229,6 @@ bool Field::set_file_select(CJS_Runtime* pRuntime,
bool Field::get_fill_color(CJS_Runtime* pRuntime,
CJS_Value* vp,
WideString* sError) {
- CJS_Array crArray;
std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
if (FieldArray.empty())
return false;
@@ -1264,8 +1263,7 @@ bool Field::get_fill_color(CJS_Runtime* pRuntime,
return false;
}
- color::ConvertPWLColorToArray(pRuntime, color, &crArray);
- vp->Set(pRuntime, crArray);
+ vp->Set(pRuntime, color::ConvertPWLColorToArray(pRuntime, color));
return true;
}
@@ -1963,9 +1961,7 @@ bool Field::get_stroke_color(CJS_Runtime* pRuntime,
return false;
}
- CJS_Array crArray;
- color::ConvertPWLColorToArray(pRuntime, color, &crArray);
- vp->Set(pRuntime, crArray);
+ vp->Set(pRuntime, color::ConvertPWLColorToArray(pRuntime, color));
return true;
}
@@ -2073,9 +2069,7 @@ bool Field::get_text_color(CJS_Runtime* pRuntime,
if (iColorType == CFX_Color::kTransparent)
crRet = CFX_Color(CFX_Color::kTransparent);
- CJS_Array crArray;
- color::ConvertPWLColorToArray(pRuntime, crRet, &crArray);
- vp->Set(pRuntime, crArray);
+ vp->Set(pRuntime, color::ConvertPWLColorToArray(pRuntime, crRet));
return true;
}