summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2015-10-20 16:38:12 -0400
committerDan Sinclair <dsinclair@chromium.org>2015-10-20 16:38:12 -0400
commitce4f95d61f5aa5fb9a5fc6cb8487999a9cf46458 (patch)
treee94487d8febe420592249615061169e011ce8c3b /fpdfsdk/src/javascript
parent48cc160caf622bdd1dd5db2dde1935ccaf0b9203 (diff)
downloadpdfium-ce4f95d61f5aa5fb9a5fc6cb8487999a9cf46458.tar.xz
Add type cast definitions for CPDF_Boolean.
This CL adds ToBoolean, CPDF_Object::AsBoolean and CPDF_Object::IsBoolean and updates the src to use them as needed. BUG=pdfium:201 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1417623005 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r--fpdfsdk/src/javascript/Document.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index 24f55b03f9..81667cfa04 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -855,9 +855,10 @@ FX_BOOL Document::info(IJS_Context* cc,
if (pValueObj->GetType() == PDFOBJ_NUMBER)
FXJS_PutObjectNumber(isolate, pObj, wsKey.c_str(),
(float)pValueObj->GetNumber());
- if (pValueObj->GetType() == PDFOBJ_BOOLEAN)
+ if (pValueObj->IsBoolean()) {
FXJS_PutObjectBoolean(isolate, pObj, wsKey.c_str(),
(bool)pValueObj->GetInteger());
+ }
}
vp << pObj;
}