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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h" | 9 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h" |
10 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 10 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 {"GBK", 936}, | 28 {"GBK", 936}, |
29 {"Shift-JIS", 932}, | 29 {"Shift-JIS", 932}, |
30 {"UHC", 949}, | 30 {"UHC", 949}, |
31 }; | 31 }; |
32 | 32 |
33 CFX_WideString FPDFDOC_FDF_GetFieldValue(const CPDF_Dictionary& pFieldDict, | 33 CFX_WideString FPDFDOC_FDF_GetFieldValue(const CPDF_Dictionary& pFieldDict, |
34 const CFX_ByteString& bsEncoding) { | 34 const CFX_ByteString& bsEncoding) { |
35 const CFX_ByteString csBValue = pFieldDict.GetStringBy("V"); | 35 const CFX_ByteString csBValue = pFieldDict.GetStringBy("V"); |
36 for (const auto& encoding : g_fieldEncoding) { | 36 for (const auto& encoding : g_fieldEncoding) { |
37 if (bsEncoding == encoding.m_name) | 37 if (bsEncoding == encoding.m_name) |
38 return CFX_WideString::FromCodePage(csBValue, encoding.m_codePage); | 38 return CFX_WideString::FromCodePage(csBValue.AsByteStringC(), |
| 39 encoding.m_codePage); |
39 } | 40 } |
40 CFX_ByteString csTemp = csBValue.Left(2); | 41 CFX_ByteString csTemp = csBValue.Left(2); |
41 if (csTemp == "\xFF\xFE" || csTemp == "\xFE\xFF") | 42 if (csTemp == "\xFF\xFE" || csTemp == "\xFE\xFF") |
42 return PDF_DecodeText(csBValue); | 43 return PDF_DecodeText(csBValue); |
43 return CFX_WideString::FromLocal(csBValue); | 44 return CFX_WideString::FromLocal(csBValue.AsByteStringC()); |
44 } | 45 } |
45 | 46 |
46 } // namespace | 47 } // namespace |
47 | 48 |
48 class CFieldNameExtractor { | 49 class CFieldNameExtractor { |
49 public: | 50 public: |
50 explicit CFieldNameExtractor(const CFX_WideString& full_name) { | 51 explicit CFieldNameExtractor(const CFX_WideString& full_name) { |
51 m_pStart = full_name.c_str(); | 52 m_pStart = full_name.c_str(); |
52 m_pEnd = m_pStart + full_name.GetLength(); | 53 m_pEnd = m_pStart + full_name.GetLength(); |
53 m_pCur = m_pStart; | 54 m_pCur = m_pStart; |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 FDF_ImportField(pField, L"", bNotify); | 1202 FDF_ImportField(pField, L"", bNotify); |
1202 } | 1203 } |
1203 if (bNotify && m_pFormNotify) { | 1204 if (bNotify && m_pFormNotify) { |
1204 m_pFormNotify->AfterFormImportData(this); | 1205 m_pFormNotify->AfterFormImportData(this); |
1205 } | 1206 } |
1206 return TRUE; | 1207 return TRUE; |
1207 } | 1208 } |
1208 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { | 1209 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { |
1209 m_pFormNotify = (CPDF_FormNotify*)pNotify; | 1210 m_pFormNotify = (CPDF_FormNotify*)pNotify; |
1210 } | 1211 } |
OLD | NEW |