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

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

Issue 809993004: Get rid of FX_LPCSTR cast. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Indent Created 5 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
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 "../../../include/fpdfapi/fpdf_page.h" 7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "../fpdf_page/pageint.h" 9 #include "../fpdf_page/pageint.h"
10 #include <limits.h> 10 #include <limits.h>
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 FX_Free(widths); 216 FX_Free(widths);
217 } 217 }
218 CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTW* pLogFont, FX_BOOL bVert, FX_B OOL bTranslateName) 218 CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTW* pLogFont, FX_BOOL bVert, FX_B OOL bTranslateName)
219 { 219 {
220 LOGFONTA lfa; 220 LOGFONTA lfa;
221 FXSYS_memcpy32(&lfa, pLogFont, (char*)lfa.lfFaceName - (char*)&lfa); 221 FXSYS_memcpy32(&lfa, pLogFont, (char*)lfa.lfFaceName - (char*)&lfa);
222 CFX_ByteString face = CFX_ByteString::FromUnicode(pLogFont->lfFaceName); 222 CFX_ByteString face = CFX_ByteString::FromUnicode(pLogFont->lfFaceName);
223 if (face.GetLength() >= LF_FACESIZE) { 223 if (face.GetLength() >= LF_FACESIZE) {
224 return NULL; 224 return NULL;
225 } 225 }
226 FXSYS_strcpy(lfa.lfFaceName, (FX_LPCSTR)face); 226 FXSYS_strcpy(lfa.lfFaceName, face.c_str());
227 return AddWindowsFont(&lfa, bVert, bTranslateName); 227 return AddWindowsFont(&lfa, bVert, bTranslateName);
228 } 228 }
229 extern CFX_ByteString _FPDF_GetNameFromTT(FX_LPCBYTE name_table, FX_DWORD name); 229 extern CFX_ByteString _FPDF_GetNameFromTT(FX_LPCBYTE name_table, FX_DWORD name);
230 CFX_ByteString _FPDF_GetPSNameFromTT(HDC hDC) 230 CFX_ByteString _FPDF_GetPSNameFromTT(HDC hDC)
231 { 231 {
232 CFX_ByteString result; 232 CFX_ByteString result;
233 DWORD size = ::GetFontData(hDC, 'eman', 0, NULL, 0); 233 DWORD size = ::GetFontData(hDC, 'eman', 0, NULL, 0);
234 if (size != GDI_ERROR) { 234 if (size != GDI_ERROR) {
235 LPBYTE buffer = FX_Alloc(BYTE, size); 235 LPBYTE buffer = FX_Alloc(BYTE, size);
236 ::GetFontData(hDC, 'eman', 0, buffer, size); 236 ::GetFontData(hDC, 'eman', 0, buffer, size);
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, FX_BSTR name) 1175 void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, FX_BSTR name)
1176 { 1176 {
1177 if (pPageDict->KeyExist(name)) { 1177 if (pPageDict->KeyExist(name)) {
1178 return; 1178 return;
1179 } 1179 }
1180 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name); 1180 CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name);
1181 if (pObj) { 1181 if (pObj) {
1182 pPageDict->SetAt(name, pObj->Clone()); 1182 pPageDict->SetAt(name, pObj->Clone());
1183 } 1183 }
1184 } 1184 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp ('k') | core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698