diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-10-30 21:19:42 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-30 21:19:42 +0000 |
commit | d6e9cfaab0555c34783dd05261329866b4da1b9f (patch) | |
tree | f123e3ee82017c1e14a07306f54381ea9bf2966c /fxjs/cjs_annot.cpp | |
parent | caee9596e926a41a23fa0ddebd10d509db4b23ab (diff) | |
download | pdfium-d6e9cfaab0555c34783dd05261329866b4da1b9f.tar.xz |
Convert JS resource into enum classchromium/3254
This CL converts the #defines into an enum class.
Change-Id: I895e29e1d46a7a82d7be896f5776eb00d28559f5
Reviewed-on: https://pdfium-review.googlesource.com/17091
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjs_annot.cpp')
-rw-r--r-- | fxjs/cjs_annot.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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<v8::Value> 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<v8::Value> 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<v8::Value> 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<v8::Value> 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<v8::Value> vp) { - return CJS_Return(JSGetStringFromID(IDS_STRING_JSREADONLY)); + return CJS_Return(JSGetStringFromID(JSMessage::kReadOnlyError)); } void Annot::SetSDKAnnot(CPDFSDK_BAAnnot* annot) { |