From 83bf02dfb860a66d756434d194118dae572d04d3 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 21 Oct 2015 11:01:01 -0400 Subject: 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 . --- core/src/fpdfdoc/doc_formfield.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/src/fpdfdoc/doc_formfield.cpp') 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; } -- cgit v1.2.3