From d6e9cfaab0555c34783dd05261329866b4da1b9f Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 30 Oct 2017 21:19:42 +0000 Subject: Convert JS resource into enum class This CL converts the #defines into an enum class. Change-Id: I895e29e1d46a7a82d7be896f5776eb00d28559f5 Reviewed-on: https://pdfium-review.googlesource.com/17091 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- fxjs/cjs_annot.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'fxjs/cjs_annot.cpp') diff --git a/fxjs/cjs_annot.cpp b/fxjs/cjs_annot.cpp index f4f9669eff..62fdfb8b76 100644 --- a/fxjs/cjs_annot.cpp +++ b/fxjs/cjs_annot.cpp @@ -46,7 +46,7 @@ Annot::~Annot() {} CJS_Return Annot::get_hidden(CJS_Runtime* pRuntime) { if (!m_pAnnot) - return CJS_Return(JSGetStringFromID(IDS_STRING_JSBADOBJECT)); + return CJS_Return(JSGetStringFromID(JSMessage::kBadObjectError)); CPDF_Annot* pPDFAnnot = ToBAAnnot(m_pAnnot.Get())->GetPDFAnnot(); return CJS_Return(pRuntime->NewBoolean( @@ -57,7 +57,7 @@ CJS_Return Annot::set_hidden(CJS_Runtime* pRuntime, v8::Local vp) { // May invalidate m_pAnnot. bool bHidden = pRuntime->ToBoolean(vp); if (!m_pAnnot) - return CJS_Return(JSGetStringFromID(IDS_STRING_JSBADOBJECT)); + return CJS_Return(JSGetStringFromID(JSMessage::kBadObjectError)); uint32_t flags = ToBAAnnot(m_pAnnot.Get())->GetFlags(); if (bHidden) { @@ -78,7 +78,7 @@ CJS_Return Annot::set_hidden(CJS_Runtime* pRuntime, v8::Local vp) { CJS_Return Annot::get_name(CJS_Runtime* pRuntime) { if (!m_pAnnot) - return CJS_Return(JSGetStringFromID(IDS_STRING_JSBADOBJECT)); + return CJS_Return(JSGetStringFromID(JSMessage::kBadObjectError)); return CJS_Return( pRuntime->NewString(ToBAAnnot(m_pAnnot.Get())->GetAnnotName().c_str())); } @@ -87,7 +87,7 @@ CJS_Return Annot::set_name(CJS_Runtime* pRuntime, v8::Local vp) { // May invalidate m_pAnnot. WideString annotName = pRuntime->ToWideString(vp); if (!m_pAnnot) - return CJS_Return(JSGetStringFromID(IDS_STRING_JSBADOBJECT)); + return CJS_Return(JSGetStringFromID(JSMessage::kBadObjectError)); ToBAAnnot(m_pAnnot.Get())->SetAnnotName(annotName); return CJS_Return(true); @@ -95,7 +95,7 @@ CJS_Return Annot::set_name(CJS_Runtime* pRuntime, v8::Local vp) { CJS_Return Annot::get_type(CJS_Runtime* pRuntime) { if (!m_pAnnot) - return CJS_Return(JSGetStringFromID(IDS_STRING_JSBADOBJECT)); + return CJS_Return(JSGetStringFromID(JSMessage::kBadObjectError)); return CJS_Return(pRuntime->NewString( WideString::FromLocal(CPDF_Annot::AnnotSubtypeToString( ToBAAnnot(m_pAnnot.Get())->GetAnnotSubtype()) @@ -104,7 +104,7 @@ CJS_Return Annot::get_type(CJS_Runtime* pRuntime) { } CJS_Return Annot::set_type(CJS_Runtime* pRuntime, v8::Local vp) { - return CJS_Return(JSGetStringFromID(IDS_STRING_JSREADONLY)); + return CJS_Return(JSGetStringFromID(JSMessage::kReadOnlyError)); } void Annot::SetSDKAnnot(CPDFSDK_BAAnnot* annot) { -- cgit v1.2.3