diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-10-23 09:44:30 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-23 17:57:28 +0000 |
commit | 33d13f2231a07e7b32ff25da6a6a28cb619d18a9 (patch) | |
tree | 8be1d6a857dff58d8aacbc1dc722fceac8343235 /fpdfsdk/javascript/PublicMethods.cpp | |
parent | c970895f94cf76eb738d0a583ae139fecdd85268 (diff) | |
download | pdfium-33d13f2231a07e7b32ff25da6a6a28cb619d18a9.tar.xz |
Remove CJS_PropValue
This CL removes the CJS_PropValue class and uses CJS_Value directly. The
various Set methods have been moved to CJS_Value and the runtime provided as
needed.
Change-Id: Ib5d3b9efc9b6cf8182be8f19af98599379c3d7db
Reviewed-on: https://pdfium-review.googlesource.com/16431
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/PublicMethods.cpp')
-rw-r--r-- | fpdfsdk/javascript/PublicMethods.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp index 6e0ebef0e8..a48f647b77 100644 --- a/fpdfsdk/javascript/PublicMethods.cpp +++ b/fpdfsdk/javascript/PublicMethods.cpp @@ -847,10 +847,7 @@ bool CJS_PublicMethods::AFNumber_Format(CJS_Runtime* pRuntime, arColor.SetElement(pRuntime, 2, vColElm); arColor.SetElement(pRuntime, 3, vColElm); - CJS_PropValue vProp(pRuntime); - vProp.StartGetting(); - vProp.Set(arColor); - vProp.StartSetting(); + CJS_Value vProp(pRuntime, arColor); fTarget->set_text_color(pRuntime, vProp, &sError); // red } } @@ -866,21 +863,18 @@ bool CJS_PublicMethods::AFNumber_Format(CJS_Runtime* pRuntime, arColor.SetElement(pRuntime, 2, vColElm); arColor.SetElement(pRuntime, 3, vColElm); - CJS_PropValue vProp(pRuntime); - vProp.StartGetting(); + CJS_Value vProp(pRuntime); fTarget->get_text_color(pRuntime, &vProp, &sError); - CJS_Array aProp = vProp.GetJSValue()->ToArray(pRuntime); + CJS_Array aProp = vProp.ToArray(pRuntime); CFX_Color crProp; CFX_Color crColor; color::ConvertArrayToPWLColor(pRuntime, aProp, &crProp); color::ConvertArrayToPWLColor(pRuntime, arColor, &crColor); if (crColor != crProp) { - CJS_PropValue vProp2(pRuntime); - vProp2.StartGetting(); - vProp2.Set(arColor); - vProp2.StartSetting(); + CJS_Value vProp2(pRuntime, arColor); + fTarget->set_text_color(pRuntime, vProp2, &sError); } } |