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 "fpdfsdk/include/fsdk_baseform.h" | 7 #include "fpdfsdk/include/fsdk_baseform.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 // Choose the right sub-ap | 460 // Choose the right sub-ap |
461 const FX_CHAR* ap_entry = "N"; | 461 const FX_CHAR* ap_entry = "N"; |
462 if (mode == CPDF_Annot::Down) | 462 if (mode == CPDF_Annot::Down) |
463 ap_entry = "D"; | 463 ap_entry = "D"; |
464 else if (mode == CPDF_Annot::Rollover) | 464 else if (mode == CPDF_Annot::Rollover) |
465 ap_entry = "R"; | 465 ap_entry = "R"; |
466 if (!pAP->KeyExist(ap_entry)) | 466 if (!pAP->KeyExist(ap_entry)) |
467 ap_entry = "N"; | 467 ap_entry = "N"; |
468 | 468 |
469 // Get the AP stream or subdirectory | 469 // Get the AP stream or subdirectory |
470 CPDF_Object* psub = pAP->GetElementValue(ap_entry); | 470 CPDF_Object* psub = pAP->GetDirectObjectBy(ap_entry); |
471 if (!psub) | 471 if (!psub) |
472 return FALSE; | 472 return FALSE; |
473 | 473 |
474 int nFieldType = GetFieldType(); | 474 int nFieldType = GetFieldType(); |
475 switch (nFieldType) { | 475 switch (nFieldType) { |
476 case FIELDTYPE_PUSHBUTTON: | 476 case FIELDTYPE_PUSHBUTTON: |
477 case FIELDTYPE_COMBOBOX: | 477 case FIELDTYPE_COMBOBOX: |
478 case FIELDTYPE_LISTBOX: | 478 case FIELDTYPE_LISTBOX: |
479 case FIELDTYPE_TEXTFIELD: | 479 case FIELDTYPE_TEXTFIELD: |
480 case FIELDTYPE_SIGNATURE: | 480 case FIELDTYPE_SIGNATURE: |
(...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2112 | 2112 |
2113 int CPDFSDK_InterForm::GetPageIndexByAnnotDict( | 2113 int CPDFSDK_InterForm::GetPageIndexByAnnotDict( |
2114 CPDF_Document* pDocument, | 2114 CPDF_Document* pDocument, |
2115 CPDF_Dictionary* pAnnotDict) const { | 2115 CPDF_Dictionary* pAnnotDict) const { |
2116 ASSERT(pAnnotDict); | 2116 ASSERT(pAnnotDict); |
2117 | 2117 |
2118 for (int i = 0, sz = pDocument->GetPageCount(); i < sz; i++) { | 2118 for (int i = 0, sz = pDocument->GetPageCount(); i < sz; i++) { |
2119 if (CPDF_Dictionary* pPageDict = pDocument->GetPage(i)) { | 2119 if (CPDF_Dictionary* pPageDict = pDocument->GetPage(i)) { |
2120 if (CPDF_Array* pAnnots = pPageDict->GetArrayBy("Annots")) { | 2120 if (CPDF_Array* pAnnots = pPageDict->GetArrayBy("Annots")) { |
2121 for (int j = 0, jsz = pAnnots->GetCount(); j < jsz; j++) { | 2121 for (int j = 0, jsz = pAnnots->GetCount(); j < jsz; j++) { |
2122 CPDF_Object* pDict = pAnnots->GetElementValue(j); | 2122 CPDF_Object* pDict = pAnnots->GetDirectObjectAt(j); |
2123 if (pAnnotDict == pDict) { | 2123 if (pAnnotDict == pDict) { |
2124 return i; | 2124 return i; |
2125 } | 2125 } |
2126 } | 2126 } |
2127 } | 2127 } |
2128 } | 2128 } |
2129 } | 2129 } |
2130 | 2130 |
2131 return -1; | 2131 return -1; |
2132 } | 2132 } |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2860 break; | 2860 break; |
2861 } | 2861 } |
2862 } | 2862 } |
2863 } | 2863 } |
2864 | 2864 |
2865 CFX_FloatRect CBA_AnnotIterator::GetAnnotRect(const CPDFSDK_Annot* pAnnot) { | 2865 CFX_FloatRect CBA_AnnotIterator::GetAnnotRect(const CPDFSDK_Annot* pAnnot) { |
2866 CFX_FloatRect rcAnnot; | 2866 CFX_FloatRect rcAnnot; |
2867 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); | 2867 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); |
2868 return rcAnnot; | 2868 return rcAnnot; |
2869 } | 2869 } |
OLD | NEW |