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

Side by Side Diff: core/fpdfdoc/cpdf_formfield.cpp

Issue 2425783002: Revert "Make CPDF_Object containers hold objects via unique pointers." (Closed)
Patch Set: Created 4 years, 2 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/fpdfdoc/cpdf_formcontrol.cpp ('k') | core/fpdfdoc/cpdf_interform.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 "core/fpdfdoc/cpdf_formfield.h" 7 #include "core/fpdfdoc/cpdf_formfield.h"
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 if (iCount < 0 || index >= iCount) 832 if (iCount < 0 || index >= iCount)
833 return -1; 833 return -1;
834 return pArray->GetIntegerAt(index); 834 return pArray->GetIntegerAt(index);
835 } 835 }
836 836
837 FX_BOOL CPDF_FormField::IsOptionSelected(int iOptIndex) const { 837 FX_BOOL CPDF_FormField::IsOptionSelected(int iOptIndex) const {
838 CPDF_Array* pArray = ToArray(FPDF_GetFieldAttr(m_pDict, "I")); 838 CPDF_Array* pArray = ToArray(FPDF_GetFieldAttr(m_pDict, "I"));
839 if (!pArray) 839 if (!pArray)
840 return FALSE; 840 return FALSE;
841 841
842 for (const auto& pObj : *pArray) { 842 for (CPDF_Object* pObj : *pArray) {
843 if (pObj->GetInteger() == iOptIndex) 843 if (pObj->GetInteger() == iOptIndex)
844 return TRUE; 844 return TRUE;
845 } 845 }
846 return FALSE; 846 return FALSE;
847 } 847 }
848 848
849 FX_BOOL CPDF_FormField::SelectOption(int iOptIndex, 849 FX_BOOL CPDF_FormField::SelectOption(int iOptIndex,
850 FX_BOOL bSelected, 850 FX_BOOL bSelected,
851 FX_BOOL bNotify) { 851 FX_BOOL bNotify) {
852 CPDF_Array* pArray = m_pDict->GetArrayFor("I"); 852 CPDF_Array* pArray = m_pDict->GetArrayFor("I");
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 case ListBox: 994 case ListBox:
995 NotifyAfterSelectionChange(); 995 NotifyAfterSelectionChange();
996 break; 996 break;
997 case ComboBox: 997 case ComboBox:
998 NotifyAfterValueChange(); 998 NotifyAfterValueChange();
999 break; 999 break;
1000 default: 1000 default:
1001 break; 1001 break;
1002 } 1002 }
1003 } 1003 }
OLDNEW
« no previous file with comments | « core/fpdfdoc/cpdf_formcontrol.cpp ('k') | core/fpdfdoc/cpdf_interform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698