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 "xfa/fxfa/fm2js/xfa_fm2jscontext.h" | 7 #include "xfa/fxfa/fm2js/xfa_fm2jscontext.h" |
8 | 8 |
9 #include <time.h> | 9 #include <time.h> |
10 | 10 |
(...skipping 4109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4120 strEncode[8] = 0; | 4120 strEncode[8] = 0; |
4121 CFX_WideTextBuf wsResultBuf; | 4121 CFX_WideTextBuf wsResultBuf; |
4122 uint32_t ch = 0; | 4122 uint32_t ch = 0; |
4123 int32_t iLen = wsHTMLString.GetLength(); | 4123 int32_t iLen = wsHTMLString.GetLength(); |
4124 int32_t i = 0; | 4124 int32_t i = 0; |
4125 const FX_WCHAR* pData = wsHTMLString.c_str(); | 4125 const FX_WCHAR* pData = wsHTMLString.c_str(); |
4126 int32_t iIndex = 0; | 4126 int32_t iIndex = 0; |
4127 CFX_WideString htmlReserve; | 4127 CFX_WideString htmlReserve; |
4128 while (i < iLen) { | 4128 while (i < iLen) { |
4129 ch = *(pData + i); | 4129 ch = *(pData + i); |
4130 htmlReserve.Empty(); | 4130 htmlReserve.clear(); |
4131 if (HTMLCode2STR(ch, htmlReserve)) { | 4131 if (HTMLCode2STR(ch, htmlReserve)) { |
4132 wsResultBuf.AppendChar(L'&'); | 4132 wsResultBuf.AppendChar(L'&'); |
4133 wsResultBuf << htmlReserve; | 4133 wsResultBuf << htmlReserve; |
4134 wsResultBuf.AppendChar(L';'); | 4134 wsResultBuf.AppendChar(L';'); |
4135 } else { | 4135 } else { |
4136 if (ch >= 32 && ch <= 126) { | 4136 if (ch >= 32 && ch <= 126) { |
4137 wsResultBuf.AppendChar((FX_WCHAR)ch); | 4137 wsResultBuf.AppendChar((FX_WCHAR)ch); |
4138 } else if (ch < 256) { | 4138 } else if (ch < 256) { |
4139 iIndex = ch / 16; | 4139 iIndex = ch / 16; |
4140 strEncode[3] = strCode[iIndex]; | 4140 strEncode[3] = strCode[iIndex]; |
(...skipping 3089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7230 CFX_WideString wsFormat; | 7230 CFX_WideString wsFormat; |
7231 pAppProvider->LoadString(iStringID, wsFormat); | 7231 pAppProvider->LoadString(iStringID, wsFormat); |
7232 CFX_WideString wsMessage; | 7232 CFX_WideString wsMessage; |
7233 va_list arg_ptr; | 7233 va_list arg_ptr; |
7234 va_start(arg_ptr, iStringID); | 7234 va_start(arg_ptr, iStringID); |
7235 wsMessage.FormatV(wsFormat.c_str(), arg_ptr); | 7235 wsMessage.FormatV(wsFormat.c_str(), arg_ptr); |
7236 va_end(arg_ptr); | 7236 va_end(arg_ptr); |
7237 FXJSE_ThrowMessage( | 7237 FXJSE_ThrowMessage( |
7238 "", FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC()); | 7238 "", FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC()); |
7239 } | 7239 } |
OLD | NEW |