diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-10-23 12:08:34 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-23 18:03:39 +0000 |
commit | 0e187d80179fe63c11cfb710ecd18b95b39dfa10 (patch) | |
tree | 29d9a0f91ab44c4d6bca5e9c900c01e7bf2d380d /fpdfsdk/javascript/PublicMethods.cpp | |
parent | 4b172c4934ddda46e06b1c4dc7554e96e1a2f54a (diff) | |
download | pdfium-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/PublicMethods.cpp')
-rw-r--r-- | fpdfsdk/javascript/PublicMethods.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp index 2e7387e9d2..5e428007ad 100644 --- a/fpdfsdk/javascript/PublicMethods.cpp +++ b/fpdfsdk/javascript/PublicMethods.cpp @@ -924,16 +924,12 @@ bool CJS_PublicMethods::AFNumber_Format(CJS_Runtime* pRuntime, CJS_Value vProp(pRuntime); fTarget->get_text_color(pRuntime, &vProp, &sError); - CJS_Array aProp = vProp.ToArray(pRuntime); - CFX_Color crProp; - CFX_Color crColor; - color::ConvertArrayToPWLColor(pRuntime, aProp, &crProp); - color::ConvertArrayToPWLColor(pRuntime, arColor, &crColor); - + CFX_Color crProp = + color::ConvertArrayToPWLColor(pRuntime, vProp.ToArray(pRuntime)); + CFX_Color crColor = color::ConvertArrayToPWLColor(pRuntime, arColor); if (crColor != crProp) { - CJS_Value vProp2(pRuntime, arColor); - - fTarget->set_text_color(pRuntime, vProp2, &sError); + fTarget->set_text_color(pRuntime, CJS_Value(pRuntime, arColor), + &sError); } } } |