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

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

Issue 1780063003: Move ScopedSetInsertion to third_party/base/stl_util.h (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
« no previous file with comments | « core/include/fxcrt/fx_ext.h ('k') | core/src/fpdfapi/fpdf_parser/cpdf_parser.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 "core/include/fpdfapi/cpdf_document.h" 7 #include "core/include/fpdfapi/cpdf_document.h"
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 17 matching lines...) Expand all
28 return 0; 28 return 0;
29 } 29 }
30 count = 0; 30 count = 0;
31 for (FX_DWORD i = 0; i < pKidList->GetCount(); i++) { 31 for (FX_DWORD i = 0; i < pKidList->GetCount(); i++) {
32 CPDF_Dictionary* pKid = pKidList->GetDictAt(i); 32 CPDF_Dictionary* pKid = pKidList->GetDictAt(i);
33 if (!pKid || pdfium::ContainsKey(*visited_pages, pKid)) { 33 if (!pKid || pdfium::ContainsKey(*visited_pages, pKid)) {
34 continue; 34 continue;
35 } 35 }
36 if (pKid->KeyExist("Kids")) { 36 if (pKid->KeyExist("Kids")) {
37 // Use |visited_pages| to help detect circular references of pages. 37 // Use |visited_pages| to help detect circular references of pages.
38 ScopedSetInsertion<CPDF_Dictionary*> local_add(visited_pages, pKid); 38 pdfium::ScopedSetInsertion<CPDF_Dictionary*> local_add(visited_pages,
39 pKid);
39 count += CountPages(pKid, visited_pages); 40 count += CountPages(pKid, visited_pages);
40 } else { 41 } else {
41 // This page is a leaf node. 42 // This page is a leaf node.
42 count++; 43 count++;
43 } 44 }
44 } 45 }
45 pPages->SetAtInteger("Count", count); 46 pPages->SetAtInteger("Count", count);
46 return count; 47 return count;
47 } 48 }
48 49
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 } 343 }
343 344
344 void CPDF_Document::ClearRenderFont() { 345 void CPDF_Document::ClearRenderFont() {
345 if (!m_pDocRender) 346 if (!m_pDocRender)
346 return; 347 return;
347 348
348 CFX_FontCache* pCache = m_pDocRender->GetFontCache(); 349 CFX_FontCache* pCache = m_pDocRender->GetFontCache();
349 if (pCache) 350 if (pCache)
350 pCache->FreeCache(FALSE); 351 pCache->FreeCache(FALSE);
351 } 352 }
OLDNEW
« no previous file with comments | « core/include/fxcrt/fx_ext.h ('k') | core/src/fpdfapi/fpdf_parser/cpdf_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698