summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-03-25 14:52:27 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-25 14:52:28 -0700
commitc3255f55954b2adc3edbd3269c0a8779f7d4b7ad (patch)
tree802c0e9158e14f1e67ad181089739a176e8fba24 /fpdfsdk/javascript
parentdeee3d2ee201d62e7ef41e7d8378d7f52e057a9c (diff)
downloadpdfium-c3255f55954b2adc3edbd3269c0a8779f7d4b7ad.tar.xz
Remove FX_DWORD from fpdfsdk/ and testing
BUG= Review URL: https://codereview.chromium.org/1835693002
Diffstat (limited to 'fpdfsdk/javascript')
-rw-r--r--fpdfsdk/javascript/Document.cpp4
-rw-r--r--fpdfsdk/javascript/Field.cpp24
-rw-r--r--fpdfsdk/javascript/Field.h6
-rw-r--r--fpdfsdk/javascript/JS_GlobalData.cpp52
-rw-r--r--fpdfsdk/javascript/JS_Object.cpp4
-rw-r--r--fpdfsdk/javascript/JS_Object.h10
-rw-r--r--fpdfsdk/javascript/JS_Value.cpp2
-rw-r--r--fpdfsdk/javascript/app.cpp4
8 files changed, 53 insertions, 53 deletions
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp
index 9b3df6154a..0b793db049 100644
--- a/fpdfsdk/javascript/Document.cpp
+++ b/fpdfsdk/javascript/Document.cpp
@@ -1460,7 +1460,7 @@ int Document::CountWords(CPDF_TextObject* pTextObj) {
FX_BOOL bIsLatin = FALSE;
for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) {
- FX_DWORD charcode = static_cast<FX_DWORD>(-1);
+ uint32_t charcode = static_cast<uint32_t>(-1);
FX_FLOAT kerning;
pTextObj->GetCharInfo(i, charcode, kerning);
@@ -1493,7 +1493,7 @@ CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj,
FX_BOOL bIsLatin = FALSE;
for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) {
- FX_DWORD charcode = static_cast<FX_DWORD>(-1);
+ uint32_t charcode = static_cast<uint32_t>(-1);
FX_FLOAT kerning;
pTextObj->GetCharInfo(i, charcode, kerning);
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp
index 814d2e86fa..4ac7081291 100644
--- a/fpdfsdk/javascript/Field.cpp
+++ b/fpdfsdk/javascript/Field.cpp
@@ -947,7 +947,7 @@ FX_BOOL Field::currentValueIndices(IJS_Context* cc,
if (!m_bCanSet)
return FALSE;
- CFX_ArrayTemplate<FX_DWORD> array;
+ CFX_ArrayTemplate<uint32_t> array;
if (vp.GetType() == CJS_Value::VT_number) {
int iSelecting = 0;
@@ -1002,7 +1002,7 @@ FX_BOOL Field::currentValueIndices(IJS_Context* cc,
void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument,
const CFX_WideString& swFieldName,
int nControlIndex,
- const CFX_ArrayTemplate<FX_DWORD>& array) {
+ const CFX_ArrayTemplate<uint32_t>& array) {
ASSERT(pDocument);
std::vector<CPDF_FormField*> FieldArray =
@@ -1010,7 +1010,7 @@ void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument,
for (CPDF_FormField* pFormField : FieldArray) {
int nFieldType = pFormField->GetFieldType();
if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_LISTBOX) {
- FX_DWORD dwFieldFlags = pFormField->GetFieldFlags();
+ uint32_t dwFieldFlags = pFormField->GetFieldFlags();
pFormField->ClearSelection(TRUE);
for (int i = 0, sz = array.GetSize(); i < sz; i++) {
@@ -1209,7 +1209,7 @@ FX_BOOL Field::display(IJS_Context* cc,
if (!pWidget)
return FALSE;
- FX_DWORD dwFlag = pWidget->GetFlags();
+ uint32_t dwFlag = pWidget->GetFlags();
if (ANNOTFLAG_INVISIBLE & dwFlag || ANNOTFLAG_HIDDEN & dwFlag) {
vp << (int32_t)1;
@@ -1244,7 +1244,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument,
ASSERT(pFormControl);
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) {
- FX_DWORD dwFlag = pWidget->GetFlags();
+ uint32_t dwFlag = pWidget->GetFlags();
switch (number) {
case 0:
dwFlag &= (~ANNOTFLAG_INVISIBLE);
@@ -1285,7 +1285,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument,
if (CPDF_FormControl* pFormControl =
pFormField->GetControl(nControlIndex)) {
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) {
- FX_DWORD dwFlag = pWidget->GetFlags();
+ uint32_t dwFlag = pWidget->GetFlags();
switch (number) {
case 0:
dwFlag &= (~ANNOTFLAG_INVISIBLE);
@@ -1525,7 +1525,7 @@ FX_BOOL Field::hidden(IJS_Context* cc,
if (!pWidget)
return FALSE;
- FX_DWORD dwFlags = pWidget->GetFlags();
+ uint32_t dwFlags = pWidget->GetFlags();
if (ANNOTFLAG_INVISIBLE & dwFlags || ANNOTFLAG_HIDDEN & dwFlags)
vp << true;
@@ -1549,7 +1549,7 @@ void Field::SetHidden(CPDFSDK_Document* pDocument,
for (int i = 0, sz = pFormField->CountControls(); i < sz; ++i) {
if (CPDFSDK_Widget* pWidget =
pInterForm->GetWidget(pFormField->GetControl(i))) {
- FX_DWORD dwFlags = pWidget->GetFlags();
+ uint32_t dwFlags = pWidget->GetFlags();
if (b) {
dwFlags &= (~ANNOTFLAG_INVISIBLE);
@@ -1577,7 +1577,7 @@ void Field::SetHidden(CPDFSDK_Document* pDocument,
if (CPDF_FormControl* pFormControl =
pFormField->GetControl(nControlIndex)) {
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) {
- FX_DWORD dwFlags = pWidget->GetFlags();
+ uint32_t dwFlags = pWidget->GetFlags();
if (b) {
dwFlags &= (~ANNOTFLAG_INVISIBLE);
@@ -1964,7 +1964,7 @@ FX_BOOL Field::print(IJS_Context* cc,
for (int i = 0, sz = pFormField->CountControls(); i < sz; ++i) {
if (CPDFSDK_Widget* pWidget =
pInterForm->GetWidget(pFormField->GetControl(i))) {
- FX_DWORD dwFlags = pWidget->GetFlags();
+ uint32_t dwFlags = pWidget->GetFlags();
if (bVP)
dwFlags |= ANNOTFLAG_PRINT;
else
@@ -1985,7 +1985,7 @@ FX_BOOL Field::print(IJS_Context* cc,
if (CPDF_FormControl* pFormControl =
pFormField->GetControl(m_nFormControlIndex)) {
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) {
- FX_DWORD dwFlags = pWidget->GetFlags();
+ uint32_t dwFlags = pWidget->GetFlags();
if (bVP)
dwFlags |= ANNOTFLAG_PRINT;
else
@@ -3428,7 +3428,7 @@ void Field::AddDelay_Color(enum FIELD_PROP prop, const CPWL_Color& color) {
}
void Field::AddDelay_WordArray(enum FIELD_PROP prop,
- const CFX_ArrayTemplate<FX_DWORD>& array) {
+ const CFX_ArrayTemplate<uint32_t>& array) {
CJS_DelayData* pNewData = new CJS_DelayData;
pNewData->sFieldName = m_FieldName;
pNewData->nControlIndex = m_nFormControlIndex;
diff --git a/fpdfsdk/javascript/Field.h b/fpdfsdk/javascript/Field.h
index c3045632df..5f5be10c26 100644
--- a/fpdfsdk/javascript/Field.h
+++ b/fpdfsdk/javascript/Field.h
@@ -84,7 +84,7 @@ struct CJS_DelayData {
CFX_WideString widestring;
CFX_FloatRect rect;
CPWL_Color color;
- CFX_ArrayTemplate<FX_DWORD> wordarray;
+ CFX_ArrayTemplate<uint32_t> wordarray;
CJS_WideStringArray widestringarray;
};
@@ -344,7 +344,7 @@ class Field : public CJS_EmbedObj {
static void SetCurrentValueIndices(CPDFSDK_Document* pDocument,
const CFX_WideString& swFieldName,
int nControlIndex,
- const CFX_ArrayTemplate<FX_DWORD>& array);
+ const CFX_ArrayTemplate<uint32_t>& array);
static void SetDefaultStyle(CPDFSDK_Document* pDocument,
const CFX_WideString& swFieldName,
int nControlIndex);
@@ -477,7 +477,7 @@ class Field : public CJS_EmbedObj {
void AddDelay_Rect(enum FIELD_PROP prop, const CFX_FloatRect& rect);
void AddDelay_Color(enum FIELD_PROP prop, const CPWL_Color& color);
void AddDelay_WordArray(enum FIELD_PROP prop,
- const CFX_ArrayTemplate<FX_DWORD>& array);
+ const CFX_ArrayTemplate<uint32_t>& array);
void AddDelay_WideStringArray(enum FIELD_PROP prop,
const CJS_WideStringArray& array);
diff --git a/fpdfsdk/javascript/JS_GlobalData.cpp b/fpdfsdk/javascript/JS_GlobalData.cpp
index 3376ccdc61..2c2ec1d5c1 100644
--- a/fpdfsdk/javascript/JS_GlobalData.cpp
+++ b/fpdfsdk/javascript/JS_GlobalData.cpp
@@ -328,19 +328,19 @@ void CJS_GlobalData::LoadGlobalPersistentVariables() {
ASSERT(wVersion <= 2);
- FX_DWORD dwCount = *((FX_DWORD*)p);
- p += sizeof(FX_DWORD);
+ uint32_t dwCount = *((uint32_t*)p);
+ p += sizeof(uint32_t);
- FX_DWORD dwSize = *((FX_DWORD*)p);
- p += sizeof(FX_DWORD);
+ uint32_t dwSize = *((uint32_t*)p);
+ p += sizeof(uint32_t);
- if (dwSize == nLength - sizeof(uint16_t) * 2 - sizeof(FX_DWORD) * 2) {
+ if (dwSize == nLength - sizeof(uint16_t) * 2 - sizeof(uint32_t) * 2) {
for (int32_t i = 0, sz = dwCount; i < sz; i++) {
if (p > pBuffer + nLength)
break;
- FX_DWORD dwNameLen = *((FX_DWORD*)p);
- p += sizeof(FX_DWORD);
+ uint32_t dwNameLen = *((uint32_t*)p);
+ p += sizeof(uint32_t);
if (p + dwNameLen > pBuffer + nLength)
break;
@@ -356,8 +356,8 @@ void CJS_GlobalData::LoadGlobalPersistentVariables() {
double dData = 0;
switch (wVersion) {
case 1: {
- FX_DWORD dwData = *((FX_DWORD*)p);
- p += sizeof(FX_DWORD);
+ uint32_t dwData = *((uint32_t*)p);
+ p += sizeof(uint32_t);
dData = dwData;
} break;
case 2: {
@@ -375,8 +375,8 @@ void CJS_GlobalData::LoadGlobalPersistentVariables() {
SetGlobalVariablePersistent(sEntry, TRUE);
} break;
case JS_GLOBALDATA_TYPE_STRING: {
- FX_DWORD dwLength = *((FX_DWORD*)p);
- p += sizeof(FX_DWORD);
+ uint32_t dwLength = *((uint32_t*)p);
+ p += sizeof(uint32_t);
if (p + dwLength > pBuffer + nLength)
break;
@@ -398,7 +398,7 @@ void CJS_GlobalData::LoadGlobalPersistentVariables() {
}
void CJS_GlobalData::SaveGlobalPersisitentVariables() {
- FX_DWORD nCount = 0;
+ uint32_t nCount = 0;
CFX_BinaryBuf sData;
for (int i = 0, sz = m_arrayGlobalData.GetSize(); i < sz; i++) {
@@ -421,9 +421,9 @@ void CJS_GlobalData::SaveGlobalPersisitentVariables() {
sFile.AppendBlock(&wType, sizeof(uint16_t));
uint16_t wVersion = 2;
sFile.AppendBlock(&wVersion, sizeof(uint16_t));
- sFile.AppendBlock(&nCount, sizeof(FX_DWORD));
- FX_DWORD dwSize = sData.GetSize();
- sFile.AppendBlock(&dwSize, sizeof(FX_DWORD));
+ sFile.AppendBlock(&nCount, sizeof(uint32_t));
+ uint32_t dwSize = sData.GetSize();
+ sFile.AppendBlock(&dwSize, sizeof(uint32_t));
sFile.AppendBlock(sData.GetBuffer(), sData.GetSize());
@@ -451,8 +451,8 @@ void CJS_GlobalData::MakeByteString(const CFX_ByteString& name,
uint16_t wType = (uint16_t)pData->nType;
switch (wType) {
case JS_GLOBALDATA_TYPE_NUMBER: {
- FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
- sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
+ uint32_t dwNameLen = (uint32_t)name.GetLength();
+ sData.AppendBlock(&dwNameLen, sizeof(uint32_t));
sData.AppendString(name);
sData.AppendBlock(&wType, sizeof(uint16_t));
@@ -460,8 +460,8 @@ void CJS_GlobalData::MakeByteString(const CFX_ByteString& name,
sData.AppendBlock(&dData, sizeof(double));
} break;
case JS_GLOBALDATA_TYPE_BOOLEAN: {
- FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
- sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
+ uint32_t dwNameLen = (uint32_t)name.GetLength();
+ sData.AppendBlock(&dwNameLen, sizeof(uint32_t));
sData.AppendString(name);
sData.AppendBlock(&wType, sizeof(uint16_t));
@@ -469,20 +469,20 @@ void CJS_GlobalData::MakeByteString(const CFX_ByteString& name,
sData.AppendBlock(&wData, sizeof(uint16_t));
} break;
case JS_GLOBALDATA_TYPE_STRING: {
- FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
- sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
+ uint32_t dwNameLen = (uint32_t)name.GetLength();
+ sData.AppendBlock(&dwNameLen, sizeof(uint32_t));
sData.AppendString(name);
sData.AppendBlock(&wType, sizeof(uint16_t));
- FX_DWORD dwDataLen = (FX_DWORD)pData->sData.GetLength();
- sData.AppendBlock(&dwDataLen, sizeof(FX_DWORD));
+ uint32_t dwDataLen = (uint32_t)pData->sData.GetLength();
+ sData.AppendBlock(&dwDataLen, sizeof(uint32_t));
sData.AppendString(pData->sData);
} break;
case JS_GLOBALDATA_TYPE_NULL: {
- FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
- sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
+ uint32_t dwNameLen = (uint32_t)name.GetLength();
+ sData.AppendBlock(&dwNameLen, sizeof(uint32_t));
sData.AppendString(name);
- sData.AppendBlock(&wType, sizeof(FX_DWORD));
+ sData.AppendBlock(&wType, sizeof(uint32_t));
} break;
default:
break;
diff --git a/fpdfsdk/javascript/JS_Object.cpp b/fpdfsdk/javascript/JS_Object.cpp
index e6af576339..9bfa857cb9 100644
--- a/fpdfsdk/javascript/JS_Object.cpp
+++ b/fpdfsdk/javascript/JS_Object.cpp
@@ -97,8 +97,8 @@ CJS_Timer::CJS_Timer(CJS_EmbedObj* pObj,
CJS_Runtime* pRuntime,
int nType,
const CFX_WideString& script,
- FX_DWORD dwElapse,
- FX_DWORD dwTimeOut)
+ uint32_t dwElapse,
+ uint32_t dwTimeOut)
: m_nTimerID(0),
m_pEmbedObj(pObj),
m_bProcessing(false),
diff --git a/fpdfsdk/javascript/JS_Object.h b/fpdfsdk/javascript/JS_Object.h
index 983b713744..da15199e34 100644
--- a/fpdfsdk/javascript/JS_Object.h
+++ b/fpdfsdk/javascript/JS_Object.h
@@ -80,14 +80,14 @@ class CJS_Timer : public CJS_Runtime::Observer {
CJS_Runtime* pRuntime,
int nType,
const CFX_WideString& script,
- FX_DWORD dwElapse,
- FX_DWORD dwTimeOut);
+ uint32_t dwElapse,
+ uint32_t dwTimeOut);
~CJS_Timer() override;
void KillJSTimer();
int GetType() const { return m_nType; }
- FX_DWORD GetTimeOut() const { return m_dwTimeOut; }
+ uint32_t GetTimeOut() const { return m_dwTimeOut; }
CJS_Runtime* GetRuntime() const { return m_bValid ? m_pRuntime : nullptr; }
CFX_WideString GetJScript() const { return m_swJScript; }
@@ -100,14 +100,14 @@ class CJS_Timer : public CJS_Runtime::Observer {
// CJS_Runtime::Observer
void OnDestroyed() override;
- FX_DWORD m_nTimerID;
+ uint32_t m_nTimerID;
CJS_EmbedObj* const m_pEmbedObj;
bool m_bProcessing;
bool m_bValid;
// data
const int m_nType; // 0:Interval; 1:TimeOut
- const FX_DWORD m_dwTimeOut;
+ const uint32_t m_dwTimeOut;
const CFX_WideString m_swJScript;
CJS_Runtime* const m_pRuntime;
CPDFDoc_Environment* const m_pApp;
diff --git a/fpdfsdk/javascript/JS_Value.cpp b/fpdfsdk/javascript/JS_Value.cpp
index 5e403a524b..1d57833247 100644
--- a/fpdfsdk/javascript/JS_Value.cpp
+++ b/fpdfsdk/javascript/JS_Value.cpp
@@ -17,7 +17,7 @@
#include "fpdfsdk/javascript/JS_Define.h"
#include "fpdfsdk/javascript/JS_Object.h"
-static const FX_DWORD g_nan[2] = {0, 0x7FF80000};
+static const uint32_t g_nan[2] = {0, 0x7FF80000};
static double GetNan() {
return *(double*)g_nan;
}
diff --git a/fpdfsdk/javascript/app.cpp b/fpdfsdk/javascript/app.cpp
index 2f81791dc7..41fa15259a 100644
--- a/fpdfsdk/javascript/app.cpp
+++ b/fpdfsdk/javascript/app.cpp
@@ -383,7 +383,7 @@ FX_BOOL app::setInterval(IJS_Context* cc,
}
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- FX_DWORD dwInterval = params.size() > 1 ? params[1].ToInt() : 1000;
+ uint32_t dwInterval = params.size() > 1 ? params[1].ToInt() : 1000;
CPDFDoc_Environment* pApp = pRuntime->GetReaderApp();
ASSERT(pApp);
@@ -421,7 +421,7 @@ FX_BOOL app::setTimeOut(IJS_Context* cc,
return TRUE;
}
- FX_DWORD dwTimeOut = params.size() > 1 ? params[1].ToInt() : 1000;
+ uint32_t dwTimeOut = params.size() > 1 ? params[1].ToInt() : 1000;
CPDFDoc_Environment* pApp = pRuntime->GetReaderApp();
ASSERT(pApp);