From 33d13f2231a07e7b32ff25da6a6a28cb619d18a9 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 23 Oct 2017 09:44:30 -0400 Subject: 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 Reviewed-by: Tom Sepez --- fpdfsdk/javascript/PublicMethods.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'fpdfsdk/javascript/PublicMethods.cpp') 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); } } -- cgit v1.2.3