summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/util.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-23 13:26:26 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-23 13:26:26 -0700
commit320b2313d19869333ed453af546e61a9fc2b81c9 (patch)
tree25f2eb8a0991ac485ca6354f0d3caf7fd775e732 /fpdfsdk/src/javascript/util.cpp
parent065e9321b84fc0490f3da9099e8840c65e06868d (diff)
downloadpdfium-320b2313d19869333ed453af546e61a9fc2b81c9.tar.xz
FX_BOOL considered harmful, part 2.
Fully automatic change, execpt for cleanup in fx_system.h R=thestig@chromium.org Review URL: https://codereview.chromium.org/1254703002 .
Diffstat (limited to 'fpdfsdk/src/javascript/util.cpp')
-rw-r--r--fpdfsdk/src/javascript/util.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp
index 4083ed58da..21a7cb83ff 100644
--- a/fpdfsdk/src/javascript/util.cpp
+++ b/fpdfsdk/src/javascript/util.cpp
@@ -98,7 +98,7 @@ const stru_TbConvert fcTable[] = {
int util::ParstDataType(std::wstring* sFormat)
{
- bool bPercent = FALSE;
+ bool bPercent = false;
for (size_t i = 0; i < sFormat->length(); ++i)
{
wchar_t c = (*sFormat)[i];
@@ -136,11 +136,11 @@ int util::ParstDataType(std::wstring* sFormat)
return -1;
}
-FX_BOOL util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
int iSize = params.size();
if (iSize < 1)
- return FALSE;
+ return false;
std::wstring c_ConvChar(params[0].ToCFXWideString().c_str());
std::vector<std::wstring> c_strConvers;
int iOffset = 0;
@@ -198,16 +198,16 @@ FX_BOOL util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
c_strResult.erase(c_strResult.begin());
vRet = c_strResult.c_str();
- return TRUE;
+ return true;
}
-FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = GetIsolate(cc);
int iSize = params.size();
if (iSize < 2)
- return FALSE;
+ return false;
CJS_Value p1(isolate);
p1 = params[0];
@@ -217,13 +217,13 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
if (!p2.ConvertToDate(jsDate))
{
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPRINT1);
- return FALSE;
+ return false;
}
if (!jsDate.IsValidDate())
{
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPRINT2);
- return FALSE;
+ return false;
}
if (p1.GetType() == VT_number)
@@ -261,11 +261,11 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
jsDate.GetSeconds());
break;
default:
- return FALSE;
+ return false;
}
vRet = swResult.c_str();
- return TRUE;
+ return true;
}
if (p1.GetType() == VT_string)
{
@@ -279,7 +279,7 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
if (bXFAPicture)
{
- return FALSE; //currently, it doesn't support XFAPicture.
+ return false; //currently, it doesn't support XFAPicture.
}
int iIndex;
@@ -355,9 +355,9 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
strFormat = wcsftime(buf, 64, cFormat.c_str(), &time);
cFormat = buf;
vRet = cFormat.c_str();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPicture, std::wstring &cPurpose)
@@ -450,11 +450,11 @@ void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPictur
cPurpose = cFormat;
}
-FX_BOOL util::printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool util::printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
int iSize = params.size();
if (iSize<2)
- return FALSE;
+ return false;
CFX_WideString sFormat = params[0].ToCFXWideString();
CFX_WideString sSource = params[1].ToCFXWideString();
std::string cFormat = CFX_ByteString::FromUnicode(sFormat).c_str();
@@ -462,7 +462,7 @@ FX_BOOL util::printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
std::string cDest;
printx(cFormat,cSource,cDest);
vRet = cDest.c_str();
- return TRUE;
+ return true;
}
void util::printx(const std::string &cFormat,const std::string &cSource2,std::string &cPurpose)
@@ -564,19 +564,19 @@ void util::printx(const std::string &cFormat,const std::string &cSource2,std::st
}
}
-FX_BOOL util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = GetIsolate(cc);
int iSize = params.size();
if (iSize < 2)
- return FALSE;
+ return false;
CFX_WideString sFormat = params[0].ToCFXWideString();
CFX_WideString sDate = params[1].ToCFXWideString();
double dDate = JS_GetDateTime();
if (sDate.GetLength() > 0)
{
- FX_BOOL bWrongFormat = FALSE;
+ bool bWrongFormat = false;
dDate = CJS_PublicMethods::MakeRegularDate(sDate,sFormat,bWrongFormat);
}
@@ -590,7 +590,7 @@ FX_BOOL util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet.SetNull();
}
- return TRUE;
+ return true;
}
int64_t FX_atoi64(const char *nptr)
@@ -618,15 +618,15 @@ int64_t FX_atoi64(const char *nptr)
return sign == '-' ? -total : total;
}
-FX_BOOL util::byteToChar(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool util::byteToChar(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
int iSize = params.size();
if (iSize == 0)
- return FALSE;
+ return false;
int nByte = params[0].ToInt();
unsigned char cByte = (unsigned char)nByte;
CFX_WideString csValue;
csValue.Format(L"%c", cByte);
vRet = csValue.c_str();
- return TRUE;
+ return true;
}