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

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

Issue 2453163002: Take advantage of implicit std::unique_ptr<>(nulltpr_t) ctor. (Closed)
Patch Set: Created 4 years, 1 month 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/fpdfview.cpp ('k') | xfa/fgas/crt/fgas_memory.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 "fpdfsdk/pdfwindow/PWL_FontMap.h" 7 #include "fpdfsdk/pdfwindow/PWL_FontMap.h"
8 8
9 #include "core/fpdfapi/cpdf_modulemgr.h" 9 #include "core/fpdfapi/cpdf_modulemgr.h"
10 #include "core/fpdfapi/font/cpdf_font.h" 10 #include "core/fpdfapi/font/cpdf_font.h"
(...skipping 30 matching lines...) Expand all
41 ASSERT(m_pSystemHandler); 41 ASSERT(m_pSystemHandler);
42 } 42 }
43 43
44 CPWL_FontMap::~CPWL_FontMap() { 44 CPWL_FontMap::~CPWL_FontMap() {
45 Empty(); 45 Empty();
46 } 46 }
47 47
48 CPDF_Document* CPWL_FontMap::GetDocument() { 48 CPDF_Document* CPWL_FontMap::GetDocument() {
49 if (!m_pPDFDoc) { 49 if (!m_pPDFDoc) {
50 if (CPDF_ModuleMgr::Get()) { 50 if (CPDF_ModuleMgr::Get()) {
51 m_pPDFDoc = 51 m_pPDFDoc = pdfium::MakeUnique<CPDF_Document>(nullptr);
52 pdfium::MakeUnique<CPDF_Document>(std::unique_ptr<CPDF_Parser>());
53 m_pPDFDoc->CreateNewDoc(); 52 m_pPDFDoc->CreateNewDoc();
54 } 53 }
55 } 54 }
56 55
57 return m_pPDFDoc.get(); 56 return m_pPDFDoc.get();
58 } 57 }
59 58
60 CPDF_Font* CPWL_FontMap::GetPDFFont(int32_t nFontIndex) { 59 CPDF_Font* CPWL_FontMap::GetPDFFont(int32_t nFontIndex) {
61 if (nFontIndex >= 0 && nFontIndex < m_aData.GetSize()) { 60 if (nFontIndex >= 0 && nFontIndex < m_aData.GetSize()) {
62 if (CPWL_FontMap_Data* pData = m_aData.GetAt(nFontIndex)) { 61 if (CPWL_FontMap_Data* pData = m_aData.GetAt(nFontIndex)) {
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 return FXFONT_RUSSIAN_CHARSET; 439 return FXFONT_RUSSIAN_CHARSET;
441 440
442 if (word >= 0x0100 && word <= 0x024F) 441 if (word >= 0x0100 && word <= 0x024F)
443 return FXFONT_EASTEUROPE_CHARSET; 442 return FXFONT_EASTEUROPE_CHARSET;
444 443
445 if (word >= 0x1E00 && word <= 0x1EFF) 444 if (word >= 0x1E00 && word <= 0x1EFF)
446 return FXFONT_VIETNAMESE_CHARSET; 445 return FXFONT_VIETNAMESE_CHARSET;
447 446
448 return FXFONT_ANSI_CHARSET; 447 return FXFONT_ANSI_CHARSET;
449 } 448 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfview.cpp ('k') | xfa/fgas/crt/fgas_memory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698