OLD | NEW |
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 "../../third_party/base/nonstd_unique_ptr.h" | 7 #include "../../third_party/base/nonstd_unique_ptr.h" |
8 #include "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
9 #include "../include/fsdk_mgr.h" | 9 #include "../include/fsdk_mgr.h" |
10 #include "../include/fsdk_baseannot.h" | 10 #include "../include/fsdk_baseannot.h" |
(...skipping 2173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2184 FX_BOOL CPDFSDK_InterForm::DoAction_ImportData(const CPDF_Action& action) { | 2184 FX_BOOL CPDFSDK_InterForm::DoAction_ImportData(const CPDF_Action& action) { |
2185 return FALSE; | 2185 return FALSE; |
2186 } | 2186 } |
2187 | 2187 |
2188 void CPDFSDK_InterForm::GetFieldFromObjects(const CFX_PtrArray& objects, | 2188 void CPDFSDK_InterForm::GetFieldFromObjects(const CFX_PtrArray& objects, |
2189 CFX_PtrArray& fields) { | 2189 CFX_PtrArray& fields) { |
2190 ASSERT(m_pInterForm != NULL); | 2190 ASSERT(m_pInterForm != NULL); |
2191 | 2191 |
2192 int iCount = objects.GetSize(); | 2192 int iCount = objects.GetSize(); |
2193 for (int i = 0; i < iCount; i++) { | 2193 for (int i = 0; i < iCount; i++) { |
2194 CPDF_Object* pObject = (CPDF_Object*)objects[i]; | 2194 CPDF_Object* pObject = static_cast<CPDF_Object*>(objects[i]); |
2195 if (pObject == NULL) | 2195 if (!pObject) |
2196 continue; | 2196 continue; |
2197 | 2197 |
2198 if (pObject->IsString()) { | 2198 if (pObject->IsString()) { |
2199 CFX_WideString csName = pObject->GetUnicodeText(); | 2199 CFX_WideString csName = pObject->GetUnicodeText(); |
2200 CPDF_FormField* pField = m_pInterForm->GetField(0, csName); | 2200 CPDF_FormField* pField = m_pInterForm->GetField(0, csName); |
2201 if (pField != NULL) | 2201 if (pField) |
2202 fields.Add(pField); | 2202 fields.Add(pField); |
2203 } else if (pObject->IsDictionary()) { | 2203 } else if (pObject->IsDictionary()) { |
2204 if (m_pInterForm->IsValidFormField(pObject)) | 2204 if (m_pInterForm->IsValidFormField(pObject)) |
2205 fields.Add(pObject); | 2205 fields.Add(pObject); |
2206 } | 2206 } |
2207 } | 2207 } |
2208 } | 2208 } |
2209 | 2209 |
2210 /* ----------------------------- CPDF_FormNotify ----------------------------- | 2210 /* ----------------------------- CPDF_FormNotify ----------------------------- |
2211 */ | 2211 */ |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2607 ASSERT(pAnnot != NULL); | 2607 ASSERT(pAnnot != NULL); |
2608 | 2608 |
2609 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); | 2609 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); |
2610 ASSERT(pPDFAnnot != NULL); | 2610 ASSERT(pPDFAnnot != NULL); |
2611 | 2611 |
2612 CPDF_Rect rcAnnot; | 2612 CPDF_Rect rcAnnot; |
2613 pPDFAnnot->GetRect(rcAnnot); | 2613 pPDFAnnot->GetRect(rcAnnot); |
2614 | 2614 |
2615 return rcAnnot; | 2615 return rcAnnot; |
2616 } | 2616 } |
OLD | NEW |