summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/PublicMethods.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/javascript/PublicMethods.cpp')
-rw-r--r--fpdfsdk/javascript/PublicMethods.cpp104
1 files changed, 52 insertions, 52 deletions
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp
index 3bcbc341ac..f479527ef6 100644
--- a/fpdfsdk/javascript/PublicMethods.cpp
+++ b/fpdfsdk/javascript/PublicMethods.cpp
@@ -59,14 +59,14 @@ IMPLEMENT_JS_STATIC_GLOBAL_FUN(CJS_PublicMethods)
namespace {
-const FX_WCHAR* const months[] = {L"Jan", L"Feb", L"Mar", L"Apr",
- L"May", L"Jun", L"Jul", L"Aug",
- L"Sep", L"Oct", L"Nov", L"Dec"};
+const wchar_t* const months[] = {L"Jan", L"Feb", L"Mar", L"Apr",
+ L"May", L"Jun", L"Jul", L"Aug",
+ L"Sep", L"Oct", L"Nov", L"Dec"};
-const FX_WCHAR* const fullmonths[] = {L"January", L"February", L"March",
- L"April", L"May", L"June",
- L"July", L"August", L"September",
- L"October", L"November", L"December"};
+const wchar_t* const fullmonths[] = {L"January", L"February", L"March",
+ L"April", L"May", L"June",
+ L"July", L"August", L"September",
+ L"October", L"November", L"December"};
CFX_ByteString StrTrim(const CFX_ByteString& pStr) {
CFX_ByteString result(pStr);
@@ -82,7 +82,7 @@ CFX_WideString StrTrim(const CFX_WideString& pStr) {
return result;
}
-void AlertIfPossible(CJS_EventContext* pContext, const FX_WCHAR* swMsg) {
+void AlertIfPossible(CJS_EventContext* pContext, const wchar_t* swMsg) {
CPDFSDK_FormFillEnvironment* pFormFillEnv = pContext->GetFormFillEnv();
if (pFormFillEnv)
pFormFillEnv->JS_appAlert(swMsg, nullptr, 0, 3);
@@ -115,8 +115,8 @@ CFX_ByteString CalculateString(double dValue,
bool CJS_PublicMethods::IsNumber(const CFX_WideString& str) {
CFX_WideString sTrim = StrTrim(str);
- const FX_WCHAR* pTrim = sTrim.c_str();
- const FX_WCHAR* p = pTrim;
+ const wchar_t* pTrim = sTrim.c_str();
+ const wchar_t* p = pTrim;
bool bDot = false;
bool bKXJS = false;
@@ -168,7 +168,7 @@ bool CJS_PublicMethods::isReservedMaskChar(wchar_t ch) {
return ch == L'9' || ch == L'A' || ch == L'O' || ch == L'X';
}
-double CJS_PublicMethods::AF_Simple(const FX_WCHAR* sFuction,
+double CJS_PublicMethods::AF_Simple(const wchar_t* sFuction,
double dValue1,
double dValue2) {
if (FXSYS_wcsicmp(sFuction, L"AVG") == 0 ||
@@ -235,7 +235,7 @@ int CJS_PublicMethods::ParseStringInteger(const CFX_WideString& str,
if (i - nStart > 10)
break;
- FX_WCHAR c = str.GetAt(i);
+ wchar_t c = str.GetAt(i);
if (!FXSYS_iswdigit(c))
break;
@@ -254,7 +254,7 @@ CFX_WideString CJS_PublicMethods::ParseStringString(const CFX_WideString& str,
CFX_WideString swRet;
nSkip = 0;
for (int i = nStart, sz = str.GetLength(); i < sz; i++) {
- FX_WCHAR c = str.GetAt(i);
+ wchar_t c = str.GetAt(i);
if (!FXSYS_iswdigit(c))
break;
@@ -286,7 +286,7 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString& value,
if (nIndex > 2)
break;
- FX_WCHAR c = value.GetAt(i);
+ wchar_t c = value.GetAt(i);
if (FXSYS_iswdigit(c)) {
number[nIndex++] = ParseStringInteger(value, i, nSkip, 4);
i += nSkip;
@@ -373,7 +373,7 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString& value,
if (bExit)
break;
- FX_WCHAR c = format.GetAt(i);
+ wchar_t c = format.GetAt(i);
switch (c) {
case ':':
case '.':
@@ -630,7 +630,7 @@ CFX_WideString CJS_PublicMethods::MakeFormatDate(double dDate,
int i = 0;
while (i < format.GetLength()) {
- FX_WCHAR c = format.GetAt(i);
+ wchar_t c = format.GetAt(i);
int remaining = format.GetLength() - i - 1;
sPart = L"";
switch (c) {
@@ -946,7 +946,7 @@ bool CJS_PublicMethods::AFNumber_Keystroke(CJS_Runtime* pRuntime,
int iSepStyle = params[1].ToInt(pRuntime);
if (iSepStyle < 0 || iSepStyle > 3)
iSepStyle = 0;
- const FX_WCHAR cSep = iSepStyle < 2 ? L'.' : L',';
+ const wchar_t cSep = iSepStyle < 2 ? L'.' : L',';
bool bHasSep = wstrValue.Find(cSep) != -1;
for (FX_STRSIZE i = 0; i < wstrChange.GetLength(); ++i) {
@@ -1142,7 +1142,7 @@ double CJS_PublicMethods::MakeInterDate(const CFX_WideString& strValue) {
std::vector<CFX_WideString> wsArray;
CFX_WideString sTemp = L"";
for (int i = 0; i < strValue.GetLength(); ++i) {
- FX_WCHAR c = strValue.GetAt(i);
+ wchar_t c = strValue.GetAt(i);
if (c == L' ' || c == L':') {
wsArray.push_back(sTemp);
sTemp = L"";
@@ -1239,20 +1239,20 @@ bool CJS_PublicMethods::AFDate_Format(CJS_Runtime* pRuntime,
}
int iIndex = params[0].ToInt(pRuntime);
- const FX_WCHAR* cFormats[] = {L"m/d",
- L"m/d/yy",
- L"mm/dd/yy",
- L"mm/yy",
- L"d-mmm",
- L"d-mmm-yy",
- L"dd-mmm-yy",
- L"yy-mm-dd",
- L"mmm-yy",
- L"mmmm-yy",
- L"mmm d, yyyy",
- L"mmmm d, yyyy",
- L"m/d/yy h:MM tt",
- L"m/d/yy HH:MM"};
+ const wchar_t* cFormats[] = {L"m/d",
+ L"m/d/yy",
+ L"mm/dd/yy",
+ L"mm/yy",
+ L"d-mmm",
+ L"d-mmm-yy",
+ L"dd-mmm-yy",
+ L"yy-mm-dd",
+ L"mmm-yy",
+ L"mmmm-yy",
+ L"mmm d, yyyy",
+ L"mmmm d, yyyy",
+ L"m/d/yy h:MM tt",
+ L"m/d/yy HH:MM"};
if (iIndex < 0 || (static_cast<size_t>(iIndex) >= FX_ArraySize(cFormats)))
iIndex = 0;
@@ -1273,20 +1273,20 @@ bool CJS_PublicMethods::AFDate_Keystroke(CJS_Runtime* pRuntime,
}
int iIndex = params[0].ToInt(pRuntime);
- const FX_WCHAR* cFormats[] = {L"m/d",
- L"m/d/yy",
- L"mm/dd/yy",
- L"mm/yy",
- L"d-mmm",
- L"d-mmm-yy",
- L"dd-mmm-yy",
- L"yy-mm-dd",
- L"mmm-yy",
- L"mmmm-yy",
- L"mmm d, yyyy",
- L"mmmm d, yyyy",
- L"m/d/yy h:MM tt",
- L"m/d/yy HH:MM"};
+ const wchar_t* cFormats[] = {L"m/d",
+ L"m/d/yy",
+ L"mm/dd/yy",
+ L"mm/yy",
+ L"d-mmm",
+ L"d-mmm-yy",
+ L"dd-mmm-yy",
+ L"yy-mm-dd",
+ L"mmm-yy",
+ L"mmmm-yy",
+ L"mmm d, yyyy",
+ L"mmmm d, yyyy",
+ L"m/d/yy h:MM tt",
+ L"m/d/yy HH:MM"};
if (iIndex < 0 || (static_cast<size_t>(iIndex) >= FX_ArraySize(cFormats)))
iIndex = 0;
@@ -1307,8 +1307,8 @@ bool CJS_PublicMethods::AFTime_Format(CJS_Runtime* pRuntime,
}
int iIndex = params[0].ToInt(pRuntime);
- const FX_WCHAR* cFormats[] = {L"HH:MM", L"h:MM tt", L"HH:MM:ss",
- L"h:MM:ss tt"};
+ const wchar_t* cFormats[] = {L"HH:MM", L"h:MM tt", L"HH:MM:ss",
+ L"h:MM:ss tt"};
if (iIndex < 0 || (static_cast<size_t>(iIndex) >= FX_ArraySize(cFormats)))
iIndex = 0;
@@ -1328,8 +1328,8 @@ bool CJS_PublicMethods::AFTime_Keystroke(CJS_Runtime* pRuntime,
}
int iIndex = params[0].ToInt(pRuntime);
- const FX_WCHAR* cFormats[] = {L"HH:MM", L"h:MM tt", L"HH:MM:ss",
- L"h:MM:ss tt"};
+ const wchar_t* cFormats[] = {L"HH:MM", L"h:MM tt", L"HH:MM:ss",
+ L"h:MM:ss tt"};
if (iIndex < 0 || (static_cast<size_t>(iIndex) >= FX_ArraySize(cFormats)))
iIndex = 0;
@@ -1461,7 +1461,7 @@ bool CJS_PublicMethods::AFSpecial_KeystrokeEx(
pEvent->Rc() = false;
return true;
}
- FX_WCHAR wMask = wstrMask[iIndexMask];
+ wchar_t wMask = wstrMask[iIndexMask];
if (!isReservedMaskChar(wMask))
wChange.SetAt(i, wMask);
@@ -1776,7 +1776,7 @@ bool CJS_PublicMethods::AFExtractNums(CJS_Runtime* pRuntime,
CJS_Array nums;
int nIndex = 0;
for (int i = 0, sz = str.GetLength(); i < sz; i++) {
- FX_WCHAR wc = str.GetAt(i);
+ wchar_t wc = str.GetAt(i);
if (FXSYS_iswdigit(wc)) {
sPart += wc;
} else {