OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |