Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Unified Diff: core/src/fpdfdoc/doc_formfield.cpp

Issue 1410673005: Add type cast definitions for CPDF_Number. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/src/fpdfdoc/doc_formfield.cpp
diff --git a/core/src/fpdfdoc/doc_formfield.cpp b/core/src/fpdfdoc/doc_formfield.cpp
index 8541d9c1448042de88931fcc61157b0dca0aaf82..9ef28836a183b2a346166b98a5d71acb7c531bf3 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;
}

Powered by Google App Engine
This is Rietveld 408576698