Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: xfa/fxfa/fm2js/xfa_fm2jscontext.cpp

Issue 1888103002: Replace calls to deprecated CFX_{Wide,Byte}String::Empty() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fxfa/fm2js/xfa_fm2jsapi.cpp ('k') | xfa/fxfa/include/fxfa.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « xfa/fxfa/fm2js/xfa_fm2jsapi.cpp ('k') | xfa/fxfa/include/fxfa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698