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

Side by Side Diff: core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp

Issue 1547833002: Switch from nonstd::unique_ptr to std::unique_ptr. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 12 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/fxge/fx_font.h ('k') | core/src/fpdfapi/fpdf_font/fpdf_font.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 <limits.h> 7 #include <limits.h>
8 8
9 #include "core/include/fpdfapi/fpdf_module.h" 9 #include "core/include/fpdfapi/fpdf_module.h"
10 #include "core/include/fpdfapi/fpdf_page.h" 10 #include "core/include/fpdfapi/fpdf_page.h"
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 flags |= PDFFONT_FORCEBOLD; 839 flags |= PDFFONT_FORCEBOLD;
840 } 840 }
841 if (pFont->IsItalic()) { 841 if (pFont->IsItalic()) {
842 flags |= PDFFONT_ITALIC; 842 flags |= PDFFONT_ITALIC;
843 } 843 }
844 if (pFont->IsFixedWidth()) { 844 if (pFont->IsFixedWidth()) {
845 flags |= PDFFONT_FIXEDPITCH; 845 flags |= PDFFONT_FIXEDPITCH;
846 } 846 }
847 CPDF_Dictionary* pBaseDict = new CPDF_Dictionary; 847 CPDF_Dictionary* pBaseDict = new CPDF_Dictionary;
848 pBaseDict->SetAtName("Type", "Font"); 848 pBaseDict->SetAtName("Type", "Font");
849 nonstd::unique_ptr<CFX_UnicodeEncoding> pEncoding( 849 std::unique_ptr<CFX_UnicodeEncoding> pEncoding(
850 new CFX_UnicodeEncoding(pFont)); 850 new CFX_UnicodeEncoding(pFont));
851 CPDF_Dictionary* pFontDict = pBaseDict; 851 CPDF_Dictionary* pFontDict = pBaseDict;
852 if (!bCJK) { 852 if (!bCJK) {
853 CPDF_Array* pWidths = new CPDF_Array; 853 CPDF_Array* pWidths = new CPDF_Array;
854 int charcode; 854 int charcode;
855 for (charcode = 32; charcode < 128; charcode++) { 855 for (charcode = 32; charcode < 128; charcode++) {
856 int glyph_index = pEncoding->GlyphFromCharCode(charcode); 856 int glyph_index = pEncoding->GlyphFromCharCode(charcode);
857 int char_width = pFont->GetGlyphWidth(glyph_index); 857 int char_width = pFont->GetGlyphWidth(glyph_index);
858 pWidths->AddInteger(char_width); 858 pWidths->AddInteger(char_width);
859 } 859 }
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, 1141 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict,
1142 const CFX_ByteStringC& name) { 1142 const CFX_ByteStringC& name) {
1143 if (pPageDict->KeyExist(name)) { 1143 if (pPageDict->KeyExist(name)) {
1144 return; 1144 return;
1145 } 1145 }
1146 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name); 1146 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name);
1147 if (pObj) { 1147 if (pObj) {
1148 pPageDict->SetAt(name, pObj->Clone()); 1148 pPageDict->SetAt(name, pObj->Clone());
1149 } 1149 }
1150 } 1150 }
OLDNEW
« no previous file with comments | « core/include/fxge/fx_font.h ('k') | core/src/fpdfapi/fpdf_font/fpdf_font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698