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

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

Issue 1419643005: Merge to XFA: Add type cast definitions for CPDF_Array. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
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_ap.cpp
diff --git a/core/src/fpdfdoc/doc_ap.cpp b/core/src/fpdfdoc/doc_ap.cpp
index 71025ec532a145a27fbeb9aa75995df79ec723e3..77a1f1530671b63c2d4abc8cb566f58fbc553b6a 100644
--- a/core/src/fpdfdoc/doc_ap.cpp
+++ b/core/src/fpdfdoc/doc_ap.cpp
@@ -618,12 +618,11 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc,
}
if (CPDF_Object* pOpt = pOpts->GetElementValue(i)) {
CFX_WideString swItem;
- if (pOpt->IsString()) {
+ if (pOpt->IsString())
swItem = pOpt->GetUnicodeText();
- } else if (pOpt->GetType() == PDFOBJ_ARRAY) {
- swItem =
- ((CPDF_Array*)pOpt)->GetElementValue(1)->GetUnicodeText();
- }
+ else if (CPDF_Array* pArray = pOpt->AsArray())
+ swItem = pArray->GetElementValue(1)->GetUnicodeText();
+
FX_BOOL bSelected = FALSE;
if (pSels) {
for (FX_DWORD s = 0, ssz = pSels->GetCount(); s < ssz; s++) {

Powered by Google App Engine
This is Rietveld 408576698