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

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

Issue 1587723004: Merge to XFA: Fix another invalidated iterator issue while traversing CPDF_Dictionary. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | 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 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 for (const auto& it : *pAP) { 57 for (const auto& it : *pAP) {
58 CPDF_Object* pObj1 = it.second; 58 CPDF_Object* pObj1 = it.second;
59 if (!pObj1) { 59 if (!pObj1) {
60 continue; 60 continue;
61 } 61 }
62 CPDF_Object* pObjDirect1 = pObj1->GetDirect(); 62 CPDF_Object* pObjDirect1 = pObj1->GetDirect();
63 CPDF_Dictionary* pSubDict = pObjDirect1->AsDictionary(); 63 CPDF_Dictionary* pSubDict = pObjDirect1->AsDictionary();
64 if (!pSubDict) 64 if (!pSubDict)
65 continue; 65 continue;
66 66
67 for (const auto& subdict_it : *pSubDict) { 67 auto subdict_it = pSubDict->begin();
68 const CFX_ByteString& csKey2 = subdict_it.first; 68 while (subdict_it != pSubDict->end()) {
69 CPDF_Object* pObj2 = subdict_it.second; 69 const CFX_ByteString& csKey2 = subdict_it->first;
70 CPDF_Object* pObj2 = subdict_it->second;
71 ++subdict_it;
70 if (!pObj2) { 72 if (!pObj2) {
71 continue; 73 continue;
72 } 74 }
73 if (csKey2 != "Off") { 75 if (csKey2 != "Off") {
74 pSubDict->ReplaceKey(csKey2, csValue); 76 pSubDict->ReplaceKey(csKey2, csValue);
75 break; 77 break;
76 } 78 }
77 } 79 }
78 } 80 }
79 } 81 }
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 return m_pDict ? m_pDict->GetStream(csEntry) : nullptr; 416 return m_pDict ? m_pDict->GetStream(csEntry) : nullptr;
415 } 417 }
416 418
417 CPDF_IconFit CPDF_ApSettings::GetIconFit() const { 419 CPDF_IconFit CPDF_ApSettings::GetIconFit() const {
418 return m_pDict ? m_pDict->GetDict("IF") : nullptr; 420 return m_pDict ? m_pDict->GetDict("IF") : nullptr;
419 } 421 }
420 422
421 int CPDF_ApSettings::GetTextPosition() const { 423 int CPDF_ApSettings::GetTextPosition() const {
422 return m_pDict ? m_pDict->GetInteger("TP", TEXTPOS_CAPTION) : TEXTPOS_CAPTION; 424 return m_pDict ? m_pDict->GetInteger("TP", TEXTPOS_CAPTION) : TEXTPOS_CAPTION;
423 } 425 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698