summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Annot.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-24 09:36:16 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-24 17:17:03 +0000
commite49749265c4e503c37a316e4ca6eeff430d13b87 (patch)
treed75c0b641618e66477b2e992ae146f30a3e2dd9f /fpdfsdk/javascript/Annot.cpp
parent826480cf599f61fe0366ab2bd5803dd53c9d0562 (diff)
downloadpdfium-e49749265c4e503c37a316e4ca6eeff430d13b87.tar.xz
Remove most CJS_Value Set methods
This CL removes all of the Set(*) methods from CJS_Value except for Set(v8::Local<v8::Value>). All uses of Set are changed to convert to a v8::Value before setting. Change-Id: I6e4d2cebec42fce5c039dc0a3abe46086cfdd34f Reviewed-on: https://pdfium-review.googlesource.com/16610 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/Annot.cpp')
-rw-r--r--fpdfsdk/javascript/Annot.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/fpdfsdk/javascript/Annot.cpp b/fpdfsdk/javascript/Annot.cpp
index 19e94f3e46..c9fbaaf76f 100644
--- a/fpdfsdk/javascript/Annot.cpp
+++ b/fpdfsdk/javascript/Annot.cpp
@@ -44,7 +44,8 @@ bool Annot::get_hidden(CJS_Runtime* pRuntime,
}
CPDF_Annot* pPDFAnnot = ToBAAnnot(m_pAnnot.Get())->GetPDFAnnot();
- vp->Set(pRuntime, CPDF_Annot::IsAnnotationHidden(pPDFAnnot->GetAnnotDict()));
+ vp->Set(pRuntime->NewBoolean(
+ CPDF_Annot::IsAnnotationHidden(pPDFAnnot->GetAnnotDict())));
return true;
}
@@ -80,7 +81,8 @@ bool Annot::get_name(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError) {
return false;
}
- vp->Set(pRuntime, ToBAAnnot(m_pAnnot.Get())->GetAnnotName());
+ vp->Set(
+ pRuntime->NewString(ToBAAnnot(m_pAnnot.Get())->GetAnnotName().c_str()));
return true;
}
@@ -103,8 +105,11 @@ bool Annot::get_type(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError) {
return false;
}
- vp->Set(pRuntime, CPDF_Annot::AnnotSubtypeToString(
- ToBAAnnot(m_pAnnot.Get())->GetAnnotSubtype()));
+ vp->Set(pRuntime->NewString(
+ WideString::FromLocal(CPDF_Annot::AnnotSubtypeToString(
+ ToBAAnnot(m_pAnnot.Get())->GetAnnotSubtype())
+ .c_str())
+ .c_str()));
return true;
}