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

Side by Side Diff: fpdfsdk/fpdf_flatten.cpp

Issue 2425783002: Revert "Make CPDF_Object containers hold objects via unique pointers." (Closed)
Patch Set: Created 4 years, 2 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/cba_fontmap.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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 if (!pAPStream) { 375 if (!pAPStream) {
376 CPDF_Dictionary* pAPDic = pAnnotAP->GetDictFor("N"); 376 CPDF_Dictionary* pAPDic = pAnnotAP->GetDictFor("N");
377 if (!pAPDic) 377 if (!pAPDic)
378 continue; 378 continue;
379 379
380 if (!sAnnotState.IsEmpty()) { 380 if (!sAnnotState.IsEmpty()) {
381 pAPStream = pAPDic->GetStreamFor(sAnnotState); 381 pAPStream = pAPDic->GetStreamFor(sAnnotState);
382 } else { 382 } else {
383 auto it = pAPDic->begin(); 383 auto it = pAPDic->begin();
384 if (it != pAPDic->end()) { 384 if (it != pAPDic->end()) {
385 CPDF_Object* pFirstObj = it->second.get(); 385 CPDF_Object* pFirstObj = it->second;
386 if (pFirstObj) { 386 if (pFirstObj) {
387 if (pFirstObj->IsReference()) 387 if (pFirstObj->IsReference())
388 pFirstObj = pFirstObj->GetDirect(); 388 pFirstObj = pFirstObj->GetDirect();
389 if (!pFirstObj->IsStream()) 389 if (!pFirstObj->IsStream())
390 continue; 390 continue;
391 pAPStream = pFirstObj->AsStream(); 391 pAPStream = pFirstObj->AsStream();
392 } 392 }
393 } 393 }
394 } 394 }
395 } 395 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 sTemp.Format("q %f 0 0 %f %f %f cm /%s Do Q\n", m.a, m.d, m.e, m.f, 449 sTemp.Format("q %f 0 0 %f %f %f cm /%s Do Q\n", m.a, m.d, m.e, m.f,
450 sFormName.c_str()); 450 sFormName.c_str());
451 sStream += sTemp; 451 sStream += sTemp;
452 pNewXObject->SetData(sStream.raw_str(), sStream.GetLength()); 452 pNewXObject->SetData(sStream.raw_str(), sStream.GetLength());
453 } 453 }
454 pPageDict->RemoveFor("Annots"); 454 pPageDict->RemoveFor("Annots");
455 455
456 RectArray.RemoveAll(); 456 RectArray.RemoveAll();
457 return FLATTEN_SUCCESS; 457 return FLATTEN_SUCCESS;
458 } 458 }
OLDNEW
« no previous file with comments | « fpdfsdk/formfiller/cba_fontmap.cpp ('k') | fpdfsdk/fpdf_transformpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698