summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-03-21 15:00:20 -0700
committerTom Sepez <tsepez@chromium.org>2016-03-21 15:00:20 -0700
commit62a70f90c49cf7714c960186eb063ad55333e6f3 (patch)
tree84b5d0f70b770e6a9ec261342d46638f4d5102bd /fpdfsdk
parent4161c5ca6c5438476bf07b6dacfafb61ea611cc5 (diff)
downloadpdfium-62a70f90c49cf7714c960186eb063ad55333e6f3.tar.xz
Remove FX_WORD in favor of uint16_t.
It isn't buying us anthing, and it looks strange in a struct when other uint types are already present. R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1821043003 .
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.cpp2
-rw-r--r--fpdfsdk/fpdfppo.cpp10
-rw-r--r--fpdfsdk/fsdk_baseannot.cpp20
-rw-r--r--fpdfsdk/fsdk_baseform.cpp2
-rw-r--r--fpdfsdk/fxedit/fxet_ap.cpp6
-rw-r--r--fpdfsdk/fxedit/fxet_edit.cpp26
-rw-r--r--fpdfsdk/fxedit/fxet_list.cpp4
-rw-r--r--fpdfsdk/fxedit/fxet_pageobjs.cpp2
-rw-r--r--fpdfsdk/include/fsdk_mgr.h6
-rw-r--r--fpdfsdk/include/fx_systemhandler.h16
-rw-r--r--fpdfsdk/include/fxedit/fx_edit.h20
-rw-r--r--fpdfsdk/include/fxedit/fxet_edit.h32
-rw-r--r--fpdfsdk/include/fxedit/fxet_list.h4
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_ComboBox.h8
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Edit.h6
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_EditCtrl.h6
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_FontMap.h10
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_IconList.h2
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_ListBox.h4
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_SpecialButton.h4
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Utils.h8
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Wnd.h6
-rw-r--r--fpdfsdk/javascript/Document.cpp4
-rw-r--r--fpdfsdk/javascript/JS_GlobalData.cpp42
-rw-r--r--fpdfsdk/pdfwindow/PWL_ComboBox.cpp8
-rw-r--r--fpdfsdk/pdfwindow/PWL_Edit.cpp6
-rw-r--r--fpdfsdk/pdfwindow/PWL_EditCtrl.cpp8
-rw-r--r--fpdfsdk/pdfwindow/PWL_FontMap.cpp10
-rw-r--r--fpdfsdk/pdfwindow/PWL_IconList.cpp2
-rw-r--r--fpdfsdk/pdfwindow/PWL_ListBox.cpp4
-rw-r--r--fpdfsdk/pdfwindow/PWL_SpecialButton.cpp4
-rw-r--r--fpdfsdk/pdfwindow/PWL_Utils.cpp2
-rw-r--r--fpdfsdk/pdfwindow/PWL_Wnd.cpp2
33 files changed, 148 insertions, 148 deletions
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index 732ea86c4e..ff7bf86449 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -13,7 +13,7 @@
#include "fpdfsdk/include/pdfwindow/PWL_Utils.h"
#define GetRed(rgb) ((uint8_t)(rgb))
-#define GetGreen(rgb) ((uint8_t)(((FX_WORD)(rgb)) >> 8))
+#define GetGreen(rgb) ((uint8_t)(((uint16_t)(rgb)) >> 8))
#define GetBlue(rgb) ((uint8_t)((rgb) >> 16))
#define FFL_HINT_ELAPSE 800
diff --git a/fpdfsdk/fpdfppo.cpp b/fpdfsdk/fpdfppo.cpp
index 6a72141e7d..efbe8f304a 100644
--- a/fpdfsdk/fpdfppo.cpp
+++ b/fpdfsdk/fpdfppo.cpp
@@ -28,7 +28,7 @@ class CPDF_PageOrganizer {
FX_BOOL PDFDocInit(CPDF_Document* pDestPDFDoc, CPDF_Document* pSrcPDFDoc);
FX_BOOL ExportPage(CPDF_Document* pSrcPDFDoc,
- std::vector<FX_WORD>* pPageNums,
+ std::vector<uint16_t>* pPageNums,
CPDF_Document* pDestPDFDoc,
int nIndex);
CPDF_Object* PageDictGetInheritableTag(CPDF_Dictionary* pDict,
@@ -96,7 +96,7 @@ FX_BOOL CPDF_PageOrganizer::PDFDocInit(CPDF_Document* pDestPDFDoc,
}
FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document* pSrcPDFDoc,
- std::vector<FX_WORD>* pPageNums,
+ std::vector<uint16_t>* pPageNums,
CPDF_Document* pDestPDFDoc,
int nIndex) {
int curpage = nIndex;
@@ -314,7 +314,7 @@ FX_DWORD CPDF_PageOrganizer::GetNewObjId(CPDF_Document* pDoc,
}
FPDF_BOOL ParserPageRangeString(CFX_ByteString rangstring,
- std::vector<FX_WORD>* pageArray,
+ std::vector<uint16_t>* pageArray,
int nCount) {
if (rangstring.GetLength() != 0) {
rangstring.Remove(' ');
@@ -337,7 +337,7 @@ FPDF_BOOL ParserPageRangeString(CFX_ByteString rangstring,
long lPageNum = atol(cbMidRange);
if (lPageNum <= 0 || lPageNum > nCount)
return FALSE;
- pageArray->push_back((FX_WORD)lPageNum);
+ pageArray->push_back((uint16_t)lPageNum);
} else {
int nStartPageNum = atol(cbMidRange.Mid(0, nMid));
if (nStartPageNum == 0)
@@ -375,7 +375,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,
if (!pSrcDoc)
return FALSE;
- std::vector<FX_WORD> pageArray;
+ std::vector<uint16_t> pageArray;
int nCount = pSrcDoc->GetPageCount();
if (pagerange) {
if (!ParserPageRangeString(pagerange, &pageArray, nCount))
diff --git a/fpdfsdk/fsdk_baseannot.cpp b/fpdfsdk/fsdk_baseannot.cpp
index 942751d7df..1494c3908c 100644
--- a/fpdfsdk/fsdk_baseannot.cpp
+++ b/fpdfsdk/fsdk_baseannot.cpp
@@ -27,7 +27,7 @@ FX_BOOL _gAfxIsLeapYear(int16_t year) {
return ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0)));
}
-FX_WORD _gAfxGetYearDays(int16_t year) {
+uint16_t _gAfxGetYearDays(int16_t year) {
return (_gAfxIsLeapYear(year) == TRUE ? 366 : 365);
}
@@ -373,13 +373,13 @@ void CPDFSDK_DateTime::ToSystemTime(FX_SYSTEMTIME& st) {
time_t t = (time_t)dt;
struct tm* pTime = localtime(&t);
if (pTime) {
- st.wYear = (FX_WORD)pTime->tm_year + 1900;
- st.wMonth = (FX_WORD)pTime->tm_mon + 1;
- st.wDay = (FX_WORD)pTime->tm_mday;
- st.wDayOfWeek = (FX_WORD)pTime->tm_wday;
- st.wHour = (FX_WORD)pTime->tm_hour;
- st.wMinute = (FX_WORD)pTime->tm_min;
- st.wSecond = (FX_WORD)pTime->tm_sec;
+ st.wYear = (uint16_t)pTime->tm_year + 1900;
+ st.wMonth = (uint16_t)pTime->tm_mon + 1;
+ st.wDay = (uint16_t)pTime->tm_mday;
+ st.wDayOfWeek = (uint16_t)pTime->tm_wday;
+ st.wHour = (uint16_t)pTime->tm_hour;
+ st.wMinute = (uint16_t)pTime->tm_min;
+ st.wSecond = (uint16_t)pTime->tm_sec;
st.wMilliseconds = 0;
}
}
@@ -404,7 +404,7 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::AddDays(short days) {
ldays = days;
if (ldays > 0) {
yy = y;
- if (((FX_WORD)m * 100 + d) > 300)
+ if (((uint16_t)m * 100 + d) > 300)
yy++;
ydays = _gAfxGetYearDays(yy);
while (ldays >= ydays) {
@@ -429,7 +429,7 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::AddDays(short days) {
} else {
ldays *= -1;
yy = y;
- if (((FX_WORD)m * 100 + d) < 300)
+ if (((uint16_t)m * 100 + d) < 300)
yy--;
ydays = _gAfxGetYearDays(yy);
while (ldays >= ydays) {
diff --git a/fpdfsdk/fsdk_baseform.cpp b/fpdfsdk/fsdk_baseform.cpp
index c44f346150..bfdcb2dbca 100644
--- a/fpdfsdk/fsdk_baseform.cpp
+++ b/fpdfsdk/fsdk_baseform.cpp
@@ -1566,7 +1566,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue) {
pEdit->SetAlignmentV(1);
}
- FX_WORD subWord = 0;
+ uint16_t subWord = 0;
if ((dwFieldFlags >> 13) & 1) {
subWord = '*';
pEdit->SetPasswordChar(subWord);
diff --git a/fpdfsdk/fxedit/fxet_ap.cpp b/fpdfsdk/fxedit/fxet_ap.cpp
index 5bf61365c5..a32340302e 100644
--- a/fpdfsdk/fxedit/fxet_ap.cpp
+++ b/fpdfsdk/fxedit/fxet_ap.cpp
@@ -11,8 +11,8 @@
CFX_ByteString GetPDFWordString(IFX_Edit_FontMap* pFontMap,
int32_t nFontIndex,
- FX_WORD Word,
- FX_WORD SubWord) {
+ uint16_t Word,
+ uint16_t SubWord) {
CFX_ByteString sWord;
if (CPDF_Font* pPDFFont = pFontMap->GetPDFFont(nFontIndex)) {
if (SubWord > 0) {
@@ -62,7 +62,7 @@ CFX_ByteString IFX_Edit::GetEditAppearanceStream(
const CFX_FloatPoint& ptOffset,
const CPVT_WordRange* pRange /* = NULL*/,
FX_BOOL bContinuous /* = TRUE*/,
- FX_WORD SubWord /* = 0*/) {
+ uint16_t SubWord /* = 0*/) {
CFX_ByteTextBuf sEditStream, sWords;
CFX_FloatPoint ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f);
diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp
index 1b68dc0510..d2a558fc70 100644
--- a/fpdfsdk/fxedit/fxet_edit.cpp
+++ b/fpdfsdk/fxedit/fxet_edit.cpp
@@ -100,7 +100,7 @@ IFX_Edit_FontMap* CFX_Edit_Provider::GetFontMap() {
}
int32_t CFX_Edit_Provider::GetCharWidth(int32_t nFontIndex,
- FX_WORD word,
+ uint16_t word,
int32_t nWordStyle) {
if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) {
FX_DWORD charcode = word;
@@ -131,7 +131,7 @@ int32_t CFX_Edit_Provider::GetTypeDescent(int32_t nFontIndex) {
return 0;
}
-int32_t CFX_Edit_Provider::GetWordFontIndex(FX_WORD word,
+int32_t CFX_Edit_Provider::GetWordFontIndex(uint16_t word,
int32_t charset,
int32_t nFontIndex) {
return m_pFontMap->GetWordFontIndex(word, charset, nFontIndex);
@@ -141,7 +141,7 @@ int32_t CFX_Edit_Provider::GetDefaultFontIndex() {
return 0;
}
-FX_BOOL CFX_Edit_Provider::IsLatinWord(FX_WORD word) {
+FX_BOOL CFX_Edit_Provider::IsLatinWord(uint16_t word) {
return FX_EDIT_ISLATINWORD(word);
}
@@ -409,7 +409,7 @@ CFX_WideString CFX_Edit_GroupUndoItem::GetUndoTitle() {
CFXEU_InsertWord::CFXEU_InsertWord(CFX_Edit* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
- FX_WORD word,
+ uint16_t word,
int32_t charset,
const CPVT_WordProps* pWordProps)
: m_pEdit(pEdit),
@@ -477,7 +477,7 @@ void CFXEU_InsertReturn::Undo() {
CFXEU_Backspace::CFXEU_Backspace(CFX_Edit* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
- FX_WORD word,
+ uint16_t word,
int32_t charset,
const CPVT_SecProps& SecProps,
const CPVT_WordProps& WordProps)
@@ -514,7 +514,7 @@ void CFXEU_Backspace::Undo() {
CFXEU_Delete::CFXEU_Delete(CFX_Edit* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
- FX_WORD word,
+ uint16_t word,
int32_t charset,
const CPVT_SecProps& SecProps,
const CPVT_WordProps& WordProps,
@@ -579,7 +579,7 @@ CFXEU_ClearRich::CFXEU_ClearRich(CFX_Edit* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
const CPVT_WordRange& wrSel,
- FX_WORD word,
+ uint16_t word,
int32_t charset,
const CPVT_SecProps& SecProps,
const CPVT_WordProps& WordProps)
@@ -833,7 +833,7 @@ void CFX_Edit::SetAlignmentV(int32_t nFormat, FX_BOOL bPaint) {
Paint();
}
-void CFX_Edit::SetPasswordChar(FX_WORD wSubWord, FX_BOOL bPaint) {
+void CFX_Edit::SetPasswordChar(uint16_t wSubWord, FX_BOOL bPaint) {
m_pVT->SetPasswordChar(wSubWord);
if (bPaint)
Paint();
@@ -1589,7 +1589,7 @@ void CFX_Edit::SetText(const FX_WCHAR* text,
SetText(text, charset, pSecProps, pWordProps, TRUE, TRUE);
}
-FX_BOOL CFX_Edit::InsertWord(FX_WORD word,
+FX_BOOL CFX_Edit::InsertWord(uint16_t word,
int32_t charset,
const CPVT_WordProps* pWordProps) {
return InsertWord(word, charset, pWordProps, TRUE, TRUE);
@@ -1623,7 +1623,7 @@ FX_FLOAT CFX_Edit::GetFontSize() const {
return m_pVT->GetFontSize();
}
-FX_WORD CFX_Edit::GetPasswordChar() const {
+uint16_t CFX_Edit::GetPasswordChar() const {
return m_pVT->GetPasswordChar();
}
@@ -2467,7 +2467,7 @@ void CFX_Edit::SetText(const FX_WCHAR* text,
m_pOprNotify->OnSetText(m_wpCaret, m_wpOldCaret);
}
-FX_BOOL CFX_Edit::InsertWord(FX_WORD word,
+FX_BOOL CFX_Edit::InsertWord(uint16_t word,
int32_t charset,
const CPVT_WordProps* pWordProps,
FX_BOOL bAddUndo,
@@ -2972,7 +2972,7 @@ CPVT_WordPlace CFX_Edit::DoInsertText(const CPVT_WordPlace& place,
CFX_WideString sText = text;
for (int32_t i = 0, sz = sText.GetLength(); i < sz; i++) {
- FX_WORD word = sText[i];
+ uint16_t word = sText[i];
switch (word) {
case 0x0D:
wp = m_pVT->InsertSection(wp, pSecProps, pWordProps);
@@ -2997,7 +2997,7 @@ CPVT_WordPlace CFX_Edit::DoInsertText(const CPVT_WordPlace& place,
return wp;
}
-int32_t CFX_Edit::GetCharSetFromUnicode(FX_WORD word, int32_t nOldCharset) {
+int32_t CFX_Edit::GetCharSetFromUnicode(uint16_t word, int32_t nOldCharset) {
if (IFX_Edit_FontMap* pFontMap = GetFontMap())
return pFontMap->CharSetFromUnicode(word, nOldCharset);
return nOldCharset;
diff --git a/fpdfsdk/fxedit/fxet_list.cpp b/fpdfsdk/fxedit/fxet_list.cpp
index cc9696030e..f060d93148 100644
--- a/fpdfsdk/fxedit/fxet_list.cpp
+++ b/fpdfsdk/fxedit/fxet_list.cpp
@@ -79,7 +79,7 @@ FX_FLOAT CFX_ListItem::GetItemHeight() const {
return 0.0f;
}
-FX_WORD CFX_ListItem::GetFirstChar() const {
+uint16_t CFX_ListItem::GetFirstChar() const {
CPVT_Word word;
if (IFX_Edit_Iterator* pIterator = GetIterator()) {
@@ -570,7 +570,7 @@ void CFX_ListCtrl::OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) {
OnVK(GetCount() - 1, bShift, bCtrl);
}
-FX_BOOL CFX_ListCtrl::OnChar(FX_WORD nChar, FX_BOOL bShift, FX_BOOL bCtrl) {
+FX_BOOL CFX_ListCtrl::OnChar(uint16_t nChar, FX_BOOL bShift, FX_BOOL bCtrl) {
int32_t nIndex = GetLastSelected();
int32_t nFindIndex = FindNext(nIndex, nChar);
diff --git a/fpdfsdk/fxedit/fxet_pageobjs.cpp b/fpdfsdk/fxedit/fxet_pageobjs.cpp
index 20133529ae..3f32d9d3e1 100644
--- a/fpdfsdk/fxedit/fxet_pageobjs.cpp
+++ b/fpdfsdk/fxedit/fxet_pageobjs.cpp
@@ -153,7 +153,7 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice,
void* pFFLData) {
const bool bContinuous =
pEdit->GetCharArray() == 0 && pEdit->GetCharSpace() <= 0.0f;
- FX_WORD SubWord = pEdit->GetPasswordChar();
+ uint16_t SubWord = pEdit->GetPasswordChar();
FX_FLOAT fFontSize = pEdit->GetFontSize();
CPVT_WordRange wrSelect = pEdit->GetSelectWordRange();
int32_t nHorzScale = pEdit->GetHorzScale();
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h
index b80e797f18..17340753ea 100644
--- a/fpdfsdk/include/fsdk_mgr.h
+++ b/fpdfsdk/include/fsdk_mgr.h
@@ -513,14 +513,14 @@ class CPDFSDK_Document {
FX_BOOL SetFocusAnnot(CPDFSDK_Annot* pAnnot, FX_UINT nFlag = 0);
FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0);
- FX_BOOL ExtractPages(const std::vector<FX_WORD>& arrExtraPages,
+ FX_BOOL ExtractPages(const std::vector<uint16_t>& arrExtraPages,
CPDF_Document* pDstDoc);
FX_BOOL InsertPages(int nInsertAt,
const CPDF_Document* pSrcDoc,
- const std::vector<FX_WORD>& arrSrcPages);
+ const std::vector<uint16_t>& arrSrcPages);
FX_BOOL ReplacePages(int nPage,
const CPDF_Document* pSrcDoc,
- const std::vector<FX_WORD>& arrSrcPages);
+ const std::vector<uint16_t>& arrSrcPages);
void OnCloseDocument();
diff --git a/fpdfsdk/include/fx_systemhandler.h b/fpdfsdk/include/fx_systemhandler.h
index 4a1d61472e..ab0bc46017 100644
--- a/fpdfsdk/include/fx_systemhandler.h
+++ b/fpdfsdk/include/fx_systemhandler.h
@@ -27,14 +27,14 @@ struct FX_SYSTEMTIME {
wMinute(0),
wSecond(0),
wMilliseconds(0) {}
- FX_WORD wYear;
- FX_WORD wMonth;
- FX_WORD wDayOfWeek;
- FX_WORD wDay;
- FX_WORD wHour;
- FX_WORD wMinute;
- FX_WORD wSecond;
- FX_WORD wMilliseconds;
+ uint16_t wYear;
+ uint16_t wMonth;
+ uint16_t wDayOfWeek;
+ uint16_t wDay;
+ uint16_t wHour;
+ uint16_t wMinute;
+ uint16_t wSecond;
+ uint16_t wMilliseconds;
};
// cursor style
diff --git a/fpdfsdk/include/fxedit/fx_edit.h b/fpdfsdk/include/fxedit/fx_edit.h
index a70d0e7c4c..d2222a04af 100644
--- a/fpdfsdk/include/fxedit/fx_edit.h
+++ b/fpdfsdk/include/fxedit/fx_edit.h
@@ -59,13 +59,13 @@ class IFX_Edit_FontMap {
// get the alias of a pdf font.
virtual CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) = 0;
// get the index of a font that can show a word.
- virtual int32_t GetWordFontIndex(FX_WORD word,
+ virtual int32_t GetWordFontIndex(uint16_t word,
int32_t charset,
int32_t nFontIndex) = 0;
// get the charcode of word from unicode
- virtual int32_t CharCodeFromUnicode(int32_t nFontIndex, FX_WORD word) = 0;
+ virtual int32_t CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) = 0;
// get the charset of unicode
- virtual int32_t CharSetFromUnicode(FX_WORD word, int32_t nOldCharset) = 0;
+ virtual int32_t CharSetFromUnicode(uint16_t word, int32_t nOldCharset) = 0;
};
class IFX_Edit_Notify {
@@ -215,7 +215,7 @@ class IFX_Edit {
// 2:bottom).
virtual void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0;
// if the text is shown in secret , set a character for substitute.
- virtual void SetPasswordChar(FX_WORD wSubWord = '*',
+ virtual void SetPasswordChar(uint16_t wSubWord = '*',
FX_BOOL bPaint = TRUE) = 0;
// set the maximal count of words of the text.
virtual void SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE) = 0;
@@ -336,7 +336,7 @@ class IFX_Edit {
const CPVT_SecProps* pSecProps = NULL,
const CPVT_WordProps* pWordProps = NULL) = 0;
// insert a word into the edit.
- virtual FX_BOOL InsertWord(FX_WORD word,
+ virtual FX_BOOL InsertWord(uint16_t word,
int32_t charset = DEFAULT_CHARSET,
const CPVT_WordProps* pWordProps = NULL) = 0;
// insert a return into the edit.
@@ -404,7 +404,7 @@ class IFX_Edit {
// get the font size of non_rich text or default font size of richtext.
virtual FX_FLOAT GetFontSize() const = 0;
// get the mask character.
- virtual FX_WORD GetPasswordChar() const = 0;
+ virtual uint16_t GetPasswordChar() const = 0;
// get the count of charArray
virtual int32_t GetCharArray() const = 0;
// get the horizontal scale of all characters
@@ -429,7 +429,7 @@ class IFX_Edit {
const CFX_FloatPoint& ptOffset,
const CPVT_WordRange* pRange = NULL,
FX_BOOL bContinuous = TRUE,
- FX_WORD SubWord = 0);
+ uint16_t SubWord = 0);
static CFX_ByteString GetSelectAppearanceStream(
IFX_Edit* pEdit,
const CFX_FloatPoint& ptOffset,
@@ -562,7 +562,7 @@ class IFX_List {
virtual void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) = 0;
virtual void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) = 0;
virtual void OnVK(int32_t nItemIndex, FX_BOOL bShift, FX_BOOL bCtrl) = 0;
- virtual FX_BOOL OnChar(FX_WORD nChar, FX_BOOL bShift, FX_BOOL bCtrl) = 0;
+ virtual FX_BOOL OnChar(uint16_t nChar, FX_BOOL bShift, FX_BOOL bCtrl) = 0;
protected:
virtual ~IFX_List() {}
@@ -570,7 +570,7 @@ class IFX_List {
CFX_ByteString GetPDFWordString(IFX_Edit_FontMap* pFontMap,
int32_t nFontIndex,
- FX_WORD Word,
- FX_WORD SubWord);
+ uint16_t Word,
+ uint16_t SubWord);
#endif // FPDFSDK_INCLUDE_FXEDIT_FX_EDIT_H_
diff --git a/fpdfsdk/include/fxedit/fxet_edit.h b/fpdfsdk/include/fxedit/fxet_edit.h
index 9809ac9f7d..d3e354d0e8 100644
--- a/fpdfsdk/include/fxedit/fxet_edit.h
+++ b/fpdfsdk/include/fxedit/fxet_edit.h
@@ -287,7 +287,7 @@ class CFXEU_InsertWord : public CFX_Edit_UndoItem {
CFXEU_InsertWord(CFX_Edit* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
- FX_WORD word,
+ uint16_t word,
int32_t charset,
const CPVT_WordProps* pWordProps);
~CFXEU_InsertWord() override;
@@ -301,7 +301,7 @@ class CFXEU_InsertWord : public CFX_Edit_UndoItem {
CPVT_WordPlace m_wpOld;
CPVT_WordPlace m_wpNew;
- FX_WORD m_Word;
+ uint16_t m_Word;
int32_t m_nCharset;
CPVT_WordProps m_WordProps;
};
@@ -333,7 +333,7 @@ class CFXEU_Backspace : public CFX_Edit_UndoItem {
CFXEU_Backspace(CFX_Edit* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
- FX_WORD word,
+ uint16_t word,
int32_t charset,
const CPVT_SecProps& SecProps,
const CPVT_WordProps& WordProps);
@@ -348,7 +348,7 @@ class CFXEU_Backspace : public CFX_Edit_UndoItem {
CPVT_WordPlace m_wpOld;
CPVT_WordPlace m_wpNew;
- FX_WORD m_Word;
+ uint16_t m_Word;
int32_t m_nCharset;
CPVT_SecProps m_SecProps;
CPVT_WordProps m_WordProps;
@@ -359,7 +359,7 @@ class CFXEU_Delete : public CFX_Edit_UndoItem {
CFXEU_Delete(CFX_Edit* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
- FX_WORD word,
+ uint16_t word,
int32_t charset,
const CPVT_SecProps& SecProps,
const CPVT_WordProps& WordProps,
@@ -375,7 +375,7 @@ class CFXEU_Delete : public CFX_Edit_UndoItem {
CPVT_WordPlace m_wpOld;
CPVT_WordPlace m_wpNew;
- FX_WORD m_Word;
+ uint16_t m_Word;
int32_t m_nCharset;
CPVT_SecProps m_SecProps;
CPVT_WordProps m_WordProps;
@@ -406,7 +406,7 @@ class CFXEU_ClearRich : public CFX_Edit_UndoItem {
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
const CPVT_WordRange& wrSel,
- FX_WORD word,
+ uint16_t word,
int32_t charset,
const CPVT_SecProps& SecProps,
const CPVT_WordProps& WordProps);
@@ -422,7 +422,7 @@ class CFXEU_ClearRich : public CFX_Edit_UndoItem {
CPVT_WordPlace m_wpOld;
CPVT_WordPlace m_wpNew;
CPVT_WordRange m_wrSel;
- FX_WORD m_Word;
+ uint16_t m_Word;
int32_t m_nCharset;
CPVT_SecProps m_SecProps;
CPVT_WordProps m_WordProps;
@@ -537,7 +537,7 @@ class CFX_Edit : public IFX_Edit {
void SetScrollPos(const CFX_FloatPoint& point) override;
void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) override;
void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) override;
- void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE) override;
+ void SetPasswordChar(uint16_t wSubWord = '*', FX_BOOL bPaint = TRUE) override;
void SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE) override;
void SetCharArray(int32_t nCharArray = 0, FX_BOOL bPaint = TRUE) override;
void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE) override;
@@ -581,7 +581,7 @@ class CFX_Edit : public IFX_Edit {
int32_t charset = DEFAULT_CHARSET,
const CPVT_SecProps* pSecProps = NULL,
const CPVT_WordProps* pWordProps = NULL) override;
- FX_BOOL InsertWord(FX_WORD word,
+ FX_BOOL InsertWord(uint16_t word,
int32_t charset = DEFAULT_CHARSET,
const CPVT_WordProps* pWordProps = NULL) override;
FX_BOOL InsertReturn(const CPVT_SecProps* pSecProps = NULL,
@@ -608,7 +608,7 @@ class CFX_Edit : public IFX_Edit {
CFX_WideString GetSelText() const override;
CFX_WideString GetText() const override;
FX_FLOAT GetFontSize() const override;
- FX_WORD GetPasswordChar() const override;
+ uint16_t GetPasswordChar() const override;
CFX_FloatPoint GetScrollPos() const override;
int32_t GetCharArray() const override;
CFX_FloatRect GetPlateRect() const override;
@@ -646,7 +646,7 @@ class CFX_Edit : public IFX_Edit {
int32_t charset,
const CPVT_SecProps* pSecProps,
const CPVT_WordProps* pWordProps);
- int32_t GetCharSetFromUnicode(FX_WORD word, int32_t nOldCharset);
+ int32_t GetCharSetFromUnicode(uint16_t word, int32_t nOldCharset);
int32_t GetTotalLines() const;
@@ -668,7 +668,7 @@ class CFX_Edit : public IFX_Edit {
const CPVT_WordProps* pWordProps,
FX_BOOL bAddUndo,
FX_BOOL bPaint);
- FX_BOOL InsertWord(FX_WORD word,
+ FX_BOOL InsertWord(uint16_t word,
int32_t charset,
const CPVT_WordProps* pWordProps,
FX_BOOL bAddUndo,
@@ -799,15 +799,15 @@ class CFX_Edit_Provider : public IPDF_VariableText_Provider {
// IPDF_VariableText_Provider:
int32_t GetCharWidth(int32_t nFontIndex,
- FX_WORD word,
+ uint16_t word,
int32_t nWordStyle) override;
int32_t GetTypeAscent(int32_t nFontIndex) override;
int32_t GetTypeDescent(int32_t nFontIndex) override;
- int32_t GetWordFontIndex(FX_WORD word,
+ int32_t GetWordFontIndex(uint16_t word,
int32_t charset,
int32_t nFontIndex) override;
int32_t GetDefaultFontIndex() override;
- FX_BOOL IsLatinWord(FX_WORD word) override;
+ FX_BOOL IsLatinWord(uint16_t word) override;
private:
IFX_Edit_FontMap* m_pFontMap;
diff --git a/fpdfsdk/include/fxedit/fxet_list.h b/fpdfsdk/include/fxedit/fxet_list.h
index 05ba4f9e23..d86e6ffeee 100644
--- a/fpdfsdk/include/fxedit/fxet_list.h
+++ b/fpdfsdk/include/fxedit/fxet_list.h
@@ -134,7 +134,7 @@ class CFX_ListItem {
FX_BOOL IsSelected() const;
FX_BOOL IsCaret() const;
FX_FLOAT GetItemHeight() const;
- FX_WORD GetFirstChar() const;
+ uint16_t GetFirstChar() const;
private:
IFX_Edit* m_pEdit;
@@ -296,7 +296,7 @@ class CFX_ListCtrl : public CFX_List {
void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) override;
void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) override;
void OnVK(int32_t nItemIndex, FX_BOOL bShift, FX_BOOL bCtrl) override;
- FX_BOOL OnChar(FX_WORD nChar, FX_BOOL bShift, FX_BOOL bCtrl) override;
+ FX_BOOL OnChar(uint16_t nChar, FX_BOOL bShift, FX_BOOL bCtrl) override;
void SetPlateRect(const CFX_FloatRect& rect) override;
void SetScrollPos(const CFX_FloatPoint& point) override;
void ScrollToListItem(int32_t nItemIndex) override;
diff --git a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h
index b08e954947..88b7213920 100644
--- a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h
+++ b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h
@@ -25,8 +25,8 @@ class CPWL_CBListBox : public CPWL_ListBox {
// CPWL_ListBox
FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
- FX_BOOL OnKeyDownWithExit(FX_WORD nChar, FX_BOOL& bExit, FX_DWORD nFlag);
- FX_BOOL OnCharWithExit(FX_WORD nChar, FX_BOOL& bExit, FX_DWORD nFlag);
+ FX_BOOL OnKeyDownWithExit(uint16_t nChar, FX_BOOL& bExit, FX_DWORD nFlag);
+ FX_BOOL OnCharWithExit(uint16_t nChar, FX_BOOL& bExit, FX_DWORD nFlag);
};
#define PWL_COMBOBOX_BUTTON_WIDTH 13
@@ -54,8 +54,8 @@ class CPWL_ComboBox : public CPWL_Wnd {
// CPWL_Wnd:
CFX_ByteString GetClassName() const override;
void OnCreate(PWL_CREATEPARAM& cp) override;
- FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override;
- FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override;
+ FX_BOOL OnKeyDown(uint16_t nChar, FX_DWORD nFlag) override;
+ FX_BOOL OnChar(uint16_t nChar, FX_DWORD nFlag) override;
void OnNotify(CPWL_Wnd* pWnd,
FX_DWORD msg,
intptr_t wParam = 0,
diff --git a/fpdfsdk/include/pdfwindow/PWL_Edit.h b/fpdfsdk/include/pdfwindow/PWL_Edit.h
index e93afaaa00..0d764c0f89 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Edit.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Edit.h
@@ -62,8 +62,8 @@ class CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify {
FX_BOOL OnMouseWheel(short zDelta,
const CFX_FloatPoint& point,
FX_DWORD nFlag) override;
- FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override;
- FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override;
+ FX_BOOL OnKeyDown(uint16_t nChar, FX_DWORD nFlag) override;
+ FX_BOOL OnChar(uint16_t nChar, FX_DWORD nFlag) override;
CFX_FloatRect GetFocusRect() const override;
void OnSetFocus() override;
void OnKillFocus() override;
@@ -154,7 +154,7 @@ class CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify {
FX_BOOL bArabic) const;
public:
- FX_BOOL IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag);
+ FX_BOOL IsProceedtoOnChar(uint16_t nKeyCode, FX_DWORD nFlag);
private:
IPWL_Filler_Notify* m_pFillerNotify;
diff --git a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
index f80033081e..f2e166385e 100644
--- a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
+++ b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
@@ -103,8 +103,8 @@ class CPWL_EditCtrl : public CPWL_Wnd, public IFX_Edit_Notify {
// CPWL_Wnd
void OnCreate(PWL_CREATEPARAM& cp) override;
void OnCreated() override;
- FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override;
- FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override;
+ FX_BOOL OnKeyDown(uint16_t nChar, FX_DWORD nFlag) override;
+ FX_BOOL OnChar(uint16_t nChar, FX_DWORD nFlag) override;
FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
FX_BOOL OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
@@ -149,7 +149,7 @@ class CPWL_EditCtrl : public CPWL_Wnd, public IFX_Edit_Notify {
void PasteText();
void CutText();
void ShowVScrollBar(FX_BOOL bShow);
- void InsertWord(FX_WORD word, int32_t nCharset);
+ void InsertWord(uint16_t word, int32_t nCharset);
void InsertReturn();
FX_BOOL IsWndHorV();
diff --git a/fpdfsdk/include/pdfwindow/PWL_FontMap.h b/fpdfsdk/include/pdfwindow/PWL_FontMap.h
index c8c8722c11..a913571960 100644
--- a/fpdfsdk/include/pdfwindow/PWL_FontMap.h
+++ b/fpdfsdk/include/pdfwindow/PWL_FontMap.h
@@ -56,11 +56,11 @@ class CPWL_FontMap : public IFX_Edit_FontMap {
// IFX_Edit_FontMap
CPDF_Font* GetPDFFont(int32_t nFontIndex) override;
CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) override;
- int32_t GetWordFontIndex(FX_WORD word,
+ int32_t GetWordFontIndex(uint16_t word,
int32_t nCharset,
int32_t nFontIndex) override;
- int32_t CharCodeFromUnicode(int32_t nFontIndex, FX_WORD word) override;
- int32_t CharSetFromUnicode(FX_WORD word, int32_t nOldCharset) override;
+ int32_t CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) override;
+ int32_t CharSetFromUnicode(uint16_t word, int32_t nOldCharset) override;
void SetSystemHandler(IFX_SystemHandler* pSystemHandler);
int32_t GetFontMapCount() const;
@@ -86,13 +86,13 @@ class CPWL_FontMap : public IFX_Edit_FontMap {
int32_t nCharset);
virtual void AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias);
- FX_BOOL KnowWord(int32_t nFontIndex, FX_WORD word);
+ FX_BOOL KnowWord(int32_t nFontIndex, uint16_t word);
void Empty();
int32_t GetFontIndex(const CFX_ByteString& sFontName,
int32_t nCharset,
FX_BOOL bFind);
- int32_t GetPWLFontIndex(FX_WORD word, int32_t nCharset);
+ int32_t GetPWLFontIndex(uint16_t word, int32_t nCharset);
int32_t AddFontData(CPDF_Font* pFont,
const CFX_ByteString& sFontAlias,
int32_t nCharset = DEFAULT_CHARSET);
diff --git a/fpdfsdk/include/pdfwindow/PWL_IconList.h b/fpdfsdk/include/pdfwindow/PWL_IconList.h
index 71c9f4cb25..a11a73c41a 100644
--- a/fpdfsdk/include/pdfwindow/PWL_IconList.h
+++ b/fpdfsdk/include/pdfwindow/PWL_IconList.h
@@ -78,7 +78,7 @@ class CPWL_IconList_Content : public CPWL_ListCtrl {
FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
FX_BOOL OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
- FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override;
+ FX_BOOL OnKeyDown(uint16_t nChar, FX_DWORD nFlag) override;
private:
CPWL_IconList_Item* GetListItem(int32_t nItemIndex) const;
diff --git a/fpdfsdk/include/pdfwindow/PWL_ListBox.h b/fpdfsdk/include/pdfwindow/PWL_ListBox.h
index e12d727d58..d0d98b9bcc 100644
--- a/fpdfsdk/include/pdfwindow/PWL_ListBox.h
+++ b/fpdfsdk/include/pdfwindow/PWL_ListBox.h
@@ -59,8 +59,8 @@ class CPWL_ListBox : public CPWL_Wnd {
void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
void DrawThisAppearance(CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device) override;
- FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override;
- FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override;
+ FX_BOOL OnKeyDown(uint16_t nChar, FX_DWORD nFlag) override;
+ FX_BOOL OnChar(uint16_t nChar, FX_DWORD nFlag) override;
FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
FX_BOOL OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
diff --git a/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h b/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h
index 8731562726..35b2c3f43e 100644
--- a/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h
+++ b/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h
@@ -27,7 +27,7 @@ class CPWL_CheckBox : public CPWL_Button {
// CPWL_Button
CFX_ByteString GetClassName() const override;
FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
- FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override;
+ FX_BOOL OnChar(uint16_t nChar, FX_DWORD nFlag) override;
void SetCheck(bool bCheck);
bool IsChecked() const;
@@ -44,7 +44,7 @@ class CPWL_RadioButton : public CPWL_Button {
// CPWL_Button
CFX_ByteString GetClassName() const override;
FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
- FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override;
+ FX_BOOL OnChar(uint16_t nChar, FX_DWORD nFlag) override;
void SetCheck(bool bCheck);
bool IsChecked() const;
diff --git a/fpdfsdk/include/pdfwindow/PWL_Utils.h b/fpdfsdk/include/pdfwindow/PWL_Utils.h
index 7cce6c2b66..be51f18627 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Utils.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Utils.h
@@ -27,9 +27,9 @@ T PWL_MAX(const T& i, const T& j) {
#define PWL_WIN2PDF(color) ((FX_FLOAT)((FX_FLOAT)color / 255.0f))
#define PWL_MAKEDWORD(low, high) \
- ((FX_DWORD)((FX_WORD)(low) | (FX_DWORD)(((FX_WORD)(high)) << 16)))
-#define PWL_GETLOWWORD(dword) ((FX_WORD)(dword))
-#define PWL_GETHIGHWORD(dword) ((FX_WORD)(dword >> 16))
+ ((FX_DWORD)((uint16_t)(low) | (FX_DWORD)(((uint16_t)(high)) << 16)))
+#define PWL_GETLOWWORD(dword) ((uint16_t)(dword))
+#define PWL_GETHIGHWORD(dword) ((uint16_t)(dword >> 16))
#define PWL_ICONTYPE_CHECKMARK 0
#define PWL_ICONTYPE_CIRCLE 1
@@ -171,7 +171,7 @@ class CPWL_Utils {
const CFX_FloatPoint& ptOffset,
const CPVT_WordRange* pRange = NULL,
FX_BOOL bContinuous = TRUE,
- FX_WORD SubWord = 0);
+ uint16_t SubWord = 0);
static CFX_ByteString GetEditSelAppStream(
IFX_Edit* pEdit,
const CFX_FloatPoint& ptOffset,
diff --git a/fpdfsdk/include/pdfwindow/PWL_Wnd.h b/fpdfsdk/include/pdfwindow/PWL_Wnd.h
index 493cdc0874..6ad356d80d 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Wnd.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Wnd.h
@@ -298,9 +298,9 @@ class CPWL_Wnd : public CPWL_TimerHandler {
void DrawAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device);
- virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
- virtual FX_BOOL OnKeyUp(FX_WORD nChar, FX_DWORD nFlag);
- virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnKeyDown(uint16_t nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnKeyUp(uint16_t nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnChar(uint16_t nChar, FX_DWORD nFlag);
virtual FX_BOOL OnLButtonDblClk(const CFX_FloatPoint& point, FX_DWORD nFlag);
virtual FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag);
virtual FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag);
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp
index 36ea910a47..fe4cd7c8ce 100644
--- a/fpdfsdk/javascript/Document.cpp
+++ b/fpdfsdk/javascript/Document.cpp
@@ -1465,7 +1465,7 @@ int Document::CountWords(CPDF_TextObject* pTextObj) {
pTextObj->GetCharInfo(i, charcode, kerning);
CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode);
- FX_WORD unicode = 0;
+ uint16_t unicode = 0;
if (swUnicode.GetLength() > 0)
unicode = swUnicode[0];
@@ -1498,7 +1498,7 @@ CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj,
pTextObj->GetCharInfo(i, charcode, kerning);
CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode);
- FX_WORD unicode = 0;
+ uint16_t unicode = 0;
if (swUnicode.GetLength() > 0)
unicode = swUnicode[0];
diff --git a/fpdfsdk/javascript/JS_GlobalData.cpp b/fpdfsdk/javascript/JS_GlobalData.cpp
index ba547fe79e..3376ccdc61 100644
--- a/fpdfsdk/javascript/JS_GlobalData.cpp
+++ b/fpdfsdk/javascript/JS_GlobalData.cpp
@@ -317,14 +317,14 @@ void CJS_GlobalData::LoadGlobalPersistentVariables() {
if (pBuffer) {
uint8_t* p = pBuffer;
- FX_WORD wType = *((FX_WORD*)p);
- p += sizeof(FX_WORD);
+ uint16_t wType = *((uint16_t*)p);
+ p += sizeof(uint16_t);
- // FX_WORD wTemp = (FX_WORD)(('X' << 8) | 'F');
+ // uint16_t wTemp = (uint16_t)(('X' << 8) | 'F');
- if (wType == (FX_WORD)(('X' << 8) | 'F')) {
- FX_WORD wVersion = *((FX_WORD*)p);
- p += sizeof(FX_WORD);
+ if (wType == (uint16_t)(('X' << 8) | 'F')) {
+ uint16_t wVersion = *((uint16_t*)p);
+ p += sizeof(uint16_t);
ASSERT(wVersion <= 2);
@@ -334,7 +334,7 @@ void CJS_GlobalData::LoadGlobalPersistentVariables() {
FX_DWORD dwSize = *((FX_DWORD*)p);
p += sizeof(FX_DWORD);
- if (dwSize == nLength - sizeof(FX_WORD) * 2 - sizeof(FX_DWORD) * 2) {
+ if (dwSize == nLength - sizeof(uint16_t) * 2 - sizeof(FX_DWORD) * 2) {
for (int32_t i = 0, sz = dwCount; i < sz; i++) {
if (p > pBuffer + nLength)
break;
@@ -348,8 +348,8 @@ void CJS_GlobalData::LoadGlobalPersistentVariables() {
CFX_ByteString sEntry = CFX_ByteString(p, dwNameLen);
p += sizeof(char) * dwNameLen;
- FX_WORD wDataType = *((FX_WORD*)p);
- p += sizeof(FX_WORD);
+ uint16_t wDataType = *((uint16_t*)p);
+ p += sizeof(uint16_t);
switch (wDataType) {
case JS_GLOBALDATA_TYPE_NUMBER: {
@@ -369,8 +369,8 @@ void CJS_GlobalData::LoadGlobalPersistentVariables() {
SetGlobalVariablePersistent(sEntry, TRUE);
} break;
case JS_GLOBALDATA_TYPE_BOOLEAN: {
- FX_WORD wData = *((FX_WORD*)p);
- p += sizeof(FX_WORD);
+ uint16_t wData = *((uint16_t*)p);
+ p += sizeof(uint16_t);
SetGlobalVariableBoolean(sEntry, (bool)(wData == 1));
SetGlobalVariablePersistent(sEntry, TRUE);
} break;
@@ -417,10 +417,10 @@ void CJS_GlobalData::SaveGlobalPersisitentVariables() {
CFX_BinaryBuf sFile;
- FX_WORD wType = (FX_WORD)(('X' << 8) | 'F');
- sFile.AppendBlock(&wType, sizeof(FX_WORD));
- FX_WORD wVersion = 2;
- sFile.AppendBlock(&wVersion, sizeof(FX_WORD));
+ uint16_t wType = (uint16_t)(('X' << 8) | 'F');
+ 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));
@@ -448,13 +448,13 @@ void CJS_GlobalData::WriteFileBuffer(const FX_WCHAR* sFilePath,
void CJS_GlobalData::MakeByteString(const CFX_ByteString& name,
CJS_KeyValue* pData,
CFX_BinaryBuf& sData) {
- FX_WORD wType = (FX_WORD)pData->nType;
+ 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));
sData.AppendString(name);
- sData.AppendBlock(&wType, sizeof(FX_WORD));
+ sData.AppendBlock(&wType, sizeof(uint16_t));
double dData = pData->dData;
sData.AppendBlock(&dData, sizeof(double));
@@ -463,16 +463,16 @@ void CJS_GlobalData::MakeByteString(const CFX_ByteString& name,
FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
sData.AppendString(name);
- sData.AppendBlock(&wType, sizeof(FX_WORD));
+ sData.AppendBlock(&wType, sizeof(uint16_t));
- FX_WORD wData = (FX_WORD)pData->bData;
- sData.AppendBlock(&wData, sizeof(FX_WORD));
+ uint16_t wData = (uint16_t)pData->bData;
+ 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));
sData.AppendString(name);
- sData.AppendBlock(&wType, sizeof(FX_WORD));
+ sData.AppendBlock(&wType, sizeof(uint16_t));
FX_DWORD dwDataLen = (FX_DWORD)pData->sData.GetLength();
sData.AppendBlock(&dwDataLen, sizeof(FX_DWORD));
diff --git a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
index 1d98a51d26..cf9ce0a5fb 100644
--- a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
@@ -45,7 +45,7 @@ FX_BOOL CPWL_CBListBox::OnLButtonUp(const CFX_FloatPoint& point,
return TRUE;
}
-FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(FX_WORD nChar,
+FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(uint16_t nChar,
FX_BOOL& bExit,
FX_DWORD nFlag) {
if (!m_pList)
@@ -91,7 +91,7 @@ FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(FX_WORD nChar,
return TRUE;
}
-FX_BOOL CPWL_CBListBox::OnCharWithExit(FX_WORD nChar,
+FX_BOOL CPWL_CBListBox::OnCharWithExit(uint16_t nChar,
FX_BOOL& bExit,
FX_DWORD nFlag) {
if (!m_pList)
@@ -517,7 +517,7 @@ void CPWL_ComboBox::SetPopup(FX_BOOL bPopup) {
}
}
-FX_BOOL CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_ComboBox::OnKeyDown(uint16_t nChar, FX_DWORD nFlag) {
if (!m_pList)
return FALSE;
if (!m_pEdit)
@@ -576,7 +576,7 @@ FX_BOOL CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) {
return FALSE;
}
-FX_BOOL CPWL_ComboBox::OnChar(FX_WORD nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_ComboBox::OnChar(uint16_t nChar, FX_DWORD nFlag) {
if (!m_pList)
return FALSE;
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp
index 808b2b56bf..62873e5bc0 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp
@@ -862,7 +862,7 @@ void CPWL_Edit::EnableSpellCheck(FX_BOOL bEnabled) {
RemoveFlag(PES_SPELLCHECK);
}
-FX_BOOL CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_Edit::OnKeyDown(uint16_t nChar, FX_DWORD nFlag) {
if (m_bMouseDown)
return TRUE;
@@ -903,7 +903,7 @@ FX_BOOL CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) {
*If the event is swallowed, implementation may do other unexpected things, which
*is not the control means to do.
*/
-FX_BOOL CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag) {
+FX_BOOL CPWL_Edit::IsProceedtoOnChar(uint16_t nKeyCode, FX_DWORD nFlag) {
FX_BOOL bCtrl = IsCTRLpressed(nFlag);
FX_BOOL bAlt = IsALTpressed(nFlag);
if (bCtrl && !bAlt) {
@@ -931,7 +931,7 @@ FX_BOOL CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag) {
}
}
-FX_BOOL CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_Edit::OnChar(uint16_t nChar, FX_DWORD nFlag) {
if (m_bMouseDown)
return TRUE;
diff --git a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
index 10b5d6c04f..3109052a20 100644
--- a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
+++ b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
@@ -142,7 +142,7 @@ FX_FLOAT CPWL_EditCtrl::GetFontSize() const {
return m_pEdit->GetFontSize();
}
-FX_BOOL CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_EditCtrl::OnKeyDown(uint16_t nChar, FX_DWORD nFlag) {
if (m_bMouseDown)
return TRUE;
@@ -217,7 +217,7 @@ FX_BOOL CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) {
return bRet;
}
-FX_BOOL CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_EditCtrl::OnChar(uint16_t nChar, FX_DWORD nFlag) {
if (m_bMouseDown)
return TRUE;
@@ -236,7 +236,7 @@ FX_BOOL CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag) {
FX_BOOL bAlt = IsALTpressed(nFlag);
FX_BOOL bShift = IsSHIFTpressed(nFlag);
- FX_WORD word = nChar;
+ uint16_t word = nChar;
if (bCtrl && !bAlt) {
switch (nChar) {
@@ -508,7 +508,7 @@ void CPWL_EditCtrl::InsertText(const FX_WCHAR* csText) {
m_pEdit->InsertText(csText);
}
-void CPWL_EditCtrl::InsertWord(FX_WORD word, int32_t nCharset) {
+void CPWL_EditCtrl::InsertWord(uint16_t word, int32_t nCharset) {
if (!IsReadOnly())
m_pEdit->InsertWord(word, nCharset);
}
diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
index ff9e2a3e39..1ac55bcb6e 100644
--- a/fpdfsdk/pdfwindow/PWL_FontMap.cpp
+++ b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
@@ -79,7 +79,7 @@ CFX_ByteString CPWL_FontMap::GetPDFFontAlias(int32_t nFontIndex) {
return "";
}
-FX_BOOL CPWL_FontMap::KnowWord(int32_t nFontIndex, FX_WORD word) {
+FX_BOOL CPWL_FontMap::KnowWord(int32_t nFontIndex, uint16_t word) {
if (nFontIndex >= 0 && nFontIndex < m_aData.GetSize()) {
if (m_aData.GetAt(nFontIndex)) {
return CharCodeFromUnicode(nFontIndex, word) >= 0;
@@ -89,7 +89,7 @@ FX_BOOL CPWL_FontMap::KnowWord(int32_t nFontIndex, FX_WORD word) {
return FALSE;
}
-int32_t CPWL_FontMap::GetWordFontIndex(FX_WORD word,
+int32_t CPWL_FontMap::GetWordFontIndex(uint16_t word,
int32_t nCharset,
int32_t nFontIndex) {
if (nFontIndex > 0) {
@@ -119,7 +119,7 @@ int32_t CPWL_FontMap::GetWordFontIndex(FX_WORD word,
return -1;
}
-int32_t CPWL_FontMap::CharCodeFromUnicode(int32_t nFontIndex, FX_WORD word) {
+int32_t CPWL_FontMap::CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) {
if (CPWL_FontMap_Data* pData = m_aData.GetAt(nFontIndex)) {
if (pData->pFont) {
if (pData->pFont->IsUnicodeCompatible()) {
@@ -219,7 +219,7 @@ int32_t CPWL_FontMap::GetFontIndex(const CFX_ByteString& sFontName,
return AddFontData(pFont, sAlias, nCharset);
}
-int32_t CPWL_FontMap::GetPWLFontIndex(FX_WORD word, int32_t nCharset) {
+int32_t CPWL_FontMap::GetPWLFontIndex(uint16_t word, int32_t nCharset) {
int32_t nFind = -1;
for (int32_t i = 0, sz = m_aData.GetSize(); i < sz; i++) {
@@ -434,7 +434,7 @@ CFX_ByteString CPWL_FontMap::GetDefaultFontByCharset(int32_t nCharset) {
return "";
}
-int32_t CPWL_FontMap::CharSetFromUnicode(FX_WORD word, int32_t nOldCharset) {
+int32_t CPWL_FontMap::CharSetFromUnicode(uint16_t word, int32_t nOldCharset) {
if (m_pSystemHandler && (-1 != m_pSystemHandler->GetCharSet()))
return m_pSystemHandler->GetCharSet();
// to avoid CJK Font to show ASCII
diff --git a/fpdfsdk/pdfwindow/PWL_IconList.cpp b/fpdfsdk/pdfwindow/PWL_IconList.cpp
index 7dc8ba9f44..d2418c8ecc 100644
--- a/fpdfsdk/pdfwindow/PWL_IconList.cpp
+++ b/fpdfsdk/pdfwindow/PWL_IconList.cpp
@@ -197,7 +197,7 @@ FX_BOOL CPWL_IconList_Content::OnMouseMove(const CFX_FloatPoint& point,
return TRUE;
}
-FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_IconList_Content::OnKeyDown(uint16_t nChar, FX_DWORD nFlag) {
switch (nChar) {
case FWL_VKEY_Up:
if (m_nSelectIndex > 0) {
diff --git a/fpdfsdk/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/pdfwindow/PWL_ListBox.cpp
index 2c0b79d2f1..a673455242 100644
--- a/fpdfsdk/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ListBox.cpp
@@ -203,7 +203,7 @@ void CPWL_ListBox::DrawThisAppearance(CFX_RenderDevice* pDevice,
}
}
-FX_BOOL CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_ListBox::OnKeyDown(uint16_t nChar, FX_DWORD nFlag) {
CPWL_Wnd::OnKeyDown(nChar, nFlag);
if (!m_pList)
@@ -250,7 +250,7 @@ FX_BOOL CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) {
return TRUE;
}
-FX_BOOL CPWL_ListBox::OnChar(FX_WORD nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_ListBox::OnChar(uint16_t nChar, FX_DWORD nFlag) {
CPWL_Wnd::OnChar(nChar, nFlag);
if (!m_pList)
diff --git a/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp b/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp
index c19a233940..78ded5ebb1 100644
--- a/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp
+++ b/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp
@@ -46,7 +46,7 @@ FX_BOOL CPWL_CheckBox::OnLButtonUp(const CFX_FloatPoint& point,
return TRUE;
}
-FX_BOOL CPWL_CheckBox::OnChar(FX_WORD nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_CheckBox::OnChar(uint16_t nChar, FX_DWORD nFlag) {
SetCheck(!IsChecked());
return TRUE;
}
@@ -76,7 +76,7 @@ bool CPWL_RadioButton::IsChecked() const {
return m_bChecked;
}
-FX_BOOL CPWL_RadioButton::OnChar(FX_WORD nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_RadioButton::OnChar(uint16_t nChar, FX_DWORD nFlag) {
SetCheck(TRUE);
return TRUE;
}
diff --git a/fpdfsdk/pdfwindow/PWL_Utils.cpp b/fpdfsdk/pdfwindow/PWL_Utils.cpp
index 23bddcdf1e..9ad12abfe6 100644
--- a/fpdfsdk/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Utils.cpp
@@ -417,7 +417,7 @@ CFX_ByteString CPWL_Utils::GetEditAppStream(IFX_Edit* pEdit,
const CFX_FloatPoint& ptOffset,
const CPVT_WordRange* pRange,
FX_BOOL bContinuous,
- FX_WORD SubWord) {
+ uint16_t SubWord) {
return IFX_Edit::GetEditAppearanceStream(pEdit, ptOffset, pRange, bContinuous,
SubWord);
}
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
index 597db35ec7..cb5311f59b 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
@@ -407,7 +407,7 @@ void CPWL_Wnd::InvalidateRect(CFX_FloatRect* pRect) {
}
#define PWL_IMPLEMENT_KEY_METHOD(key_method_name) \
- FX_BOOL CPWL_Wnd::key_method_name(FX_WORD nChar, FX_DWORD nFlag) { \
+ FX_BOOL CPWL_Wnd::key_method_name(uint16_t nChar, FX_DWORD nFlag) { \
if (IsValid() && IsVisible() && IsEnabled()) { \
if (IsWndCaptureKeyboard(this)) { \
for (int32_t i = 0, sz = m_aChildren.GetSize(); i < sz; i++) { \