From 3a6d058740a9908a06efb9e9362df01acdee6ff8 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 17 Aug 2018 19:28:52 +0000 Subject: Rename CJS_Return to CJS_Result. "Return" is a verb, and "return" is a reserved-word at that, so avoid using it as part of a class name. Fully mechanical change apart from rename. Change-Id: I120e453e8ba001c4ab74a39e2da6aa6eb590835f Reviewed-on: https://pdfium-review.googlesource.com/40532 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- fxjs/cjs_annot.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'fxjs/cjs_annot.cpp') diff --git a/fxjs/cjs_annot.cpp b/fxjs/cjs_annot.cpp index 4e93dc2516..dda52f629c 100644 --- a/fxjs/cjs_annot.cpp +++ b/fxjs/cjs_annot.cpp @@ -37,23 +37,23 @@ CJS_Annot::CJS_Annot(v8::Local pObject, CJS_Runtime* pRuntime) CJS_Annot::~CJS_Annot() = default; -CJS_Return CJS_Annot::get_hidden(CJS_Runtime* pRuntime) { +CJS_Result CJS_Annot::get_hidden(CJS_Runtime* pRuntime) { if (!m_pAnnot) - return CJS_Return::Failure(JSMessage::kBadObjectError); + return CJS_Result::Failure(JSMessage::kBadObjectError); CPDF_Annot* pPDFAnnot = m_pAnnot->AsBAAnnot()->GetPDFAnnot(); - return CJS_Return::Success(pRuntime->NewBoolean( + return CJS_Result::Success(pRuntime->NewBoolean( CPDF_Annot::IsAnnotationHidden(pPDFAnnot->GetAnnotDict()))); } -CJS_Return CJS_Annot::set_hidden(CJS_Runtime* pRuntime, +CJS_Result CJS_Annot::set_hidden(CJS_Runtime* pRuntime, v8::Local vp) { // May invalidate m_pAnnot. bool bHidden = pRuntime->ToBoolean(vp); CPDFSDK_BAAnnot* pBAAnnot = ToBAAnnot(m_pAnnot.Get()); if (!pBAAnnot) - return CJS_Return::Failure(JSMessage::kBadObjectError); + return CJS_Result::Failure(JSMessage::kBadObjectError); uint32_t flags = pBAAnnot->GetFlags(); if (bHidden) { @@ -68,42 +68,42 @@ CJS_Return CJS_Annot::set_hidden(CJS_Runtime* pRuntime, flags |= ANNOTFLAG_PRINT; } pBAAnnot->SetFlags(flags); - return CJS_Return::Success(); + return CJS_Result::Success(); } -CJS_Return CJS_Annot::get_name(CJS_Runtime* pRuntime) { +CJS_Result CJS_Annot::get_name(CJS_Runtime* pRuntime) { CPDFSDK_BAAnnot* pBAAnnot = ToBAAnnot(m_pAnnot.Get()); if (!pBAAnnot) - return CJS_Return::Failure(JSMessage::kBadObjectError); + return CJS_Result::Failure(JSMessage::kBadObjectError); - return CJS_Return::Success( + return CJS_Result::Success( pRuntime->NewString(pBAAnnot->GetAnnotName().AsStringView())); } -CJS_Return CJS_Annot::set_name(CJS_Runtime* pRuntime, v8::Local vp) { +CJS_Result CJS_Annot::set_name(CJS_Runtime* pRuntime, v8::Local vp) { // May invalidate m_pAnnot. WideString annotName = pRuntime->ToWideString(vp); CPDFSDK_BAAnnot* pBAAnnot = ToBAAnnot(m_pAnnot.Get()); if (!pBAAnnot) - return CJS_Return::Failure(JSMessage::kBadObjectError); + return CJS_Result::Failure(JSMessage::kBadObjectError); pBAAnnot->SetAnnotName(annotName); - return CJS_Return::Success(); + return CJS_Result::Success(); } -CJS_Return CJS_Annot::get_type(CJS_Runtime* pRuntime) { +CJS_Result CJS_Annot::get_type(CJS_Runtime* pRuntime) { CPDFSDK_BAAnnot* pBAAnnot = ToBAAnnot(m_pAnnot.Get()); if (!pBAAnnot) - return CJS_Return::Failure(JSMessage::kBadObjectError); + return CJS_Result::Failure(JSMessage::kBadObjectError); - return CJS_Return::Success(pRuntime->NewString( + return CJS_Result::Success(pRuntime->NewString( WideString::FromLocal( CPDF_Annot::AnnotSubtypeToString(pBAAnnot->GetAnnotSubtype()) .AsStringView()) .AsStringView())); } -CJS_Return CJS_Annot::set_type(CJS_Runtime* pRuntime, v8::Local vp) { - return CJS_Return::Failure(JSMessage::kReadOnlyError); +CJS_Result CJS_Annot::set_type(CJS_Runtime* pRuntime, v8::Local vp) { + return CJS_Result::Failure(JSMessage::kReadOnlyError); } -- cgit v1.2.3