| 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 "../../../third_party/base/nonstd_unique_ptr.h" | 7 #include "../../../third_party/base/nonstd_unique_ptr.h" |
| 8 #include "../../include/fpdfapi/fpdf_page.h" | 8 #include "../../include/fpdfapi/fpdf_page.h" |
| 9 #include "../../include/fpdfapi/fpdf_pageobj.h" | 9 #include "../../include/fpdfapi/fpdf_pageobj.h" |
| 10 #include "../../include/fpdfapi/fpdf_resource.h" |
| 10 #include "../../include/fpdftext/fpdf_text.h" | 11 #include "../../include/fpdftext/fpdf_text.h" |
| 11 #include "../../include/fxcrt/fx_arb.h" | 12 #include "../../include/fxcrt/fx_arb.h" |
| 12 #include "../../include/fxcrt/fx_ucd.h" | 13 #include "../../include/fxcrt/fx_ucd.h" |
| 13 #include "text_int.h" | 14 #include "text_int.h" |
| 14 #include "txtproc.h" | 15 #include "txtproc.h" |
| 15 | 16 |
| 16 extern const FX_CHAR* FCS_GetAltStr(FX_WCHAR); | |
| 17 CFX_ByteString CharFromUnicodeAlt(FX_WCHAR unicode, int destcp, const FX_CHAR* d
efchar) | 17 CFX_ByteString CharFromUnicodeAlt(FX_WCHAR unicode, int destcp, const FX_CHAR* d
efchar) |
| 18 { | 18 { |
| 19 if (destcp == 0) { | 19 if (destcp == 0) { |
| 20 if (unicode < 0x80) { | 20 if (unicode < 0x80) { |
| 21 return CFX_ByteString((char)unicode); | 21 return CFX_ByteString((char)unicode); |
| 22 } | 22 } |
| 23 const FX_CHAR* altstr = FCS_GetAltStr(unicode); | 23 const FX_CHAR* altstr = FCS_GetAltStr(unicode); |
| 24 if (altstr) { | 24 if (altstr) { |
| 25 return CFX_ByteString(altstr, -1); | 25 return CFX_ByteString(altstr, -1); |
| 26 } | 26 } |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 { | 769 { |
| 770 buffer.EstimateSize(0, 10240); | 770 buffer.EstimateSize(0, 10240); |
| 771 CPDF_Page page; | 771 CPDF_Page page; |
| 772 page.Load(pDoc, pPage); | 772 page.Load(pDoc, pPage); |
| 773 CPDF_ParseOptions options; | 773 CPDF_ParseOptions options; |
| 774 options.m_bTextOnly = TRUE; | 774 options.m_bTextOnly = TRUE; |
| 775 options.m_bSeparateForm = FALSE; | 775 options.m_bSeparateForm = FALSE; |
| 776 page.ParseContent(&options); | 776 page.ParseContent(&options); |
| 777 _PDF_GetTextStream_Unicode(buffer, &page, TRUE, NULL); | 777 _PDF_GetTextStream_Unicode(buffer, &page, TRUE, NULL); |
| 778 } | 778 } |
| OLD | NEW |