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

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

Issue 2350763002: Revert of Pdfium: Fix fonts leaking on ClosePage. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 3 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/fpdf_page_doc.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render.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/fpdfapi/fpdf_parser/include/cpdf_document.h" 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
11 #include <vector> 11 #include <vector>
12 12
13 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h" 13 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h"
14 #include "core/fpdfapi/fpdf_page/cpdf_pagemodule.h" 14 #include "core/fpdfapi/fpdf_page/cpdf_pagemodule.h"
15 #include "core/fpdfapi/fpdf_page/pageint.h" 15 #include "core/fpdfapi/fpdf_page/pageint.h"
16 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" 16 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
17 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" 17 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
18 #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h" 18 #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h"
19 #include "core/fpdfapi/fpdf_parser/include/cpdf_reference.h" 19 #include "core/fpdfapi/fpdf_parser/include/cpdf_reference.h"
20 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" 20 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h"
21 #include "core/fpdfapi/fpdf_render/render_int.h" 21 #include "core/fpdfapi/fpdf_render/render_int.h"
22 #include "core/fpdfapi/include/cpdf_modulemgr.h" 22 #include "core/fpdfapi/include/cpdf_modulemgr.h"
23 #include "core/fxcodec/include/JBig2_DocumentContext.h" 23 #include "core/fxcodec/include/JBig2_DocumentContext.h"
24 #include "core/fxge/include/cfx_fontcache.h"
24 #include "core/fxge/include/cfx_unicodeencoding.h" 25 #include "core/fxge/include/cfx_unicodeencoding.h"
25 #include "core/fxge/include/fx_font.h" 26 #include "core/fxge/include/fx_font.h"
26 #include "third_party/base/stl_util.h" 27 #include "third_party/base/stl_util.h"
27 28
28 namespace { 29 namespace {
29 30
30 const int FX_MAX_PAGE_LEVEL = 1024; 31 const int FX_MAX_PAGE_LEVEL = 1024;
31 32
32 const uint16_t g_FX_CP874Unicodes[128] = { 33 const uint16_t g_FX_CP874Unicodes[128] = {
33 0x20AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x2026, 0x0000, 0x0000, 0x0000, 34 0x20AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x2026, 0x0000, 0x0000, 0x0000,
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 pFontDesc->SetAtInteger("CapHeight", capheight); 1043 pFontDesc->SetAtInteger("CapHeight", capheight);
1043 pFontDesc->SetAtInteger("StemV", pLogFont->lfWeight / 5); 1044 pFontDesc->SetAtInteger("StemV", pLogFont->lfWeight / 5);
1044 AddIndirectObject(pFontDesc); 1045 AddIndirectObject(pFontDesc);
1045 pFontDict->SetAtReference("FontDescriptor", this, pFontDesc); 1046 pFontDict->SetAtReference("FontDescriptor", this, pFontDesc);
1046 hFont = SelectObject(hDC, hFont); 1047 hFont = SelectObject(hDC, hFont);
1047 DeleteObject(hFont); 1048 DeleteObject(hFont);
1048 DeleteDC(hDC); 1049 DeleteDC(hDC);
1049 return LoadFont(pBaseDict); 1050 return LoadFont(pBaseDict);
1050 } 1051 }
1051 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 1052 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/fpdf_page_doc.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698