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

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

Issue 1414393006: Revert "Add type cast definitions for CPDF_Reference." (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 1 month 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_tagged.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 #include "../include/fsdk_define.h" 8 #include "../include/fsdk_define.h"
9 9
10 typedef CFX_ArrayTemplate<CPDF_Dictionary*> CPDF_ObjectArray; 10 typedef CFX_ArrayTemplate<CPDF_Dictionary*> CPDF_ObjectArray;
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 continue; 437 continue;
438 438
439 if (!sAnnotState.IsEmpty()) { 439 if (!sAnnotState.IsEmpty()) {
440 pAPStream = pAPDic->GetStream(sAnnotState); 440 pAPStream = pAPDic->GetStream(sAnnotState);
441 } else { 441 } else {
442 FX_POSITION pos = pAPDic->GetStartPos(); 442 FX_POSITION pos = pAPDic->GetStartPos();
443 if (pos) { 443 if (pos) {
444 CFX_ByteString sKey; 444 CFX_ByteString sKey;
445 CPDF_Object* pFirstObj = pAPDic->GetNextElement(pos, sKey); 445 CPDF_Object* pFirstObj = pAPDic->GetNextElement(pos, sKey);
446 if (pFirstObj) { 446 if (pFirstObj) {
447 if (pFirstObj->IsReference()) 447 if (pFirstObj->GetType() == PDFOBJ_REFERENCE)
448 pFirstObj = pFirstObj->GetDirect(); 448 pFirstObj = pFirstObj->GetDirect();
449
449 if (!pFirstObj->IsStream()) 450 if (!pFirstObj->IsStream())
450 continue; 451 continue;
452
451 pAPStream = pFirstObj->AsStream(); 453 pAPStream = pFirstObj->AsStream();
452 } 454 }
453 } 455 }
454 } 456 }
455 } 457 }
456 if (!pAPStream) 458 if (!pAPStream)
457 continue; 459 continue;
458 460
459 CPDF_Dictionary* pAPDic = pAPStream->GetDict(); 461 CPDF_Dictionary* pAPDic = pAPStream->GetDict();
460 CFX_AffineMatrix matrix = pAPDic->GetMatrix("Matrix"); 462 CFX_AffineMatrix matrix = pAPDic->GetMatrix("Matrix");
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, 515 pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE,
514 FALSE); 516 FALSE);
515 } 517 }
516 pPageDict->RemoveAt("Annots"); 518 pPageDict->RemoveAt("Annots");
517 519
518 ObjectArray.RemoveAll(); 520 ObjectArray.RemoveAll();
519 RectArray.RemoveAll(); 521 RectArray.RemoveAll();
520 522
521 return FLATTEN_SUCCESS; 523 return FLATTEN_SUCCESS;
522 } 524 }
OLDNEW
« no previous file with comments | « core/src/fpdfdoc/doc_tagged.cpp ('k') | fpdfsdk/src/fpdf_transformpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698