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

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

Issue 1653253002: Kill CFX_ByteArray in master. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: ... and its gone. Created 4 years, 10 months 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
« no previous file with comments | « core/src/fpdfdoc/doc_utils.h ('k') | core/src/fpdftext/fpdf_text_int.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <algorithm> 7 #include <algorithm>
8 8
9 #include "core/include/fpdfdoc/fpdf_doc.h" 9 #include "core/include/fpdfdoc/fpdf_doc.h"
10 #include "doc_utils.h" 10 #include "doc_utils.h"
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 fBottom = pA->GetNumberAt(1); 671 fBottom = pA->GetNumberAt(1);
672 } 672 }
673 } 673 }
674 } 674 }
675 FX_BOOL CPDF_IconFit::GetFittingBounds() { 675 FX_BOOL CPDF_IconFit::GetFittingBounds() {
676 if (!m_pDict) { 676 if (!m_pDict) {
677 return FALSE; 677 return FALSE;
678 } 678 }
679 return m_pDict->GetBooleanBy("FB"); 679 return m_pDict->GetBooleanBy("FB");
680 } 680 }
681 void SaveCheckedFieldStatus(CPDF_FormField* pField, 681
682 CFX_ByteArray& statusArray) { 682 std::vector<bool> SaveCheckedFieldStatus(CPDF_FormField* pField) {
683 std::vector<bool> result;
683 int iCount = pField->CountControls(); 684 int iCount = pField->CountControls();
684 for (int i = 0; i < iCount; i++) { 685 for (int i = 0; i < iCount; ++i) {
685 CPDF_FormControl* pControl = pField->GetControl(i); 686 if (CPDF_FormControl* pControl = pField->GetControl(i))
686 if (!pControl) { 687 result.push_back(pControl->IsChecked());
687 continue;
688 }
689 statusArray.Add(pControl->IsChecked() ? 1 : 0);
690 } 688 }
689 return result;
691 } 690 }
691
692 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, 692 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict,
693 const FX_CHAR* name, 693 const FX_CHAR* name,
694 int nLevel) { 694 int nLevel) {
695 if (nLevel > FPDFDOC_UTILS_MAXRECURSION) { 695 if (nLevel > FPDFDOC_UTILS_MAXRECURSION) {
696 return NULL; 696 return NULL;
697 } 697 }
698 if (!pFieldDict) { 698 if (!pFieldDict) {
699 return NULL; 699 return NULL;
700 } 700 }
701 CPDF_Object* pAttr = pFieldDict->GetElementValue(name); 701 CPDF_Object* pAttr = pFieldDict->GetElementValue(name);
702 if (pAttr) { 702 if (pAttr) {
703 return pAttr; 703 return pAttr;
704 } 704 }
705 CPDF_Dictionary* pParent = pFieldDict->GetDictBy("Parent"); 705 CPDF_Dictionary* pParent = pFieldDict->GetDictBy("Parent");
706 if (!pParent) { 706 if (!pParent) {
707 return NULL; 707 return NULL;
708 } 708 }
709 return FPDF_GetFieldAttr(pParent, name, nLevel + 1); 709 return FPDF_GetFieldAttr(pParent, name, nLevel + 1);
710 } 710 }
OLDNEW
« no previous file with comments | « core/src/fpdfdoc/doc_utils.h ('k') | core/src/fpdftext/fpdf_text_int.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698