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

Side by Side Diff: fpdfsdk/src/fpdf_flatten.cpp

Issue 1541703003: Use std::map as CPDF_Dictionary's underlying store. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments, rebase, fix embedder test 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 | « fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp ('k') | fpdfsdk/src/fpdf_transformpage.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 "public/fpdf_flatten.h" 7 #include "public/fpdf_flatten.h"
8 8
9 #include "fpdfsdk/include/fsdk_define.h" 9 #include "fpdfsdk/include/fsdk_define.h"
10 10
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 433
434 CPDF_Stream* pAPStream = pAnnotAP->GetStream("N"); 434 CPDF_Stream* pAPStream = pAnnotAP->GetStream("N");
435 if (!pAPStream) { 435 if (!pAPStream) {
436 CPDF_Dictionary* pAPDic = pAnnotAP->GetDict("N"); 436 CPDF_Dictionary* pAPDic = pAnnotAP->GetDict("N");
437 if (!pAPDic) 437 if (!pAPDic)
438 continue; 438 continue;
439 439
440 if (!sAnnotState.IsEmpty()) { 440 if (!sAnnotState.IsEmpty()) {
441 pAPStream = pAPDic->GetStream(sAnnotState); 441 pAPStream = pAPDic->GetStream(sAnnotState);
442 } else { 442 } else {
443 FX_POSITION pos = pAPDic->GetStartPos(); 443 auto it = pAPDic->begin();
444 if (pos) { 444 if (it != pAPDic->end()) {
445 CFX_ByteString sKey; 445 CPDF_Object* pFirstObj = it->second;
446 CPDF_Object* pFirstObj = pAPDic->GetNextElement(pos, sKey);
447 if (pFirstObj) { 446 if (pFirstObj) {
448 if (pFirstObj->IsReference()) 447 if (pFirstObj->IsReference())
449 pFirstObj = pFirstObj->GetDirect(); 448 pFirstObj = pFirstObj->GetDirect();
450 if (!pFirstObj->IsStream()) 449 if (!pFirstObj->IsStream())
451 continue; 450 continue;
452 pAPStream = pFirstObj->AsStream(); 451 pAPStream = pFirstObj->AsStream();
453 } 452 }
454 } 453 }
455 } 454 }
456 } 455 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, 513 pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE,
515 FALSE); 514 FALSE);
516 } 515 }
517 pPageDict->RemoveAt("Annots"); 516 pPageDict->RemoveAt("Annots");
518 517
519 ObjectArray.RemoveAll(); 518 ObjectArray.RemoveAll();
520 RectArray.RemoveAll(); 519 RectArray.RemoveAll();
521 520
522 return FLATTEN_SUCCESS; 521 return FLATTEN_SUCCESS;
523 } 522 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp ('k') | fpdfsdk/src/fpdf_transformpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698