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

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

Issue 1410073007: Merge to XFA: Revert "Revert "Add type cast definitions for CPDF_Reference."" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
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
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->GetType() == PDFOBJ_REFERENCE) 447 if (pFirstObj->IsReference())
448 pFirstObj = pFirstObj->GetDirect(); 448 pFirstObj = pFirstObj->GetDirect();
449
450 if (!pFirstObj->IsStream()) 449 if (!pFirstObj->IsStream())
451 continue; 450 continue;
452
453 pAPStream = pFirstObj->AsStream(); 451 pAPStream = pFirstObj->AsStream();
454 } 452 }
455 } 453 }
456 } 454 }
457 } 455 }
458 if (!pAPStream) 456 if (!pAPStream)
459 continue; 457 continue;
460 458
461 CPDF_Dictionary* pAPDic = pAPStream->GetDict(); 459 CPDF_Dictionary* pAPDic = pAPStream->GetDict();
462 CFX_AffineMatrix matrix = pAPDic->GetMatrix("Matrix"); 460 CFX_AffineMatrix matrix = pAPDic->GetMatrix("Matrix");
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, 513 pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE,
516 FALSE); 514 FALSE);
517 } 515 }
518 pPageDict->RemoveAt("Annots"); 516 pPageDict->RemoveAt("Annots");
519 517
520 ObjectArray.RemoveAll(); 518 ObjectArray.RemoveAll();
521 RectArray.RemoveAll(); 519 RectArray.RemoveAll();
522 520
523 return FLATTEN_SUCCESS; 521 return FLATTEN_SUCCESS;
524 } 522 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698