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

Side by Side Diff: core/fpdfapi/page/cpdf_streamcontentparser.cpp

Issue 2484033002: Return unique_ptr from CPDF_Object::Clone(). (Closed)
Patch Set: std::move() it Created 4 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/fpdfapi/page/cpdf_contentmarkitem.cpp ('k') | core/fpdfapi/parser/cpdf_array.h » ('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 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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 "core/fpdfapi/page/cpdf_streamcontentparser.h" 7 #include "core/fpdfapi/page/cpdf_streamcontentparser.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 } 660 }
661 ReplaceAbbr(pDict); 661 ReplaceAbbr(pDict);
662 CPDF_Object* pCSObj = nullptr; 662 CPDF_Object* pCSObj = nullptr;
663 if (pDict->KeyExist("ColorSpace")) { 663 if (pDict->KeyExist("ColorSpace")) {
664 pCSObj = pDict->GetDirectObjectFor("ColorSpace"); 664 pCSObj = pDict->GetDirectObjectFor("ColorSpace");
665 if (pCSObj->IsName()) { 665 if (pCSObj->IsName()) {
666 CFX_ByteString name = pCSObj->GetString(); 666 CFX_ByteString name = pCSObj->GetString();
667 if (name != "DeviceRGB" && name != "DeviceGray" && name != "DeviceCMYK") { 667 if (name != "DeviceRGB" && name != "DeviceGray" && name != "DeviceCMYK") {
668 pCSObj = FindResourceObj("ColorSpace", name); 668 pCSObj = FindResourceObj("ColorSpace", name);
669 if (pCSObj && pCSObj->IsInline()) { 669 if (pCSObj && pCSObj->IsInline()) {
670 pCSObj = pCSObj->Clone(); 670 pCSObj = pCSObj->Clone().release();
671 pDict->SetFor("ColorSpace", pCSObj); 671 pDict->SetFor("ColorSpace", pCSObj);
672 } 672 }
673 } 673 }
674 } 674 }
675 } 675 }
676 pDict->SetNameFor("Subtype", "Image"); 676 pDict->SetNameFor("Subtype", "Image");
677 std::unique_ptr<CPDF_Stream> pStream( 677 std::unique_ptr<CPDF_Stream> pStream(
678 m_pSyntax->ReadInlineStream(m_pDocument, pDict, pCSObj)); 678 m_pSyntax->ReadInlineStream(m_pDocument, pDict, pCSObj));
679 bool bGaveDictAway = !!pStream; 679 bool bGaveDictAway = !!pStream;
680 while (1) { 680 while (1) {
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 } 1665 }
1666 default: 1666 default:
1667 bProcessed = false; 1667 bProcessed = false;
1668 } 1668 }
1669 if (!bProcessed) { 1669 if (!bProcessed) {
1670 m_pSyntax->SetPos(last_pos); 1670 m_pSyntax->SetPos(last_pos);
1671 return; 1671 return;
1672 } 1672 }
1673 } 1673 }
1674 } 1674 }
OLDNEW
« no previous file with comments | « core/fpdfapi/page/cpdf_contentmarkitem.cpp ('k') | core/fpdfapi/parser/cpdf_array.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698