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

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

Issue 1780503002: Split off CPDF_Document into its own .cpp/.h files. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 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
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/include/fpdfapi/fpdf_parser.h" 7 #include "core/include/fpdfapi/cpdf_document.h"
8 8
9 #include <set> 9 #include <set>
10 10
11 #include "core/include/fpdfapi/fpdf_module.h" 11 #include "core/include/fpdfapi/fpdf_module.h"
12 #include "core/include/fpdfapi/fpdf_parser.h"
13 #include "core/include/fxge/fx_font.h"
14 #include "core/src/fpdfapi/fpdf_render/render_int.h"
12 #include "third_party/base/stl_util.h" 15 #include "third_party/base/stl_util.h"
13 16
14 namespace { 17 namespace {
15 18
16 int CountPages(CPDF_Dictionary* pPages, 19 int CountPages(CPDF_Dictionary* pPages,
17 std::set<CPDF_Dictionary*>* visited_pages) { 20 std::set<CPDF_Dictionary*>* visited_pages) {
18 int count = pPages->GetIntegerBy("Count"); 21 int count = pPages->GetIntegerBy("Count");
19 if (count > 0 && count < FPDF_PAGE_MAX_NUM) { 22 if (count > 0 && count < FPDF_PAGE_MAX_NUM) {
20 return count; 23 return count;
21 } 24 }
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 332
330 void CPDF_Document::ClearPageData() { 333 void CPDF_Document::ClearPageData() {
331 if (m_pDocPage) 334 if (m_pDocPage)
332 CPDF_ModuleMgr::Get()->GetPageModule()->ClearDoc(this); 335 CPDF_ModuleMgr::Get()->GetPageModule()->ClearDoc(this);
333 } 336 }
334 337
335 void CPDF_Document::ClearRenderData() { 338 void CPDF_Document::ClearRenderData() {
336 if (m_pDocRender) 339 if (m_pDocRender)
337 CPDF_ModuleMgr::Get()->GetRenderModule()->ClearDocData(m_pDocRender); 340 CPDF_ModuleMgr::Get()->GetRenderModule()->ClearDocData(m_pDocRender);
338 } 341 }
342
343 void CPDF_Document::ClearRenderFont() {
344 if (m_pDocRender) {
dsinclair 2016/03/08 20:57:08 if (!m_pDocReader) return; ?
Tom Sepez 2016/03/08 21:10:30 Done.
345 CFX_FontCache* pCache = m_pDocRender->GetFontCache();
346 if (pCache) {
347 pCache->FreeCache(FALSE);
348 }
dsinclair 2016/03/08 20:57:08 nit: remove {}
Tom Sepez 2016/03/08 21:10:30 Done.
349 }
350 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698