summaryrefslogtreecommitdiff
path: root/fpdfsdk/src
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2015-10-21 11:01:01 -0400
committerDan Sinclair <dsinclair@chromium.org>2015-10-21 11:01:01 -0400
commit83bf02dfb860a66d756434d194118dae572d04d3 (patch)
tree64647a3ca2708fad1c50235943da63f22ea66a1d /fpdfsdk/src
parent8430a5d04883fac4666d0c321fc679bcaf99cb71 (diff)
downloadpdfium-83bf02dfb860a66d756434d194118dae572d04d3.tar.xz
Add type cast definitions for CPDF_Number.
This Cl adds ToNumber, CPDF_Object::AsNumber and CPDF_Object::IsNumber and updates the src to use them as needed. BUG=pdfium:201 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1410673005 .
Diffstat (limited to 'fpdfsdk/src')
-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 81667cfa04..163323ad25 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -852,9 +852,10 @@ FX_BOOL Document::info(IJS_Context* cc,
(pValueObj->GetType() == PDFOBJ_NAME))
FXJS_PutObjectString(isolate, pObj, wsKey.c_str(),
pValueObj->GetUnicodeText().c_str());
- if (pValueObj->GetType() == PDFOBJ_NUMBER)
+ if (pValueObj->IsNumber()) {
FXJS_PutObjectNumber(isolate, pObj, wsKey.c_str(),
(float)pValueObj->GetNumber());
+ }
if (pValueObj->IsBoolean()) {
FXJS_PutObjectBoolean(isolate, pObj, wsKey.c_str(),
(bool)pValueObj->GetInteger());