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

Unified Diff: xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp

Issue 826573003: Fixed incorrect use of FX_WSTRC on FX_WCHAR* vars. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp
diff --git a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp
index 3f44b5d254d35484e66b3f06c884ec86786cdf99..330bfcfcf520fd3d621c58a81f2a490e5333d56e 100644
--- a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp
@@ -3861,12 +3861,12 @@ void CXFA_FM2JSContext::DecodeXML (FX_BSTR szXMLString, CFX_ByteTextBuf &szResu
++i;
continue;
}
- FX_WCHAR *strName[] = {
- (FX_WCHAR *)L"quot",
- (FX_WCHAR *)L"amp",
- (FX_WCHAR *)L"apos",
- (FX_WCHAR *)L"lt",
- (FX_WCHAR *)L"gt"
+ FX_LPCWSTR const strName[] = {
+ L"quot",
+ L"amp",
+ L"apos",
+ L"lt",
+ L"gt"
};
FX_INT32 iIndex = 0;
while (iIndex < 5) {
@@ -3958,7 +3958,7 @@ void CXFA_FM2JSContext::EncodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResu
FX_WCHAR strUnsafe[] = { ' ', '<', '>', '"', '#', '%', '{', '}', '|', '\\', '^', '~', '[', ']', '`' };
FX_WCHAR strReserved[] = {';', '/', '?', ':', '@', '=', '&'};
FX_WCHAR strSpecial[] = {'$', '-', '+', '!', '*', '\'', '(', ')', ','};
- FX_WCHAR* strCode = (FX_WCHAR *)L"0123456789abcdef";
+ FX_WCHAR* strCode = L"0123456789abcdef";
for (FX_INT32 u = 0; u < iLength; ++u) {
ch = wsURLString.GetAt(u);
FX_INT32 i = 0;
@@ -4121,14 +4121,14 @@ void CXFA_FM2JSContext::EncodeXML (FX_BSTR szXMLString, CFX_ByteTextBuf &szResu
strEncode[6] = 0;
strEncode[7] = ';';
strEncode[8] = 0;
- FX_WCHAR *strName[] = {
- (FX_WCHAR *)L"quot",
- (FX_WCHAR *)L"amp",
- (FX_WCHAR *)L"apos",
- (FX_WCHAR *)L"lt",
- (FX_WCHAR *)L"gt"
+ FX_LPCWSTR const strName[] = {
+ L"quot",
+ L"amp",
+ L"apos",
+ L"lt",
+ L"gt"
};
- FX_WCHAR* strCode = (FX_WCHAR *)L"0123456789abcdef";
+ FX_WCHAR* strCode = L"0123456789abcdef";
FX_WCHAR ch = 0;
FX_INT32 iLength = wsXMLString.GetLength();
FX_INT32 iIndex = 0;
@@ -4139,27 +4139,27 @@ void CXFA_FM2JSContext::EncodeXML (FX_BSTR szXMLString, CFX_ByteTextBuf &szResu
switch (ch) {
case '"':
wsResultBuf.AppendChar('&');
- wsResultBuf << FX_WSTRC(strName[QUOT]);
+ wsResultBuf << CFX_WideStringC(strName[QUOT]);
wsResultBuf.AppendChar(';');
break;
case '&':
wsResultBuf.AppendChar('&');
- wsResultBuf << FX_WSTRC(strName[AMP]);
+ wsResultBuf << CFX_WideStringC(strName[AMP]);
wsResultBuf.AppendChar(';');
break;
case '\'':
wsResultBuf.AppendChar('&');
- wsResultBuf << FX_WSTRC(strName[APOS]);
+ wsResultBuf << CFX_WideStringC(strName[APOS]);
wsResultBuf.AppendChar(';');
break;
case '<':
wsResultBuf.AppendChar('&');
- wsResultBuf << FX_WSTRC(strName[LT]);
+ wsResultBuf << CFX_WideStringC(strName[LT]);
wsResultBuf.AppendChar(';');
break;
case '>':
wsResultBuf.AppendChar('&');
- wsResultBuf << FX_WSTRC(strName[GT]);
+ wsResultBuf << CFX_WideStringC(strName[GT]);
wsResultBuf.AppendChar(';');
break;
default: {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698