From ff46aaf499edcf153ee2f57c7016587aa96dcfa0 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 27 Jul 2015 11:55:29 -0700 Subject: FX Bool considered harmful, part 3 Try to reland this patch after fixing underlying issues that caused it to be reverted. fx_system.h is the only manual edit. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1258093002 . --- fpdfsdk/src/javascript/JS_Value.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'fpdfsdk/src/javascript/JS_Value.cpp') diff --git a/fpdfsdk/src/javascript/JS_Value.cpp b/fpdfsdk/src/javascript/JS_Value.cpp index 058f2eaf45..611b1112a0 100644 --- a/fpdfsdk/src/javascript/JS_Value.cpp +++ b/fpdfsdk/src/javascript/JS_Value.cpp @@ -256,45 +256,45 @@ FXJSVALUETYPE CJS_Value::GetType() const return VT_unknown; } -FX_BOOL CJS_Value::IsArrayObject() const +bool CJS_Value::IsArrayObject() const { - if(m_pValue.IsEmpty()) return FALSE; + if(m_pValue.IsEmpty()) return false; return m_pValue->IsArray(); } -FX_BOOL CJS_Value::IsDateObject() const +bool CJS_Value::IsDateObject() const { - if(m_pValue.IsEmpty()) return FALSE; + if(m_pValue.IsEmpty()) return false; return m_pValue->IsDate(); } //CJS_Value::operator CJS_Array() -FX_BOOL CJS_Value::ConvertToArray(CJS_Array &array) const +bool CJS_Value::ConvertToArray(CJS_Array &array) const { if (IsArrayObject()) { array.Attach(JS_ToArray(m_isolate, m_pValue)); - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CJS_Value::ConvertToDate(CJS_Date &date) const +bool CJS_Value::ConvertToDate(CJS_Date &date) const { // if (GetType() == VT_date) // { // date = (double)(*this); -// return TRUE; +// return true; // } if (IsDateObject()) { date.Attach(m_pValue); - return TRUE; + return true; } - return FALSE; + return false; } /* ---------------------------- CJS_PropValue ---------------------------- */ @@ -314,12 +314,12 @@ CJS_PropValue::~CJS_PropValue() { } -FX_BOOL CJS_PropValue::IsSetting() +bool CJS_PropValue::IsSetting() { return m_bIsSetting; } -FX_BOOL CJS_PropValue::IsGetting() +bool CJS_PropValue::IsGetting() { return !m_bIsSetting; } @@ -480,9 +480,9 @@ void CJS_Array::Attach(v8::Local pArray) m_pArray = pArray; } -FX_BOOL CJS_Array::IsAttached() +bool CJS_Array::IsAttached() { - return FALSE; + return false; } void CJS_Array::GetElement(unsigned index,CJS_Value &value) @@ -543,9 +543,9 @@ CJS_Date::~CJS_Date() { } -FX_BOOL CJS_Date::IsValidDate() +bool CJS_Date::IsValidDate() { - if(m_pDate.IsEmpty()) return FALSE; + if(m_pDate.IsEmpty()) return false; return !JS_PortIsNan(JS_ToNumber(m_isolate, m_pDate)); } -- cgit v1.2.3