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

Side by Side Diff: fpdfsdk/fpdf_flatten.cpp

Issue 2027273002: Fix all the code which has duplicate variable declarations (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 6 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/formfiller/cffl_iformfiller.cpp ('k') | fpdfsdk/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 <algorithm> 9 #include <algorithm>
10 10
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 } 475 }
476 476
477 CPDF_Dictionary* pXObject = pNewXORes->GetDictBy("XObject"); 477 CPDF_Dictionary* pXObject = pNewXORes->GetDictBy("XObject");
478 if (!pXObject) { 478 if (!pXObject) {
479 pXObject = new CPDF_Dictionary; 479 pXObject = new CPDF_Dictionary;
480 pNewXORes->SetAt("XObject", pXObject); 480 pNewXORes->SetAt("XObject", pXObject);
481 } 481 }
482 482
483 CFX_ByteString sFormName; 483 CFX_ByteString sFormName;
484 sFormName.Format("F%d", i); 484 sFormName.Format("F%d", i);
485 uint32_t dwObjNum = pDocument->AddIndirectObject(pObj); 485 uint32_t dwStreamObjNum = pDocument->AddIndirectObject(pObj);
486 pXObject->SetAtReference(sFormName, pDocument, dwObjNum); 486 pXObject->SetAtReference(sFormName, pDocument, dwStreamObjNum);
487 487
488 CPDF_StreamAcc acc; 488 CPDF_StreamAcc acc;
489 acc.LoadAllData(pNewXObject); 489 acc.LoadAllData(pNewXObject);
490 490
491 const uint8_t* pData = acc.GetData(); 491 const uint8_t* pData = acc.GetData();
492 CFX_ByteString sStream(pData, acc.GetSize()); 492 CFX_ByteString sStream(pData, acc.GetSize());
493 CFX_ByteString sTemp; 493 CFX_ByteString sTemp;
494 494
495 if (matrix.IsIdentity()) { 495 if (matrix.IsIdentity()) {
496 matrix.a = 1.0f; 496 matrix.a = 1.0f;
(...skipping 10 matching lines...) Expand all
507 sStream += sTemp; 507 sStream += sTemp;
508 pNewXObject->SetData(sStream.raw_str(), sStream.GetLength(), FALSE, FALSE); 508 pNewXObject->SetData(sStream.raw_str(), sStream.GetLength(), FALSE, FALSE);
509 } 509 }
510 pPageDict->RemoveAt("Annots"); 510 pPageDict->RemoveAt("Annots");
511 511
512 ObjectArray.RemoveAll(); 512 ObjectArray.RemoveAll();
513 RectArray.RemoveAll(); 513 RectArray.RemoveAll();
514 514
515 return FLATTEN_SUCCESS; 515 return FLATTEN_SUCCESS;
516 } 516 }
OLDNEW
« no previous file with comments | « fpdfsdk/formfiller/cffl_iformfiller.cpp ('k') | fpdfsdk/fpdf_transformpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698