summaryrefslogtreecommitdiff
path: root/fpdfsdk/src
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2015-10-21 11:07:42 -0400
committerDan Sinclair <dsinclair@chromium.org>2015-10-21 11:07:42 -0400
commit43ce9035a026c7b4f15aa938dc39444d9253ea9f (patch)
tree8f18c1508dfd0db47d9dec1dbc708fd018349b3f /fpdfsdk/src
parent1edb860fd465879311ec85c5c6385067b7985013 (diff)
downloadpdfium-43ce9035a026c7b4f15aa938dc39444d9253ea9f.tar.xz
Merge to XFA: 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 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1410673005 . (cherry picked from commit 83bf02dfb860a66d756434d194118dae572d04d3) Review URL: https://codereview.chromium.org/1422583002 .
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 b36a6cb4c6..939b74e9db 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -854,9 +854,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());