| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" | 10 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 if (pA) { | 709 if (pA) { |
| 710 uint32_t dwCount = pA->GetCount(); | 710 uint32_t dwCount = pA->GetCount(); |
| 711 if (dwCount > 0) { | 711 if (dwCount > 0) { |
| 712 fLeft = pA->GetNumberAt(0); | 712 fLeft = pA->GetNumberAt(0); |
| 713 } | 713 } |
| 714 if (dwCount > 1) { | 714 if (dwCount > 1) { |
| 715 fBottom = pA->GetNumberAt(1); | 715 fBottom = pA->GetNumberAt(1); |
| 716 } | 716 } |
| 717 } | 717 } |
| 718 } | 718 } |
| 719 FX_BOOL CPDF_IconFit::GetFittingBounds() { | 719 |
| 720 if (!m_pDict) { | 720 bool CPDF_IconFit::GetFittingBounds() { |
| 721 return FALSE; | 721 return m_pDict ? m_pDict->GetBooleanBy("FB") : false; |
| 722 } | |
| 723 return m_pDict->GetBooleanBy("FB"); | |
| 724 } | 722 } |
| 725 | 723 |
| 726 std::vector<bool> SaveCheckedFieldStatus(CPDF_FormField* pField) { | 724 std::vector<bool> SaveCheckedFieldStatus(CPDF_FormField* pField) { |
| 727 std::vector<bool> result; | 725 std::vector<bool> result; |
| 728 int iCount = pField->CountControls(); | 726 int iCount = pField->CountControls(); |
| 729 for (int i = 0; i < iCount; ++i) { | 727 for (int i = 0; i < iCount; ++i) { |
| 730 if (CPDF_FormControl* pControl = pField->GetControl(i)) | 728 if (CPDF_FormControl* pControl = pField->GetControl(i)) |
| 731 result.push_back(pControl->IsChecked()); | 729 result.push_back(pControl->IsChecked()); |
| 732 } | 730 } |
| 733 return result; | 731 return result; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 745 CPDF_Object* pAttr = pFieldDict->GetDirectObjectBy(name); | 743 CPDF_Object* pAttr = pFieldDict->GetDirectObjectBy(name); |
| 746 if (pAttr) { | 744 if (pAttr) { |
| 747 return pAttr; | 745 return pAttr; |
| 748 } | 746 } |
| 749 CPDF_Dictionary* pParent = pFieldDict->GetDictBy("Parent"); | 747 CPDF_Dictionary* pParent = pFieldDict->GetDictBy("Parent"); |
| 750 if (!pParent) { | 748 if (!pParent) { |
| 751 return NULL; | 749 return NULL; |
| 752 } | 750 } |
| 753 return FPDF_GetFieldAttr(pParent, name, nLevel + 1); | 751 return FPDF_GetFieldAttr(pParent, name, nLevel + 1); |
| 754 } | 752 } |
| OLD | NEW |