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

Side by Side Diff: fpdfsdk/pdfwindow/PWL_FontMap.h

Issue 2594153003: Remove CFX_ArrayTemplate, use unique_ptr in fpdfsdk/pdfwindow (Closed)
Patch Set: Fix compilation Created 3 years, 11 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 | « fpdfsdk/pdfwindow/PWL_Edit.cpp ('k') | fpdfsdk/pdfwindow/PWL_FontMap.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 #ifndef FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ 7 #ifndef FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_
8 #define FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ 8 #define FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_
9 9
10 #include <memory> 10 #include <memory>
11 #include <vector>
11 12
12 #include "core/fpdfdoc/ipvt_fontmap.h" 13 #include "core/fpdfdoc/ipvt_fontmap.h"
13 #include "core/fxge/fx_font.h" 14 #include "core/fxge/fx_font.h"
14 #include "fpdfsdk/fxedit/fx_edit.h" 15 #include "fpdfsdk/fxedit/fx_edit.h"
15 #include "public/fpdf_sysfontinfo.h" 16 #include "public/fpdf_sysfontinfo.h"
16 17
17 class CPDF_Document; 18 class CPDF_Document;
18 class CFX_SystemHandler; 19 class CFX_SystemHandler;
19 20
20 struct CPWL_FontMap_Data { 21 struct CPWL_FontMap_Data {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 int32_t nCharset, 64 int32_t nCharset,
64 bool bFind); 65 bool bFind);
65 int32_t AddFontData(CPDF_Font* pFont, 66 int32_t AddFontData(CPDF_Font* pFont,
66 const CFX_ByteString& sFontAlias, 67 const CFX_ByteString& sFontAlias,
67 int32_t nCharset = FXFONT_DEFAULT_CHARSET); 68 int32_t nCharset = FXFONT_DEFAULT_CHARSET);
68 69
69 CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName, 70 CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName,
70 int32_t nCharset); 71 int32_t nCharset);
71 CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName); 72 CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName);
72 73
73 CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData; 74 std::vector<std::unique_ptr<CPWL_FontMap_Data>> m_Data;
74 CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont; 75 std::vector<std::unique_ptr<CPWL_FontMap_Native>> m_NativeFont;
75 76
76 private: 77 private:
77 int32_t FindFont(const CFX_ByteString& sFontName, 78 int32_t FindFont(const CFX_ByteString& sFontName,
78 int32_t nCharset = FXFONT_DEFAULT_CHARSET); 79 int32_t nCharset = FXFONT_DEFAULT_CHARSET);
79 80
80 CFX_ByteString GetNativeFont(int32_t nCharset); 81 CFX_ByteString GetNativeFont(int32_t nCharset);
81 CPDF_Font* AddFontToDocument(CPDF_Document* pDoc, 82 CPDF_Font* AddFontToDocument(CPDF_Document* pDoc,
82 CFX_ByteString& sFontName, 83 CFX_ByteString& sFontName,
83 uint8_t nCharset); 84 uint8_t nCharset);
84 bool IsStandardFont(const CFX_ByteString& sFontName); 85 bool IsStandardFont(const CFX_ByteString& sFontName);
85 CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName); 86 CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName);
86 CPDF_Font* AddSystemFont(CPDF_Document* pDoc, 87 CPDF_Font* AddSystemFont(CPDF_Document* pDoc,
87 CFX_ByteString& sFontName, 88 CFX_ByteString& sFontName,
88 uint8_t nCharset); 89 uint8_t nCharset);
89 90
90 std::unique_ptr<CPDF_Document> m_pPDFDoc; 91 std::unique_ptr<CPDF_Document> m_pPDFDoc;
91 CFX_SystemHandler* const m_pSystemHandler; 92 CFX_SystemHandler* const m_pSystemHandler;
92 }; 93 };
93 94
94 #endif // FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ 95 #endif // FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_
OLDNEW
« no previous file with comments | « fpdfsdk/pdfwindow/PWL_Edit.cpp ('k') | fpdfsdk/pdfwindow/PWL_FontMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698