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/fpdfxfa/fpdfxfa_doc.h" | 9 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
10 #include "../include/fpdfxfa/fpdfxfa_util.h" | 10 #include "../include/fpdfxfa/fpdfxfa_util.h" |
(...skipping 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2871 FX_BOOL CPDFSDK_InterForm::DoAction_ImportData(const CPDF_Action& action) { | 2871 FX_BOOL CPDFSDK_InterForm::DoAction_ImportData(const CPDF_Action& action) { |
2872 return FALSE; | 2872 return FALSE; |
2873 } | 2873 } |
2874 | 2874 |
2875 void CPDFSDK_InterForm::GetFieldFromObjects(const CFX_PtrArray& objects, | 2875 void CPDFSDK_InterForm::GetFieldFromObjects(const CFX_PtrArray& objects, |
2876 CFX_PtrArray& fields) { | 2876 CFX_PtrArray& fields) { |
2877 ASSERT(m_pInterForm != NULL); | 2877 ASSERT(m_pInterForm != NULL); |
2878 | 2878 |
2879 int iCount = objects.GetSize(); | 2879 int iCount = objects.GetSize(); |
2880 for (int i = 0; i < iCount; i++) { | 2880 for (int i = 0; i < iCount; i++) { |
2881 CPDF_Object* pObject = (CPDF_Object*)objects[i]; | 2881 CPDF_Object* pObject = static_cast<CPDF_Object*>(objects[i]); |
2882 if (pObject == NULL) | 2882 if (!pObject) |
2883 continue; | 2883 continue; |
2884 | 2884 |
2885 if (pObject->IsString()) { | 2885 if (pObject->IsString()) { |
2886 CFX_WideString csName = pObject->GetUnicodeText(); | 2886 CFX_WideString csName = pObject->GetUnicodeText(); |
2887 CPDF_FormField* pField = m_pInterForm->GetField(0, csName); | 2887 CPDF_FormField* pField = m_pInterForm->GetField(0, csName); |
2888 if (pField != NULL) | 2888 if (pField) |
2889 fields.Add(pField); | 2889 fields.Add(pField); |
2890 } else if (pObject->IsDictionary()) { | 2890 } else if (pObject->IsDictionary()) { |
2891 if (m_pInterForm->IsValidFormField(pObject)) | 2891 if (m_pInterForm->IsValidFormField(pObject)) |
2892 fields.Add(pObject); | 2892 fields.Add(pObject); |
2893 } | 2893 } |
2894 } | 2894 } |
2895 } | 2895 } |
2896 | 2896 |
2897 /* ----------------------------- CPDF_FormNotify ----------------------------- | 2897 /* ----------------------------- CPDF_FormNotify ----------------------------- |
2898 */ | 2898 */ |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3296 ASSERT(pAnnot != NULL); | 3296 ASSERT(pAnnot != NULL); |
3297 | 3297 |
3298 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); | 3298 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); |
3299 ASSERT(pPDFAnnot != NULL); | 3299 ASSERT(pPDFAnnot != NULL); |
3300 | 3300 |
3301 CPDF_Rect rcAnnot; | 3301 CPDF_Rect rcAnnot; |
3302 pPDFAnnot->GetRect(rcAnnot); | 3302 pPDFAnnot->GetRect(rcAnnot); |
3303 | 3303 |
3304 return rcAnnot; | 3304 return rcAnnot; |
3305 } | 3305 } |
OLD | NEW |