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

Side by Side Diff: core/fpdfapi/fpdf_parser/cpdf_document.cpp

Issue 2194853002: Cleanup CPDF_DocPageData release methods and callers. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 4 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 | « core/fpdfapi/fpdf_page/pageint.h ('k') | no next file » | 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 "core/fpdfapi/fpdf_parser/include/cpdf_document.h" 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
8 8
9 #include <memory>
9 #include <set> 10 #include <set>
11 #include <vector>
10 12
11 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h" 13 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h"
12 #include "core/fpdfapi/fpdf_page/cpdf_pagemodule.h" 14 #include "core/fpdfapi/fpdf_page/cpdf_pagemodule.h"
13 #include "core/fpdfapi/fpdf_page/pageint.h" 15 #include "core/fpdfapi/fpdf_page/pageint.h"
14 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" 16 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
15 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" 17 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
16 #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h" 18 #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h"
17 #include "core/fpdfapi/fpdf_parser/include/cpdf_reference.h" 19 #include "core/fpdfapi/fpdf_parser/include/cpdf_reference.h"
18 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" 20 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h"
19 #include "core/fpdfapi/fpdf_render/render_int.h" 21 #include "core/fpdfapi/fpdf_render/render_int.h"
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 774
773 CPDF_Image* CPDF_Document::LoadImageF(CPDF_Object* pObj) { 775 CPDF_Image* CPDF_Document::LoadImageF(CPDF_Object* pObj) {
774 if (!pObj) 776 if (!pObj)
775 return nullptr; 777 return nullptr;
776 778
777 ASSERT(pObj->GetObjNum()); 779 ASSERT(pObj->GetObjNum());
778 return m_pDocPage->GetImage(pObj); 780 return m_pDocPage->GetImage(pObj);
779 } 781 }
780 782
781 void CPDF_Document::RemoveColorSpaceFromPageData(CPDF_Object* pCSObj) { 783 void CPDF_Document::RemoveColorSpaceFromPageData(CPDF_Object* pCSObj) {
782 if (pCSObj) 784 GetPageData()->ReleaseColorSpace(pCSObj);
783 GetPageData()->ReleaseColorSpace(pCSObj);
784 } 785 }
785 786
786 void CPDF_Document::ClearPageData() { 787 void CPDF_Document::ClearPageData() {
787 GetPageData()->Clear(FALSE); 788 GetPageData()->Clear(FALSE);
788 } 789 }
789 790
790 void CPDF_Document::ClearRenderData() { 791 void CPDF_Document::ClearRenderData() {
791 m_pDocRender->Clear(FALSE); 792 m_pDocRender->Clear(FALSE);
792 } 793 }
793 794
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1448 } 1449 }
1449 } 1450 }
1450 pFontDesc->SetAtInteger("StemV", fStemV); 1451 pFontDesc->SetAtInteger("StemV", fStemV);
1451 AddIndirectObject(pFontDesc); 1452 AddIndirectObject(pFontDesc);
1452 pFontDict->SetAtReference("FontDescriptor", this, pFontDesc); 1453 pFontDict->SetAtReference("FontDescriptor", this, pFontDesc);
1453 CFRelease(traits); 1454 CFRelease(traits);
1454 CFRelease(languages); 1455 CFRelease(languages);
1455 return LoadFont(pBaseDict); 1456 return LoadFont(pBaseDict);
1456 } 1457 }
1457 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ 1458 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/pageint.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698