summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2015-10-20 16:44:57 -0400
committerDan Sinclair <dsinclair@chromium.org>2015-10-20 16:44:57 -0400
commit05d9e934b74c2d4e4f2983cb8d31e995a18cbe6a (patch)
tree928a7ccab88e351df14ae1e0cbff3c7c8fad3c89 /fpdfsdk
parentf1251c1ff2b3452854681d0648b4c1ca4180ff0d (diff)
downloadpdfium-05d9e934b74c2d4e4f2983cb8d31e995a18cbe6a.tar.xz
[Merge to XFA] 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 TBR=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1417623005 . (cherry picked from commit ce4f95d61f5aa5fb9a5fc6cb8487999a9cf46458) Review URL: https://codereview.chromium.org/1419663004 .
Diffstat (limited to 'fpdfsdk')
-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 4113f60735..b36a6cb4c6 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -857,9 +857,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;
}