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

Side by Side Diff: core/src/fpdfdoc/doc_form.cpp

Issue 1410073007: Merge to XFA: Revert "Revert "Add type cast definitions for CPDF_Reference."" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../include/fpdfdoc/fpdf_doc.h" 7 #include "../../include/fpdfdoc/fpdf_doc.h"
8 #include "doc_utils.h" 8 #include "doc_utils.h"
9 9
10 const int nMaxRecursion = 32; 10 const int nMaxRecursion = 32;
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 } 1079 }
1080 if (pFieldDict->KeyExist(FX_BSTRC("Ff"))) { 1080 if (pFieldDict->KeyExist(FX_BSTRC("Ff"))) {
1081 CPDF_Object* pFfValue = pFieldDict->GetElementValue(FX_BSTRC("Ff")); 1081 CPDF_Object* pFfValue = pFieldDict->GetElementValue(FX_BSTRC("Ff"));
1082 if (pFfValue) { 1082 if (pFfValue) {
1083 pParent->SetAt(FX_BSTRC("Ff"), pFfValue->Clone()); 1083 pParent->SetAt(FX_BSTRC("Ff"), pFfValue->Clone());
1084 } 1084 }
1085 } 1085 }
1086 } 1086 }
1087 pField = new CPDF_FormField(this, pParent); 1087 pField = new CPDF_FormField(this, pParent);
1088 CPDF_Object* pTObj = pDict->GetElement("T"); 1088 CPDF_Object* pTObj = pDict->GetElement("T");
1089 if (pTObj && pTObj->GetType() == PDFOBJ_REFERENCE) { 1089 if (ToReference(pTObj)) {
1090 CPDF_Object* pClone = pTObj->Clone(TRUE); 1090 CPDF_Object* pClone = pTObj->Clone(TRUE);
1091 if (pClone) { 1091 if (pClone)
1092 pDict->SetAt("T", pClone); 1092 pDict->SetAt("T", pClone);
1093 } else { 1093 else
1094 pDict->SetAtName("T", ""); 1094 pDict->SetAtName("T", "");
1095 }
1096 } 1095 }
1097 m_pFieldTree->SetField(csWName, pField); 1096 m_pFieldTree->SetField(csWName, pField);
1098 } 1097 }
1099 CPDF_Array* pKids = pFieldDict->GetArray("Kids"); 1098 CPDF_Array* pKids = pFieldDict->GetArray("Kids");
1100 if (pKids == NULL) { 1099 if (pKids == NULL) {
1101 if (pFieldDict->GetString("Subtype") == "Widget") { 1100 if (pFieldDict->GetString("Subtype") == "Widget") {
1102 AddControl(pField, pFieldDict); 1101 AddControl(pField, pFieldDict);
1103 } 1102 }
1104 } else { 1103 } else {
1105 for (FX_DWORD i = 0; i < pKids->GetCount(); i++) { 1104 for (FX_DWORD i = 0; i < pKids->GetCount(); i++) {
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 FDF_ImportField(pField, L"", bNotify); 1370 FDF_ImportField(pField, L"", bNotify);
1372 } 1371 }
1373 if (bNotify && m_pFormNotify != NULL) { 1372 if (bNotify && m_pFormNotify != NULL) {
1374 m_pFormNotify->AfterFormImportData(this); 1373 m_pFormNotify->AfterFormImportData(this);
1375 } 1374 }
1376 return TRUE; 1375 return TRUE;
1377 } 1376 }
1378 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { 1377 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) {
1379 m_pFormNotify = (CPDF_FormNotify*)pNotify; 1378 m_pFormNotify = (CPDF_FormNotify*)pNotify;
1380 } 1379 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698