summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r--fpdfsdk/src/javascript/Consts.cpp48
-rw-r--r--fpdfsdk/src/javascript/JS_EventHandler.cpp4
-rw-r--r--fpdfsdk/src/javascript/JS_GlobalData.cpp28
-rw-r--r--fpdfsdk/src/javascript/JS_Object.cpp10
-rw-r--r--fpdfsdk/src/javascript/JS_Value.cpp10
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.cpp52
-rw-r--r--fpdfsdk/src/javascript/global.cpp22
-rw-r--r--fpdfsdk/src/javascript/util.cpp8
8 files changed, 91 insertions, 91 deletions
diff --git a/fpdfsdk/src/javascript/Consts.cpp b/fpdfsdk/src/javascript/Consts.cpp
index 1b1c8babcb..cea9f9a4c9 100644
--- a/fpdfsdk/src/javascript/Consts.cpp
+++ b/fpdfsdk/src/javascript/Consts.cpp
@@ -151,14 +151,14 @@ int CJS_GlobalConsts::Init(IJS_Runtime* pRuntime)
int CJS_GlobalArrays::Init(IJS_Runtime* pRuntime)
{
{
- FX_LPCWSTR ArrayName = L"RE_NUMBER_ENTRY_DOT_SEP";
- FX_LPCWSTR ArrayContent[] = {L"[+-]?\\d*\\.?\\d*"};
+ const FX_WCHAR* ArrayName = L"RE_NUMBER_ENTRY_DOT_SEP";
+ const FX_WCHAR* ArrayContent[] = {L"[+-]?\\d*\\.?\\d*"};
DEFINE_GLOBAL_ARRAY(pRuntime);
}
{
- FX_LPCWSTR ArrayName = L"RE_NUMBER_COMMIT_DOT_SEP";
- FX_LPCWSTR ArrayContent[] = { L"[+-]?\\d+(\\.\\d+)?", /* -1.0 or -1 */
+ const FX_WCHAR* ArrayName = L"RE_NUMBER_COMMIT_DOT_SEP";
+ const FX_WCHAR* ArrayContent[] = { L"[+-]?\\d+(\\.\\d+)?", /* -1.0 or -1 */
L"[+-]?\\.\\d+", /* -.1 */
L"[+-]?\\d+\\." /* -1. */
};
@@ -166,15 +166,15 @@ int CJS_GlobalArrays::Init(IJS_Runtime* pRuntime)
}
{
- FX_LPCWSTR ArrayName = L"RE_NUMBER_ENTRY_COMMA_SEP";
- FX_LPCWSTR ArrayContent[] = {L"[+-]?\\d*,?\\d*"};
+ const FX_WCHAR* ArrayName = L"RE_NUMBER_ENTRY_COMMA_SEP";
+ const FX_WCHAR* ArrayContent[] = {L"[+-]?\\d*,?\\d*"};
DEFINE_GLOBAL_ARRAY(pRuntime);
}
{
- FX_LPCWSTR ArrayName = L"RE_NUMBER_COMMIT_COMMA_SEP";
- FX_LPCWSTR ArrayContent[] = { L"[+-]?\\d+([.,]\\d+)?", /* -1,0 or -1 */
+ const FX_WCHAR* ArrayName = L"RE_NUMBER_COMMIT_COMMA_SEP";
+ const FX_WCHAR* ArrayContent[] = { L"[+-]?\\d+([.,]\\d+)?", /* -1,0 or -1 */
L"[+-]?[.,]\\d+", /* -,1 */
L"[+-]?\\d+[.,]" /* -1, */
};
@@ -182,32 +182,32 @@ int CJS_GlobalArrays::Init(IJS_Runtime* pRuntime)
}
{
- FX_LPCWSTR ArrayName = L"RE_ZIP_ENTRY";
- FX_LPCWSTR ArrayContent[] = {L"\\d{0,5}"};
+ const FX_WCHAR* ArrayName = L"RE_ZIP_ENTRY";
+ const FX_WCHAR* ArrayContent[] = {L"\\d{0,5}"};
DEFINE_GLOBAL_ARRAY(pRuntime);
}
{
- FX_LPCWSTR ArrayName = L"RE_ZIP_COMMIT";
- FX_LPCWSTR ArrayContent[] = {L"\\d{5}"};
+ const FX_WCHAR* ArrayName = L"RE_ZIP_COMMIT";
+ const FX_WCHAR* ArrayContent[] = {L"\\d{5}"};
DEFINE_GLOBAL_ARRAY(pRuntime);
}
{
- FX_LPCWSTR ArrayName = L"RE_ZIP4_ENTRY";
- FX_LPCWSTR ArrayContent[] = {L"\\d{0,5}(\\.|[- ])?\\d{0,4}"};
+ const FX_WCHAR* ArrayName = L"RE_ZIP4_ENTRY";
+ const FX_WCHAR* ArrayContent[] = {L"\\d{0,5}(\\.|[- ])?\\d{0,4}"};
DEFINE_GLOBAL_ARRAY(pRuntime);
}
{
- FX_LPCWSTR ArrayName = L"RE_ZIP4_COMMIT";
- FX_LPCWSTR ArrayContent[] = {L"\\d{5}(\\.|[- ])?\\d{4}"};
+ const FX_WCHAR* ArrayName = L"RE_ZIP4_COMMIT";
+ const FX_WCHAR* ArrayContent[] = {L"\\d{5}(\\.|[- ])?\\d{4}"};
DEFINE_GLOBAL_ARRAY(pRuntime);
}
{
- FX_LPCWSTR ArrayName = L"RE_PHONE_ENTRY";
- FX_LPCWSTR ArrayContent[] = {
+ const FX_WCHAR* ArrayName = L"RE_PHONE_ENTRY";
+ const FX_WCHAR* ArrayContent[] = {
L"\\d{0,3}(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* 555-1234 or 408 555-1234 */
L"\\(\\d{0,3}", /* (408 */
L"\\(\\d{0,3}\\)(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* (408) 555-1234 */
@@ -220,8 +220,8 @@ int CJS_GlobalArrays::Init(IJS_Runtime* pRuntime)
}
{
- FX_LPCWSTR ArrayName = L"RE_PHONE_COMMIT";
- FX_LPCWSTR ArrayContent[] = {
+ const FX_WCHAR* ArrayName = L"RE_PHONE_COMMIT";
+ const FX_WCHAR* ArrayContent[] = {
L"\\d{3}(\\.|[- ])?\\d{4}", /* 555-1234 */
L"\\d{3}(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}", /* 408 555-1234 */
L"\\(\\d{3}\\)(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}", /* (408) 555-1234 */
@@ -231,14 +231,14 @@ int CJS_GlobalArrays::Init(IJS_Runtime* pRuntime)
}
{
- FX_LPCWSTR ArrayName = L"RE_SSN_ENTRY";
- FX_LPCWSTR ArrayContent[] = {L"\\d{0,3}(\\.|[- ])?\\d{0,2}(\\.|[- ])?\\d{0,4}"};
+ const FX_WCHAR* ArrayName = L"RE_SSN_ENTRY";
+ const FX_WCHAR* ArrayContent[] = {L"\\d{0,3}(\\.|[- ])?\\d{0,2}(\\.|[- ])?\\d{0,4}"};
DEFINE_GLOBAL_ARRAY(pRuntime);
}
{
- FX_LPCWSTR ArrayName = L"RE_SSN_COMMIT";
- FX_LPCWSTR ArrayContent[] = {L"\\d{3}(\\.|[- ])?\\d{2}(\\.|[- ])?\\d{4}"};
+ const FX_WCHAR* ArrayName = L"RE_SSN_COMMIT";
+ const FX_WCHAR* ArrayContent[] = {L"\\d{3}(\\.|[- ])?\\d{2}(\\.|[- ])?\\d{4}"};
DEFINE_GLOBAL_ARRAY(pRuntime);
}
diff --git a/fpdfsdk/src/javascript/JS_EventHandler.cpp b/fpdfsdk/src/javascript/JS_EventHandler.cpp
index cf59ed9c86..fe4f6b2d4c 100644
--- a/fpdfsdk/src/javascript/JS_EventHandler.cpp
+++ b/fpdfsdk/src/javascript/JS_EventHandler.cpp
@@ -461,7 +461,7 @@ FX_BOOL CJS_EventHandler::Modifier()
return m_bModifier;
}
-FX_LPCWSTR CJS_EventHandler::Name()
+const FX_WCHAR* CJS_EventHandler::Name()
{
switch (m_eEventType)
{
@@ -509,7 +509,7 @@ FX_LPCWSTR CJS_EventHandler::Name()
return L"";
}
-FX_LPCWSTR CJS_EventHandler::Type()
+const FX_WCHAR* CJS_EventHandler::Type()
{
switch (m_eEventType)
{
diff --git a/fpdfsdk/src/javascript/JS_GlobalData.cpp b/fpdfsdk/src/javascript/JS_GlobalData.cpp
index 450c7a1338..74707fab10 100644
--- a/fpdfsdk/src/javascript/JS_GlobalData.cpp
+++ b/fpdfsdk/src/javascript/JS_GlobalData.cpp
@@ -138,7 +138,7 @@ CJS_GlobalData::~CJS_GlobalData()
m_arrayGlobalData.RemoveAll();
}
-int CJS_GlobalData::FindGlobalVariable(FX_LPCSTR propname)
+int CJS_GlobalData::FindGlobalVariable(const FX_CHAR* propname)
{
ASSERT(propname != NULL);
@@ -157,7 +157,7 @@ int CJS_GlobalData::FindGlobalVariable(FX_LPCSTR propname)
return nRet;
}
-CJS_GlobalData_Element* CJS_GlobalData::GetGlobalVariable(FX_LPCSTR propname)
+CJS_GlobalData_Element* CJS_GlobalData::GetGlobalVariable(const FX_CHAR* propname)
{
ASSERT(propname != NULL);
@@ -169,7 +169,7 @@ CJS_GlobalData_Element* CJS_GlobalData::GetGlobalVariable(FX_LPCSTR propname)
return NULL;
}
-void CJS_GlobalData::SetGlobalVariableNumber(FX_LPCSTR propname, double dData)
+void CJS_GlobalData::SetGlobalVariableNumber(const FX_CHAR* propname, double dData)
{
ASSERT(propname != NULL);
CFX_ByteString sPropName = propname;
@@ -195,7 +195,7 @@ void CJS_GlobalData::SetGlobalVariableNumber(FX_LPCSTR propname, double dData)
}
}
-void CJS_GlobalData::SetGlobalVariableBoolean(FX_LPCSTR propname, bool bData)
+void CJS_GlobalData::SetGlobalVariableBoolean(const FX_CHAR* propname, bool bData)
{
ASSERT(propname != NULL);
CFX_ByteString sPropName = propname;
@@ -221,7 +221,7 @@ void CJS_GlobalData::SetGlobalVariableBoolean(FX_LPCSTR propname, bool bData)
}
}
-void CJS_GlobalData::SetGlobalVariableString(FX_LPCSTR propname, const CFX_ByteString& sData)
+void CJS_GlobalData::SetGlobalVariableString(const FX_CHAR* propname, const CFX_ByteString& sData)
{
ASSERT(propname != NULL);
CFX_ByteString sPropName = propname;
@@ -247,7 +247,7 @@ void CJS_GlobalData::SetGlobalVariableString(FX_LPCSTR propname, const CFX_ByteS
}
}
-void CJS_GlobalData::SetGlobalVariableObject(FX_LPCSTR propname, const CJS_GlobalVariableArray& array)
+void CJS_GlobalData::SetGlobalVariableObject(const FX_CHAR* propname, const CJS_GlobalVariableArray& array)
{
ASSERT(propname != NULL);
CFX_ByteString sPropName = propname;
@@ -273,7 +273,7 @@ void CJS_GlobalData::SetGlobalVariableObject(FX_LPCSTR propname, const CJS_Globa
}
}
-void CJS_GlobalData::SetGlobalVariableNull(FX_LPCSTR propname)
+void CJS_GlobalData::SetGlobalVariableNull(const FX_CHAR* propname)
{
ASSERT(propname != NULL);
CFX_ByteString sPropName = propname;
@@ -297,7 +297,7 @@ void CJS_GlobalData::SetGlobalVariableNull(FX_LPCSTR propname)
}
}
-FX_BOOL CJS_GlobalData::SetGlobalVariablePersistent(FX_LPCSTR propname, FX_BOOL bPersistent)
+FX_BOOL CJS_GlobalData::SetGlobalVariablePersistent(const FX_CHAR* propname, FX_BOOL bPersistent)
{
ASSERT(propname != NULL);
CFX_ByteString sPropName = propname;
@@ -316,7 +316,7 @@ FX_BOOL CJS_GlobalData::SetGlobalVariablePersistent(FX_LPCSTR propname, FX_BOOL
return FALSE;
}
-FX_BOOL CJS_GlobalData::DeleteGlobalVariable(FX_LPCSTR propname)
+FX_BOOL CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname)
{
ASSERT(propname != NULL);
CFX_ByteString sPropName = propname;
@@ -350,7 +350,7 @@ CJS_GlobalData_Element* CJS_GlobalData::GetAt(int index) const
void CJS_GlobalData::LoadGlobalPersistentVariables()
{
- FX_LPBYTE pBuffer = NULL;
+ uint8_t* pBuffer = NULL;
int32_t nLength = 0;
LoadFileBuffer(m_sFilePath.c_str(), pBuffer, nLength);
@@ -358,7 +358,7 @@ void CJS_GlobalData::LoadGlobalPersistentVariables()
if (pBuffer)
{
- FX_LPBYTE p = pBuffer;
+ uint8_t* p = pBuffer;
FX_WORD wType = *((FX_WORD*)p);
p += sizeof(FX_WORD);
@@ -508,15 +508,15 @@ void CJS_GlobalData::SaveGlobalPersisitentVariables()
sFile.AppendBlock(sData.GetBuffer(), sData.GetSize());
CRYPT_ArcFourCryptBlock(sFile.GetBuffer(), sFile.GetSize(), JS_RC4KEY, sizeof(JS_RC4KEY));
- WriteFileBuffer(m_sFilePath.c_str(), (FX_LPCSTR)sFile.GetBuffer(), sFile.GetSize());
+ WriteFileBuffer(m_sFilePath.c_str(), (const FX_CHAR*)sFile.GetBuffer(), sFile.GetSize());
}
-void CJS_GlobalData::LoadFileBuffer(FX_LPCWSTR sFilePath, FX_LPBYTE& pBuffer, int32_t& nLength)
+void CJS_GlobalData::LoadFileBuffer(const FX_WCHAR* sFilePath, uint8_t*& pBuffer, int32_t& nLength)
{
//UnSupport.
}
-void CJS_GlobalData::WriteFileBuffer(FX_LPCWSTR sFilePath, FX_LPCSTR pBuffer, int32_t nLength)
+void CJS_GlobalData::WriteFileBuffer(const FX_WCHAR* sFilePath, const FX_CHAR* pBuffer, int32_t nLength)
{
//UnSupport.
}
diff --git a/fpdfsdk/src/javascript/JS_Object.cpp b/fpdfsdk/src/javascript/JS_Object.cpp
index 66fd2b682f..f40f142fba 100644
--- a/fpdfsdk/src/javascript/JS_Object.cpp
+++ b/fpdfsdk/src/javascript/JS_Object.cpp
@@ -19,7 +19,7 @@ JS_TIMER_MAPARRAY& GetTimeMap()
return *timeMap;
}
-int FXJS_MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, FX_LPCWSTR swMsg, FX_LPCWSTR swTitle, FX_UINT nType, FX_UINT nIcon)
+int FXJS_MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, const FX_WCHAR* swMsg, const FX_WCHAR* swTitle, FX_UINT nType, FX_UINT nIcon)
{
int nRet = 0;
@@ -62,12 +62,12 @@ CPDFSDK_PageView* CJS_EmbedObj::JSGetPageView(IFXJS_Context* cc)
return FXJS_GetPageView(cc);
}
-int CJS_EmbedObj::MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView,FX_LPCWSTR swMsg,FX_LPCWSTR swTitle,FX_UINT nType,FX_UINT nIcon)
+int CJS_EmbedObj::MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView,const FX_WCHAR* swMsg,const FX_WCHAR* swTitle,FX_UINT nType,FX_UINT nIcon)
{
return FXJS_MsgBox(pApp, pPageView, swMsg, swTitle, nType, nIcon);
}
-void CJS_EmbedObj::Alert(CJS_Context* pContext, FX_LPCWSTR swMsg)
+void CJS_EmbedObj::Alert(CJS_Context* pContext, const FX_WCHAR* swMsg)
{
CJS_Object::Alert(pContext, swMsg);
}
@@ -134,12 +134,12 @@ CPDFSDK_PageView* CJS_Object::JSGetPageView(IFXJS_Context* cc)
return FXJS_GetPageView(cc);
}
-int CJS_Object::MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, FX_LPCWSTR swMsg, FX_LPCWSTR swTitle, FX_UINT nType, FX_UINT nIcon)
+int CJS_Object::MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, const FX_WCHAR* swMsg, const FX_WCHAR* swTitle, FX_UINT nType, FX_UINT nIcon)
{
return FXJS_MsgBox(pApp, pPageView, swMsg, swTitle, nType, nIcon);
}
-void CJS_Object::Alert(CJS_Context* pContext, FX_LPCWSTR swMsg)
+void CJS_Object::Alert(CJS_Context* pContext, const FX_WCHAR* swMsg)
{
ASSERT(pContext != NULL);
diff --git a/fpdfsdk/src/javascript/JS_Value.cpp b/fpdfsdk/src/javascript/JS_Value.cpp
index 0943802508..5bca831710 100644
--- a/fpdfsdk/src/javascript/JS_Value.cpp
+++ b/fpdfsdk/src/javascript/JS_Value.cpp
@@ -57,12 +57,12 @@ CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Document* pJsDoc):m_isolate(isola
m_pValue = (JSFXObject)*pJsDoc;
}
-CJS_Value::CJS_Value(v8::Isolate* isolate, FX_LPCWSTR pWstr):m_isolate(isolate)
+CJS_Value::CJS_Value(v8::Isolate* isolate, const FX_WCHAR* pWstr):m_isolate(isolate)
{
operator =(pWstr);
}
-CJS_Value::CJS_Value(v8::Isolate* isolate, FX_LPCSTR pStr):m_isolate(isolate)
+CJS_Value::CJS_Value(v8::Isolate* isolate, const FX_CHAR* pStr):m_isolate(isolate)
{
operator = (pStr);
}
@@ -200,7 +200,7 @@ void CJS_Value::operator = (CJS_Document* pJsDoc)
}
}
-void CJS_Value::operator =(FX_LPCWSTR pWstr)
+void CJS_Value::operator =(const FX_WCHAR* pWstr)
{
m_pValue = JS_NewString(m_isolate,(wchar_t *)pWstr);
@@ -214,7 +214,7 @@ void CJS_Value::SetNull()
m_eType = VT_null;
}
-void CJS_Value::operator = (FX_LPCSTR pStr)
+void CJS_Value::operator = (const FX_CHAR* pStr)
{
operator = (CFX_WideString::FromLocal(pStr).c_str());
}
@@ -419,7 +419,7 @@ void CJS_PropValue::operator >>(CFX_ByteString &string) const
string = CJS_Value::ToCFXByteString();
}
-void CJS_PropValue::operator <<(FX_LPCWSTR c_string)
+void CJS_PropValue::operator <<(const FX_WCHAR* c_string)
{
ASSERT(!m_bIsSetting);
CJS_Value::operator =(c_string);
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp
index 4607fc69cc..bfd6935ce2 100644
--- a/fpdfsdk/src/javascript/PublicMethods.cpp
+++ b/fpdfsdk/src/javascript/PublicMethods.cpp
@@ -64,8 +64,8 @@ IMPLEMENT_JS_STATIC_GLOBAL_FUN(CJS_PublicMethods)
struct stru_TbConvert
{
- FX_LPCSTR lpszJSMark;
- FX_LPCSTR lpszCppMark;
+ const FX_CHAR* lpszJSMark;
+ const FX_CHAR* lpszCppMark;
};
static const stru_TbConvert fcTable[] = {
@@ -91,21 +91,21 @@ static const stru_TbConvert fcTable[] = {
//"t"
};
-static FX_LPCWSTR months[] =
+static const FX_WCHAR* 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"
};
-static FX_LPCWSTR fullmonths[] =
+static const FX_WCHAR* 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"
};
-FX_BOOL CJS_PublicMethods::IsNumber(FX_LPCWSTR string)
+FX_BOOL CJS_PublicMethods::IsNumber(const FX_WCHAR* string)
{
CFX_WideString sTrim = StrTrim(string);
- FX_LPCWSTR pTrim = sTrim.c_str();
- FX_LPCWSTR p = pTrim;
+ const FX_WCHAR* pTrim = sTrim.c_str();
+ const FX_WCHAR* p = pTrim;
FX_BOOL bDot = FALSE;
@@ -191,7 +191,7 @@ FX_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(FX_LPCWSTR sFuction, double dValue1, double dValue2)
+double CJS_PublicMethods::AF_Simple(const FX_WCHAR* sFuction, double dValue1, double dValue2)
{
if (FXSYS_wcsicmp(sFuction,L"AVG") == 0 || FXSYS_wcsicmp(sFuction,L"SUM") == 0)
{
@@ -213,49 +213,49 @@ double CJS_PublicMethods::AF_Simple(FX_LPCWSTR sFuction, double dValue1, double
return dValue1;
}
-CFX_WideString CJS_PublicMethods::StrLTrim(FX_LPCWSTR pStr)
+CFX_WideString CJS_PublicMethods::StrLTrim(const FX_WCHAR* pStr)
{
while (*pStr && *pStr == L' ') pStr++;
return pStr;
}
-CFX_WideString CJS_PublicMethods::StrRTrim(FX_LPCWSTR pStr)
+CFX_WideString CJS_PublicMethods::StrRTrim(const FX_WCHAR* pStr)
{
- FX_LPCWSTR p = pStr;
+ const FX_WCHAR* p = pStr;
while (*p) p++;
while (p > pStr && *(p - 1) == L' ') p--;
return CFX_WideString(pStr, p - pStr);
}
-CFX_WideString CJS_PublicMethods::StrTrim(FX_LPCWSTR pStr)
+CFX_WideString CJS_PublicMethods::StrTrim(const FX_WCHAR* pStr)
{
return StrRTrim(StrLTrim(pStr).c_str());
}
-CFX_ByteString CJS_PublicMethods::StrLTrim(FX_LPCSTR pStr)
+CFX_ByteString CJS_PublicMethods::StrLTrim(const FX_CHAR* pStr)
{
while (*pStr && *pStr == ' ') pStr++;
return pStr;
}
-CFX_ByteString CJS_PublicMethods::StrRTrim(FX_LPCSTR pStr)
+CFX_ByteString CJS_PublicMethods::StrRTrim(const FX_CHAR* pStr)
{
- FX_LPCSTR p = pStr;
+ const FX_CHAR* p = pStr;
while (*p) p++;
while (p > pStr && *(p - 1) == L' ') p--;
return CFX_ByteString(pStr,p-pStr);
}
-CFX_ByteString CJS_PublicMethods::StrTrim(FX_LPCSTR pStr)
+CFX_ByteString CJS_PublicMethods::StrTrim(const FX_CHAR* pStr)
{
return StrRTrim(StrLTrim(pStr));
}
-double CJS_PublicMethods::ParseNumber(FX_LPCWSTR swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS)
+double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS)
{
bDot = FALSE;
bSign = FALSE;
@@ -263,11 +263,11 @@ double CJS_PublicMethods::ParseNumber(FX_LPCWSTR swSource, FX_BOOL& bAllDigits,
FX_BOOL bDigitExist = FALSE;
- FX_LPCWSTR p = swSource;
+ const FX_WCHAR* p = swSource;
wchar_t c;
- FX_LPCWSTR pStart = NULL;
- FX_LPCWSTR pEnd = NULL;
+ const FX_WCHAR* pStart = NULL;
+ const FX_WCHAR* pEnd = NULL;
while ((c = *p))
{
@@ -401,7 +401,7 @@ double CJS_PublicMethods::ParseNumber(FX_LPCWSTR swSource, FX_BOOL& bAllDigits,
return dRet;
}
-double CJS_PublicMethods::ParseStringToNumber(FX_LPCWSTR swSource)
+double CJS_PublicMethods::ParseStringToNumber(const FX_WCHAR* swSource)
{
FX_BOOL bAllDigits = FALSE;
FX_BOOL bDot = FALSE;
@@ -411,7 +411,7 @@ double CJS_PublicMethods::ParseStringToNumber(FX_LPCWSTR swSource)
return ParseNumber(swSource, bAllDigits, bDot, bSign, bKXJS);
}
-FX_BOOL CJS_PublicMethods::ConvertStringToNumber(FX_LPCWSTR swSource, double & dRet, FX_BOOL & bDot)
+FX_BOOL CJS_PublicMethods::ConvertStringToNumber(const FX_WCHAR* swSource, double & dRet, FX_BOOL & bDot)
{
FX_BOOL bAllDigits = FALSE;
FX_BOOL bSign = FALSE;
@@ -1660,7 +1660,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters
}
int iIndex = params[0].ToInt();
- FX_LPCWSTR 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",
+ 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" };
@@ -1691,7 +1691,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Paramet
}
int iIndex = params[0].ToInt();
- FX_LPCWSTR 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",
+ 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" };
@@ -1721,7 +1721,7 @@ FX_BOOL CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters
}
int iIndex = params[0].ToInt();
- FX_LPCWSTR cFormats[] = {L"HH:MM", L"h:MM tt", L"HH:MM:ss", L"h:MM:ss tt"};
+ const FX_WCHAR* cFormats[] = {L"HH:MM", L"h:MM tt", L"HH:MM:ss", L"h:MM:ss tt"};
ASSERT(iIndex<FX_ArraySize(cFormats));
@@ -1747,7 +1747,7 @@ FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Paramet
}
int iIndex = params[0].ToInt();
- FX_LPCWSTR cFormats[] = {L"HH:MM", L"h:MM tt", L"HH:MM:ss", L"h:MM:ss tt"};
+ const FX_WCHAR* cFormats[] = {L"HH:MM", L"h:MM tt", L"HH:MM:ss", L"h:MM:ss tt"};
ASSERT(iIndex<FX_ArraySize(cFormats));
diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp
index 7065933143..bbe5c02257 100644
--- a/fpdfsdk/src/javascript/global.cpp
+++ b/fpdfsdk/src/javascript/global.cpp
@@ -138,17 +138,17 @@ void global_alternate::Initial(CPDFDoc_Environment* pApp)
UpdateGlobalPersistentVariables();
}
-FX_BOOL global_alternate::QueryProperty(FX_LPCWSTR propname)
+FX_BOOL global_alternate::QueryProperty(const FX_WCHAR* propname)
{
return CFX_WideString(propname) != L"setPersistent";
}
-FX_BOOL global_alternate::DelProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CFX_WideString& sError)
+FX_BOOL global_alternate::DelProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CFX_WideString& sError)
{
js_global_data* pData = NULL;
CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
- if (m_mapGlobal.Lookup(sPropName, (FX_LPVOID&)pData))
+ if (m_mapGlobal.Lookup(sPropName, (void*&)pData))
{
pData->bDeleted = TRUE;
return TRUE;
@@ -157,7 +157,7 @@ FX_BOOL global_alternate::DelProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CF
return FALSE;
}
-FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
@@ -206,7 +206,7 @@ FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS
js_global_data* pData = NULL;
CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
- if (m_mapGlobal.Lookup(sPropName, (FX_LPVOID&)pData))
+ if (m_mapGlobal.Lookup(sPropName, (void*&)pData))
{
if (pData)
{
@@ -270,7 +270,7 @@ FX_BOOL global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters&
CFX_ByteString sName = params[0].ToCFXByteString();
js_global_data* pData = NULL;
- if (m_mapGlobal.Lookup(sName, (FX_LPVOID&)pData))
+ if (m_mapGlobal.Lookup(sName, (void*&)pData))
{
if (pData && !pData->bDeleted)
{
@@ -341,7 +341,7 @@ void global_alternate::CommitGlobalPersisitentVariables()
{
CFX_ByteString name;
js_global_data* pData = NULL;
- m_mapGlobal.GetNextAssoc(pos, name, (FX_LPVOID&)pData);
+ m_mapGlobal.GetNextAssoc(pos, name, (void*&)pData);
if (pData)
{
@@ -495,7 +495,7 @@ void global_alternate::DestroyGlobalPersisitentVariables()
{
CFX_ByteString name;
js_global_data* pData = NULL;
- m_mapGlobal.GetNextAssoc(pos, name, (FX_LPVOID&)pData);
+ m_mapGlobal.GetNextAssoc(pos, name, (void*&)pData);
delete pData;
}
@@ -503,13 +503,13 @@ void global_alternate::DestroyGlobalPersisitentVariables()
}
-FX_BOOL global_alternate::SetGlobalVariables(FX_LPCSTR propname, int nType,
+FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
double dData, bool bData, const CFX_ByteString& sData, JSObject pData, bool bDefaultPersistent)
{
if (propname == NULL) return FALSE;
js_global_data* pTemp = NULL;
- m_mapGlobal.Lookup(propname, (FX_LPVOID&)pTemp);
+ m_mapGlobal.Lookup(propname, (void*&)pTemp);
if (pTemp)
{
@@ -601,7 +601,7 @@ FX_BOOL global_alternate::SetGlobalVariables(FX_LPCSTR propname, int nType,
return FALSE;
}
- m_mapGlobal.SetAt(propname, (FX_LPVOID)pNewData);
+ m_mapGlobal.SetAt(propname, (void*)pNewData);
return TRUE;
}
diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp
index e051cda66e..97bddec5c1 100644
--- a/fpdfsdk/src/javascript/util.cpp
+++ b/fpdfsdk/src/javascript/util.cpp
@@ -58,8 +58,8 @@ util::~util(void)
struct stru_TbConvert
{
- FX_LPCWSTR lpszJSMark;
- FX_LPCWSTR lpszCppMark;
+ const FX_WCHAR* lpszJSMark;
+ const FX_WCHAR* lpszCppMark;
};
const stru_TbConvert fcTable[] = {
@@ -315,7 +315,7 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
struct stru_TbConvertAd
{
- FX_LPCWSTR lpszJSMark;
+ const FX_WCHAR* lpszJSMark;
int iValue;
};
@@ -411,7 +411,7 @@ void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPictur
struct stru_TbConvertAd
{
- FX_LPCWSTR lpszJSMark;
+ const FX_WCHAR* lpszJSMark;
int iValue;
};