summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc/doc_formfield.cpp
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 /core/src/fpdfdoc/doc_formfield.cpp
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 'core/src/fpdfdoc/doc_formfield.cpp')
-rw-r--r--core/src/fpdfdoc/doc_formfield.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/fpdfdoc/doc_formfield.cpp b/core/src/fpdfdoc/doc_formfield.cpp
index 8541d9c144..9ef28836a1 100644
--- a/core/src/fpdfdoc/doc_formfield.cpp
+++ b/core/src/fpdfdoc/doc_formfield.cpp
@@ -431,7 +431,7 @@ int CPDF_FormField::CountSelectedItems() {
}
return 1;
}
- if (pValue->GetType() == PDFOBJ_NUMBER) {
+ if (pValue->IsNumber()) {
if (pValue->GetString().IsEmpty()) {
return 0;
}
@@ -450,9 +450,9 @@ int CPDF_FormField::GetSelectedIndex(int index) {
return -1;
}
}
- if (pValue->GetType() == PDFOBJ_NUMBER) {
+ if (pValue->IsNumber())
return pValue->GetInteger();
- }
+
CFX_WideString sel_value;
if (pValue->GetType() == PDFOBJ_STRING) {
if (index != 0) {
@@ -541,7 +541,7 @@ FX_BOOL CPDF_FormField::IsItemSelected(int index) {
}
return FALSE;
}
- if (pValue->GetType() == PDFOBJ_NUMBER) {
+ if (pValue->IsNumber()) {
if (pValue->GetString().IsEmpty()) {
return FALSE;
}