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/fxcrt/fx_basic.h" | 7 #include "../../include/fxcrt/fx_basic.h" |
8 #include "../../../third_party/base/numerics/safe_math.h" | 8 #include "../../../third_party/base/numerics/safe_math.h" |
9 | 9 |
10 static CFX_StringDataW* FX_AllocStringW(int nLen) | 10 static CFX_StringDataW* FX_AllocStringW(int nLen) |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 nItemLen = 128; | 969 nItemLen = 128; |
970 if (nItemLen < nWidth + nPrecision) { | 970 if (nItemLen < nWidth + nPrecision) { |
971 nItemLen = nWidth + nPrecision; | 971 nItemLen = nWidth + nPrecision; |
972 } | 972 } |
973 break; | 973 break; |
974 case 'f': | 974 case 'f': |
975 if (nWidth + nPrecision > 100) { | 975 if (nWidth + nPrecision > 100) { |
976 nItemLen = nPrecision + nWidth + 128; | 976 nItemLen = nPrecision + nWidth + 128; |
977 } else { | 977 } else { |
978 double f; | 978 double f; |
979 char pszTemp[256] = {0}; | 979 char pszTemp[256]; |
980 f = va_arg(argList, double); | 980 f = va_arg(argList, double); |
981 FXSYS_snprintf(pszTemp, sizeof(pszTemp) - 1, "%*.*f", nW
idth, nPrecision + 6, f ); | 981 FXSYS_snprintf(pszTemp, sizeof(pszTemp), "%*.*f", nWidth
, nPrecision + 6, f ); |
982 nItemLen = (FX_STRSIZE)FXSYS_strlen(pszTemp); | 982 nItemLen = (FX_STRSIZE)FXSYS_strlen(pszTemp); |
983 } | 983 } |
984 break; | 984 break; |
985 case 'p': | 985 case 'p': |
986 va_arg(argList, void*); | 986 va_arg(argList, void*); |
987 nItemLen = 32; | 987 nItemLen = 32; |
988 if (nItemLen < nWidth + nPrecision) { | 988 if (nItemLen < nWidth + nPrecision) { |
989 nItemLen = nWidth + nPrecision; | 989 nItemLen = nWidth + nPrecision; |
990 } | 990 } |
991 break; | 991 break; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 return (CFX_CharMap*)&g_DefaultJISMapper; | 1116 return (CFX_CharMap*)&g_DefaultJISMapper; |
1117 case 936: | 1117 case 936: |
1118 return (CFX_CharMap*)&g_DefaultGBKMapper; | 1118 return (CFX_CharMap*)&g_DefaultGBKMapper; |
1119 case 949: | 1119 case 949: |
1120 return (CFX_CharMap*)&g_DefaultUHCMapper; | 1120 return (CFX_CharMap*)&g_DefaultUHCMapper; |
1121 case 950: | 1121 case 950: |
1122 return (CFX_CharMap*)&g_DefaultBig5Mapper; | 1122 return (CFX_CharMap*)&g_DefaultBig5Mapper; |
1123 } | 1123 } |
1124 return NULL; | 1124 return NULL; |
1125 } | 1125 } |
OLD | NEW |