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

Side by Side Diff: core/src/fpdfapi/fpdf_font/fpdf_font.cpp

Issue 811593007: XFA: merge patch from CL 733693003, getting rid of more casts (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 6 years 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/fxcrt/fx_string.h ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.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 "../../../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 "../../../include/fpdfapi/fpdf_pageobj.h" 9 #include "../../../include/fpdfapi/fpdf_pageobj.h"
10 #include "font_int.h" 10 #include "font_int.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 result += (FX_WCHAR)charcode; 221 result += (FX_WCHAR)charcode;
222 } 222 }
223 } 223 }
224 return result; 224 return result;
225 } 225 }
226 CFX_ByteString CPDF_Font::EncodeString(const CFX_WideString& str) const 226 CFX_ByteString CPDF_Font::EncodeString(const CFX_WideString& str) const
227 { 227 {
228 CFX_ByteString result; 228 CFX_ByteString result;
229 int src_len = str.GetLength(); 229 int src_len = str.GetLength();
230 FX_LPSTR dest_buf = result.GetBuffer(src_len * 2); 230 FX_LPSTR dest_buf = result.GetBuffer(src_len * 2);
231 FX_LPCWSTR src_buf = str; 231 FX_LPCWSTR src_buf = str.c_str();
232 int dest_pos = 0; 232 int dest_pos = 0;
233 for (int src_pos = 0; src_pos < src_len; src_pos ++) { 233 for (int src_pos = 0; src_pos < src_len; src_pos ++) {
234 FX_DWORD charcode = CharCodeFromUnicode(src_buf[src_pos]); 234 FX_DWORD charcode = CharCodeFromUnicode(src_buf[src_pos]);
235 dest_pos += AppendChar(dest_buf + dest_pos, charcode); 235 dest_pos += AppendChar(dest_buf + dest_pos, charcode);
236 } 236 }
237 result.ReleaseBuffer(dest_pos); 237 result.ReleaseBuffer(dest_pos);
238 return result; 238 return result;
239 } 239 }
240 void CPDF_Font::LoadFontDescriptor(CPDF_Dictionary* pFontDesc) 240 void CPDF_Font::LoadFontDescriptor(CPDF_Dictionary* pFontDesc)
241 { 241 {
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 } 1761 }
1762 CPDF_Type3Char::~CPDF_Type3Char() 1762 CPDF_Type3Char::~CPDF_Type3Char()
1763 { 1763 {
1764 if (m_pForm) { 1764 if (m_pForm) {
1765 delete m_pForm; 1765 delete m_pForm;
1766 } 1766 }
1767 if (m_pBitmap) { 1767 if (m_pBitmap) {
1768 delete m_pBitmap; 1768 delete m_pBitmap;
1769 } 1769 }
1770 } 1770 }
OLDNEW
« no previous file with comments | « core/include/fxcrt/fx_string.h ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698