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 "core/fpdftext/unicodenormalization.h" | 7 #include "core/fpdftext/unicodenormalization.h" |
8 | 8 |
9 #include "core/fpdftext/unicodenormalizationdata.h" | 9 #include "core/fpdftext/unicodenormalizationdata.h" |
10 #include "core/include/fxcrt/fx_string.h" | 10 #include "core/fxcrt/include/fx_string.h" |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 const uint16_t* const g_UnicodeData_Normalization_Maps[5] = { | 14 const uint16_t* const g_UnicodeData_Normalization_Maps[5] = { |
15 nullptr, g_UnicodeData_Normalization_Map1, g_UnicodeData_Normalization_Map2, | 15 nullptr, g_UnicodeData_Normalization_Map1, g_UnicodeData_Normalization_Map2, |
16 g_UnicodeData_Normalization_Map3, g_UnicodeData_Normalization_Map4}; | 16 g_UnicodeData_Normalization_Map3, g_UnicodeData_Normalization_Map4}; |
17 | 17 |
18 } // namespace | 18 } // namespace |
19 | 19 |
20 FX_STRSIZE FX_Unicode_GetNormalization(FX_WCHAR wch, FX_WCHAR* pDst) { | 20 FX_STRSIZE FX_Unicode_GetNormalization(FX_WCHAR wch, FX_WCHAR* pDst) { |
(...skipping 20 matching lines...) Expand all Loading... |
41 pMap += wch; | 41 pMap += wch; |
42 } | 42 } |
43 if (pDst) { | 43 if (pDst) { |
44 FX_WCHAR n = wFind; | 44 FX_WCHAR n = wFind; |
45 while (n--) { | 45 while (n--) { |
46 *pDst++ = *pMap++; | 46 *pDst++ = *pMap++; |
47 } | 47 } |
48 } | 48 } |
49 return (FX_STRSIZE)wFind; | 49 return (FX_STRSIZE)wFind; |
50 } | 50 } |
OLD | NEW |