OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |