From bfa9a824a20f37c2dd7111012b46c929cf2ed8a0 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 9 Jun 2015 13:24:12 -0700 Subject: Merge to XFA: Use stdint.h types throughout PDFium. Near-automatic merge, plus re-running scripts to update additional usage. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1172793002 --- fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp | 16 ++-- fpdfsdk/src/formfiller/FFL_CheckBox.cpp | 2 +- fpdfsdk/src/formfiller/FFL_ComboBox.cpp | 8 +- fpdfsdk/src/formfiller/FFL_FormFiller.cpp | 6 +- fpdfsdk/src/formfiller/FFL_IFormFiller.cpp | 6 +- fpdfsdk/src/formfiller/FFL_ListBox.cpp | 16 ++-- fpdfsdk/src/formfiller/FFL_Notify.cpp | 2 +- fpdfsdk/src/formfiller/FFL_RadioButton.cpp | 2 +- fpdfsdk/src/formfiller/FFL_TextField.cpp | 2 +- fpdfsdk/src/formfiller/FFL_Utils.cpp | 2 +- fpdfsdk/src/fpdfppo.cpp | 2 +- fpdfsdk/src/fpdfview.cpp | 8 +- fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp | 10 +-- fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp | 10 +-- fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp | 10 +-- fpdfsdk/src/fsdk_actionhandler.cpp | 12 +-- fpdfsdk/src/fsdk_baseannot.cpp | 56 ++++++------- fpdfsdk/src/fsdk_baseform.cpp | 52 ++++++------ fpdfsdk/src/fsdk_mgr.cpp | 38 ++++----- fpdfsdk/src/fxedit/fxet_ap.cpp | 8 +- fpdfsdk/src/fxedit/fxet_edit.cpp | 108 ++++++++++++------------- fpdfsdk/src/fxedit/fxet_list.cpp | 122 ++++++++++++++--------------- fpdfsdk/src/fxedit/fxet_pageobjs.cpp | 36 ++++----- fpdfsdk/src/javascript/Document.cpp | 2 +- fpdfsdk/src/javascript/Field.cpp | 56 ++++++------- fpdfsdk/src/javascript/JS_GlobalData.cpp | 12 +-- fpdfsdk/src/javascript/util.cpp | 4 +- fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp | 12 +-- fpdfsdk/src/pdfwindow/PWL_Edit.cpp | 48 ++++++------ fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp | 30 +++---- fpdfsdk/src/pdfwindow/PWL_FontMap.cpp | 64 +++++++-------- fpdfsdk/src/pdfwindow/PWL_Icon.cpp | 4 +- fpdfsdk/src/pdfwindow/PWL_IconList.cpp | 64 +++++++-------- fpdfsdk/src/pdfwindow/PWL_Label.cpp | 6 +- fpdfsdk/src/pdfwindow/PWL_ListBox.cpp | 32 ++++---- fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp | 22 +++--- fpdfsdk/src/pdfwindow/PWL_Note.cpp | 72 ++++++++--------- fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp | 14 ++-- fpdfsdk/src/pdfwindow/PWL_Signature.cpp | 4 +- fpdfsdk/src/pdfwindow/PWL_Utils.cpp | 86 ++++++++++---------- fpdfsdk/src/pdfwindow/PWL_Wnd.cpp | 72 ++++++++--------- 41 files changed, 569 insertions(+), 569 deletions(-) (limited to 'fpdfsdk/src') diff --git a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp index 9f04861e44..d73fbf45b0 100644 --- a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp +++ b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp @@ -45,7 +45,7 @@ void CBA_FontMap::Reset() void CBA_FontMap::Initial(FX_LPCSTR fontname) { - FX_INT32 nCharset = DEFAULT_CHARSET; + int32_t nCharset = DEFAULT_CHARSET; if (!m_pDefaultFont) { @@ -83,13 +83,13 @@ void CBA_FontMap::SetDefaultFont(CPDF_Font * pFont, const CFX_ByteString & sFont // if (m_sDefaultFontName.IsEmpty()) // m_sDefaultFontName = pFont->GetFontTypeName(); - FX_INT32 nCharset = DEFAULT_CHARSET; + int32_t nCharset = DEFAULT_CHARSET; if (const CFX_SubstFont* pSubstFont = m_pDefaultFont->GetSubstFont()) nCharset = pSubstFont->m_Charset; AddFontData(m_pDefaultFont, m_sDefaultFontName, nCharset); } -CPDF_Font* CBA_FontMap::FindFontSameCharset(CFX_ByteString& sFontAlias, FX_INT32 nCharset) +CPDF_Font* CBA_FontMap::FindFontSameCharset(CFX_ByteString& sFontAlias, int32_t nCharset) { ASSERT(m_pAnnotDict != NULL); @@ -119,7 +119,7 @@ CPDF_Document* CBA_FontMap::GetDocument() } CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict, CFX_ByteString& sFontAlias, - FX_INT32 nCharset) + int32_t nCharset) { if (!pResDict) return NULL; @@ -186,8 +186,8 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAl CPDF_Stream* pStream = pAPDict->GetStream(m_sAPType); if (pStream == NULL) { - pStream = FX_NEW CPDF_Stream(NULL, 0, NULL); - FX_INT32 objnum = m_pDocument->AddIndirectObject(pStream); + pStream = new CPDF_Stream(NULL, 0, NULL); + int32_t objnum = m_pDocument->AddIndirectObject(pStream); pAPDict->SetAtReference(m_sAPType, m_pDocument, objnum); } @@ -213,8 +213,8 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAl CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDict("Font"); if (!pStreamResFontList) { - pStreamResFontList = FX_NEW CPDF_Dictionary; - FX_INT32 objnum = m_pDocument->AddIndirectObject(pStreamResFontList); + pStreamResFontList = new CPDF_Dictionary; + int32_t objnum = m_pDocument->AddIndirectObject(pStreamResFontList); pStreamResList->SetAtReference("Font", m_pDocument, objnum); } if (!pStreamResFontList->KeyExist(sAlias)) diff --git a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp index f8035c7ec9..dad485cac3 100644 --- a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp +++ b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp @@ -124,7 +124,7 @@ void CFFL_CheckBox::SaveData(CPDFSDK_PageView* pPageView) CPDF_FormField* pField = m_pWidget->GetFormField(); ASSERT(pField != NULL); - for (FX_INT32 i=0,sz=pField->CountControls(); iCountControls(); iGetControl(i)) { diff --git a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp index a86c2520b3..123c1cd24a 100644 --- a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp +++ b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp @@ -80,14 +80,14 @@ CPWL_Wnd* CFFL_ComboBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageVie CFFL_IFormFiller* pFormFiller = m_pApp->GetIFormFiller(); pWnd->SetFillerNotify(pFormFiller); - FX_INT32 nCurSel = m_pWidget->GetSelectedIndex(0); + int32_t nCurSel = m_pWidget->GetSelectedIndex(0); CFX_WideString swText; if (nCurSel < 0) swText = m_pWidget->GetValue(); else swText = m_pWidget->GetOptionLabel(nCurSel); - for (FX_INT32 i=0,sz=m_pWidget->CountOptions(); iCountOptions(); iAddString(m_pWidget->GetOptionLabel(i).c_str()); } @@ -107,7 +107,7 @@ FX_BOOL CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView) { if (CPWL_ComboBox * pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) { - FX_INT32 nCurSel = pWnd->GetSelect(); + int32_t nCurSel = pWnd->GetSelect(); ASSERT(m_pWidget != NULL); @@ -138,7 +138,7 @@ void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView) if (CPWL_ComboBox* pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) { CFX_WideString swText = pWnd->GetText(); - FX_INT32 nCurSel = pWnd->GetSelect(); + int32_t nCurSel = pWnd->GetSelect(); //mantis:0004157 FX_BOOL bSetValue = TRUE; diff --git a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp index c9dd6681d2..9fdcbbdc4a 100644 --- a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp +++ b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp @@ -9,9 +9,9 @@ #include "../../include/formfiller/FFL_Notify.h" #include "../../include/formfiller/FFL_CBA_Fontmap.h" -#define GetRed(rgb) ((FX_BYTE)(rgb)) -#define GetGreen(rgb) ((FX_BYTE)(((FX_WORD)(rgb)) >> 8)) -#define GetBlue(rgb) ((FX_BYTE)((rgb)>>16)) +#define GetRed(rgb) ((uint8_t)(rgb)) +#define GetGreen(rgb) ((uint8_t)(((FX_WORD)(rgb)) >> 8)) +#define GetBlue(rgb) ((uint8_t)((rgb)>>16)) #define FFL_HINT_ELAPSE 800 diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp index 42af6be574..6f96d33da8 100644 --- a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp +++ b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp @@ -722,7 +722,7 @@ void CFFL_IFormFiller::SetFocusAnnotTab(CPDFSDK_Annot* pWidget, FX_BOOL bSameFie } -void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, FX_INT32 & nRet, FX_FLOAT & fPopupRet) +void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, int32_t & nRet, FX_FLOAT & fPopupRet) { ASSERT(pPrivateData != NULL); @@ -837,7 +837,7 @@ void CFFL_IFormFiller::OnSetWindowRect(void* pPrivateData, const CPDF_Rect & rcW } } -void CFFL_IFormFiller::OnKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode, CFX_WideString& strChange, +void CFFL_IFormFiller::OnKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, int32_t nKeyCode, CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit) { @@ -1284,7 +1284,7 @@ void CFFL_IFormFiller::DoPaste(CPDFSDK_Document* pDocument) { } -void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode, +void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, int32_t nKeyCode, CFX_WideString & strChange, const CFX_WideString& strChangeEx, int nSelStart, int nSelEnd, FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag) diff --git a/fpdfsdk/src/formfiller/FFL_ListBox.cpp b/fpdfsdk/src/formfiller/FFL_ListBox.cpp index dffd17538f..6b0aa1b347 100644 --- a/fpdfsdk/src/formfiller/FFL_ListBox.cpp +++ b/fpdfsdk/src/formfiller/FFL_ListBox.cpp @@ -76,7 +76,7 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller(); pWnd->SetFillerNotify(pIFormFiller); - for (FX_INT32 i=0,sz=m_pWidget->CountOptions(); iCountOptions(); iAddString(m_pWidget->GetOptionLabel(i).c_str()); if (pWnd->HasFlag(PLBS_MULTIPLESEL)) @@ -84,7 +84,7 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView m_OriginSelections.RemoveAll(); FX_BOOL bSetCaret = FALSE; - for (FX_INT32 i=0,sz=m_pWidget->CountOptions(); iCountOptions(); iIsOptionSelected(i)) { @@ -130,7 +130,7 @@ FX_BOOL CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView) if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) { int nSelCount = 0; - for (FX_INT32 i=0,sz=pListBox->GetCount(); iGetCount(); iIsItemSelected(i)) { @@ -172,13 +172,13 @@ void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView) } - FX_INT32 nNewTopIndex = pListBox->GetTopVisibleIndex(); + int32_t nNewTopIndex = pListBox->GetTopVisibleIndex(); m_pWidget->ClearSelection(FALSE); if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) { - for (FX_INT32 i=0,sz=pListBox->GetCount(); iGetCount(); iIsItemSelected(i)) { @@ -215,7 +215,7 @@ void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AAct if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE)) { ASSERT(m_pWidget != NULL); - FX_INT32 nCurSel = pListBox->GetCurSel(); + int32_t nCurSel = pListBox->GetCurSel(); if (nCurSel >= 0) fa.sValue = m_pWidget->GetOptionLabel(nCurSel); } @@ -230,7 +230,7 @@ void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AAct else { ASSERT(m_pWidget != NULL); - FX_INT32 nCurSel = m_pWidget->GetSelectedIndex(0); + int32_t nCurSel = m_pWidget->GetSelectedIndex(0); if (nCurSel >= 0) fa.sValue = m_pWidget->GetOptionLabel(nCurSel); } @@ -252,7 +252,7 @@ void CFFL_ListBox::SaveState(CPDFSDK_PageView* pPageView) if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE)) { - for (FX_INT32 i=0,sz=pListBox->GetCount(); iGetCount(); iIsItemSelected(i)) { diff --git a/fpdfsdk/src/formfiller/FFL_Notify.cpp b/fpdfsdk/src/formfiller/FFL_Notify.cpp index 73ab5dbb85..406aa8d489 100644 --- a/fpdfsdk/src/formfiller/FFL_Notify.cpp +++ b/fpdfsdk/src/formfiller/FFL_Notify.cpp @@ -127,7 +127,7 @@ FX_BOOL CFFL_Notify::ExecuteActionTree(CPDF_AAction::AActionType eAAT,CPDF_Actio if (!ExecuteAction(eAAT,action,bExit)) return FALSE; if (bExit) return TRUE; - for (FX_INT32 i=0,sz=action.GetSubActionsCount(); iGetFormField(); ASSERT(pField != NULL); - for (FX_INT32 i=0,sz=pField->CountControls(); iCountControls(); iGetControl(i)) { diff --git a/fpdfsdk/src/formfiller/FFL_TextField.cpp b/fpdfsdk/src/formfiller/FFL_TextField.cpp index 46f738dc73..fb7fec9ea7 100644 --- a/fpdfsdk/src/formfiller/FFL_TextField.cpp +++ b/fpdfsdk/src/formfiller/FFL_TextField.cpp @@ -114,7 +114,7 @@ CPWL_Wnd* CFFL_TextField::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageVi pWnd->SetFillerNotify(pIFormFiller); ASSERT(m_pWidget != NULL); - FX_INT32 nMaxLen = m_pWidget->GetMaxLen(); + int32_t nMaxLen = m_pWidget->GetMaxLen(); CFX_WideString swValue = m_pWidget->GetValue(); if (nMaxLen > 0) diff --git a/fpdfsdk/src/formfiller/FFL_Utils.cpp b/fpdfsdk/src/formfiller/FFL_Utils.cpp index 196102bfb4..2f988b2f0b 100644 --- a/fpdfsdk/src/formfiller/FFL_Utils.cpp +++ b/fpdfsdk/src/formfiller/FFL_Utils.cpp @@ -93,7 +93,7 @@ FX_BOOL CFFL_Utils::TraceObject(CPDF_Object* pObj) case PDFOBJ_BOOLEAN: break; case PDFOBJ_NUMBER: - //TRACE("%d\n",(FX_INT32)pObj); + //TRACE("%d\n",(int32_t)pObj); break; case PDFOBJ_STRING: //TRACE(((CPDF_String*)pObj)->GetString() + "\n"); diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp index 21cf647dd6..5c66e4bb69 100644 --- a/fpdfsdk/src/fpdfppo.cpp +++ b/fpdfsdk/src/fpdfppo.cpp @@ -179,7 +179,7 @@ FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* FX_DWORD dwOldPageObj = pSrcPageDict->GetObjNum(); FX_DWORD dwNewPageObj = pCurPageDict->GetObjNum(); - pMapPtrToPtr->SetAt((FX_LPVOID)(FX_UINTPTR)dwOldPageObj, (FX_LPVOID)(FX_UINTPTR)dwNewPageObj); + pMapPtrToPtr->SetAt((FX_LPVOID)(uintptr_t)dwOldPageObj, (FX_LPVOID)(uintptr_t)dwNewPageObj); this->UpdateReference(pCurPageDict, pDestPDFDoc, pMapPtrToPtr); curpage++; diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp index 7e68740e59..fa6bb2ef53 100644 --- a/fpdfsdk/src/fpdfview.cpp +++ b/fpdfsdk/src/fpdfview.cpp @@ -104,7 +104,7 @@ CPDF_CustomAccess::CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess) m_BufferOffset = (FX_DWORD)-1; } -FX_BOOL CPDF_CustomAccess::GetByte(FX_DWORD pos, FX_BYTE& ch) +FX_BOOL CPDF_CustomAccess::GetByte(FX_DWORD pos, uint8_t& ch) { if (pos >= m_FileAccess.m_FileLen) return FALSE; if (m_BufferOffset == (FX_DWORD)-1 || pos < m_BufferOffset || pos >= m_BufferOffset + 512) { @@ -302,7 +302,7 @@ extern void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code); class CMemFile final : public IFX_FileRead { public: - CMemFile(FX_BYTE* pBuf, FX_FILESIZE size):m_pBuf(pBuf),m_size(size) {} + CMemFile(uint8_t* pBuf, FX_FILESIZE size):m_pBuf(pBuf),m_size(size) {} virtual void Release() {delete this;} virtual FX_FILESIZE GetSize() {return m_size;} @@ -320,14 +320,14 @@ public: return TRUE; } private: - FX_BYTE* m_pBuf; + uint8_t* m_pBuf; FX_FILESIZE m_size; }; DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf, int size, FPDF_BYTESTRING password) { CPDF_Parser* pParser = FX_NEW CPDF_Parser; pParser->SetPassword(password); - CMemFile* pMemFile = FX_NEW CMemFile((FX_BYTE*)data_buf, size); + CMemFile* pMemFile = new CMemFile((uint8_t*)data_buf, size); FX_DWORD err_code = pParser->StartParse(pMemFile); if (err_code) { delete pParser; diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp index 2c096c7145..cf5db2b3c3 100644 --- a/fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp +++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp @@ -178,7 +178,7 @@ void CPDFXFA_App::Beep(FX_DWORD dwType) } } -FX_INT32 CPDFXFA_App::MsgBox(FX_WSTR wsMessage, FX_WSTR wsTitle, FX_DWORD dwIconType, FX_DWORD dwButtonType) +int32_t CPDFXFA_App::MsgBox(FX_WSTR wsMessage, FX_WSTR wsTitle, FX_DWORD dwIconType, FX_DWORD dwButtonType) { CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); if (!pEnv) @@ -216,7 +216,7 @@ FX_INT32 CPDFXFA_App::MsgBox(FX_WSTR wsMessage, FX_WSTR wsTitle, FX_DWORD dwIcon iButtonType |= 3; break; } - FX_INT32 iRet = pEnv->JS_appAlert(wsMessage.GetPtr(), wsTitle.GetPtr(), iButtonType, iconType); + int32_t iRet = pEnv->JS_appAlert(wsMessage.GetPtr(), wsTitle.GetPtr(), iButtonType, iconType); switch (iRet) { case 1: @@ -250,7 +250,7 @@ void CPDFXFA_App::Response(CFX_WideString &wsAnswer, FX_WSTR wsQuestion, FX_WSTR } } -FX_INT32 CPDFXFA_App::GetCurDocumentInBatch() +int32_t CPDFXFA_App::GetCurDocumentInBatch() { CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); if (pEnv) @@ -260,7 +260,7 @@ FX_INT32 CPDFXFA_App::GetCurDocumentInBatch() return 0; } -FX_INT32 CPDFXFA_App::GetDocumentCountInBatch() +int32_t CPDFXFA_App::GetDocumentCountInBatch() { CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); if (pEnv) @@ -303,7 +303,7 @@ FX_BOOL CPDFXFA_App::PutRequestURL(FX_WSTR wsURL, FX_WSTR wsData, FX_WSTR wsEnco return FALSE; } -void CPDFXFA_App::LoadString(FX_INT32 iStringID, CFX_WideString &wsString) +void CPDFXFA_App::LoadString(int32_t iStringID, CFX_WideString &wsString) { switch (iStringID) { diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp index e64bde1a2a..106e3cbc12 100644 --- a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp +++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp @@ -633,7 +633,7 @@ void CPDFXFA_Document::WidgetEvent(IXFA_Widget* hWidget, CXFA_WidgetAcc* pWidget } } -FX_INT32 CPDFXFA_Document::CountPages(IXFA_Doc* hDoc) +int32_t CPDFXFA_Document::CountPages(IXFA_Doc* hDoc) { if (hDoc == m_pXFADoc && m_pSDKDoc) { @@ -641,7 +641,7 @@ FX_INT32 CPDFXFA_Document::CountPages(IXFA_Doc* hDoc) } return 0; } -FX_INT32 CPDFXFA_Document::GetCurrentPage(IXFA_Doc* hDoc) +int32_t CPDFXFA_Document::GetCurrentPage(IXFA_Doc* hDoc) { if (hDoc != m_pXFADoc || !m_pSDKDoc) return -1; @@ -655,7 +655,7 @@ FX_INT32 CPDFXFA_Document::GetCurrentPage(IXFA_Doc* hDoc) return pEnv->FFI_GetCurrentPageIndex(this); } -void CPDFXFA_Document::SetCurrentPage(IXFA_Doc* hDoc, FX_INT32 iCurPage) +void CPDFXFA_Document::SetCurrentPage(IXFA_Doc* hDoc, int32_t iCurPage) { if (hDoc != m_pXFADoc || !m_pSDKDoc) return; @@ -896,7 +896,7 @@ void CPDFXFA_Document::SetFocusWidget(IXFA_Doc* hDoc, IXFA_Widget* hWidget) } } } -void CPDFXFA_Document::Print(IXFA_Doc* hDoc, FX_INT32 nStartPage, FX_INT32 nEndPage, FX_DWORD dwOptions) +void CPDFXFA_Document::Print(IXFA_Doc* hDoc, int32_t nStartPage, int32_t nEndPage, FX_DWORD dwOptions) { if (hDoc != m_pXFADoc) return; @@ -935,7 +935,7 @@ FX_ARGB CPDFXFA_Document::GetHighlightColor(IXFA_Doc* hDoc) if(CPDFSDK_InterForm* pInterForm = m_pSDKDoc->GetInterForm()) { FX_COLORREF color = pInterForm->GetHighlightColor(FPDF_FORMFIELD_XFA); - FX_BYTE alpha = pInterForm->GetHighlightAlpha(); + uint8_t alpha = pInterForm->GetHighlightAlpha(); FX_ARGB argb = ArgbEncode((int)alpha, color); return argb; } diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp index fb625d2738..ac5ef21f58 100644 --- a/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp +++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp @@ -14,7 +14,7 @@ FWL_ERR CXFA_FWLAdapterTimerMgr::Start(IFWL_Timer *pTimer, FX_DWORD dwElapse, FW { if (m_pEnv) { - FX_UINT32 uIDEvent = m_pEnv->FFI_SetTimer(dwElapse, TimerProc); + uint32_t uIDEvent = m_pEnv->FFI_SetTimer(dwElapse, TimerProc); CFWL_TimerInfo *pInfo = FX_NEW CFWL_TimerInfo; pInfo->uIDEvent = uIDEvent; pInfo->pTimer = pTimer; @@ -37,7 +37,7 @@ FWL_ERR CXFA_FWLAdapterTimerMgr::Stop(FWL_HTIMER hTimer) m_pEnv->FFI_KillTimer(pInfo->uIDEvent); - FX_INT32 index = ms_timerArray.Find(pInfo); + int32_t index = ms_timerArray.Find(pInfo); if (index >= 0) { ms_timerArray.RemoveAt(index); @@ -49,11 +49,11 @@ FWL_ERR CXFA_FWLAdapterTimerMgr::Stop(FWL_HTIMER hTimer) return FWL_ERR_Indefinite; } -void CXFA_FWLAdapterTimerMgr::TimerProc(FX_INT32 idEvent) +void CXFA_FWLAdapterTimerMgr::TimerProc(int32_t idEvent) { CFWL_TimerInfo *pInfo = NULL; - FX_INT32 iCount = CXFA_FWLAdapterTimerMgr::ms_timerArray.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) + int32_t iCount = CXFA_FWLAdapterTimerMgr::ms_timerArray.GetSize(); + for (int32_t i = 0; i < iCount; i++) { CFWL_TimerInfo *pTemp = (CFWL_TimerInfo*)CXFA_FWLAdapterTimerMgr::ms_timerArray.GetAt(i); if (pTemp->uIDEvent == idEvent) diff --git a/fpdfsdk/src/fsdk_actionhandler.cpp b/fpdfsdk/src/fsdk_actionhandler.cpp index 6f8ea0c60f..25f39ff8c7 100644 --- a/fpdfsdk/src/fsdk_actionhandler.cpp +++ b/fpdfsdk/src/fsdk_actionhandler.cpp @@ -159,7 +159,7 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentOpenAction(const CPDF_Action& acti DoAction_NoJs(action, pDocument); } - for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i= 0 ? 60 : -60); } -FX_BOOL _gAfxIsLeapYear(FX_SHORT year) +FX_BOOL _gAfxIsLeapYear(int16_t year) { return ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0))); } -FX_WORD _gAfxGetYearDays(FX_SHORT year) +FX_WORD _gAfxGetYearDays(int16_t year) { return (_gAfxIsLeapYear(year) == TRUE ? 366 : 365); } -FX_BYTE _gAfxGetMonthDays(FX_SHORT year, FX_BYTE month) +uint8_t _gAfxGetMonthDays(int16_t year, uint8_t month) { - FX_BYTE mDays; + uint8_t mDays; switch (month) { case 1: @@ -118,12 +118,12 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::operator = (const FX_SYSTEMTIME& st) { tzset(); - dt.year = (FX_SHORT)st.wYear; - dt.month = (FX_BYTE)st.wMonth; - dt.day = (FX_BYTE)st.wDay; - dt.hour = (FX_BYTE)st.wHour; - dt.minute = (FX_BYTE)st.wMinute; - dt.second = (FX_BYTE)st.wSecond; + dt.year = (int16_t)st.wYear; + dt.month = (uint8_t)st.wMonth; + dt.day = (uint8_t)st.wDay; + dt.hour = (uint8_t)st.wHour; + dt.minute = (uint8_t)st.wMinute; + dt.second = (uint8_t)st.wSecond; // dt.tzHour = _timezone / 3600 * -1; // dt.tzMinute = (abs(_timezone) % 3600) / 60; return *this; @@ -235,7 +235,7 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString(const CFX_ByteString& if (ch < '0' || ch > '9') break; i ++; } - dt.year = (FX_SHORT)k; + dt.year = (int16_t)k; if (i >= strLength || j < 4) return *this; j = 0; @@ -248,7 +248,7 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString(const CFX_ByteString& if (ch < '0' || ch > '9') break; i ++; } - dt.month = (FX_BYTE)k; + dt.month = (uint8_t)k; if (i >= strLength || j < 2) return *this; j = 0; @@ -261,7 +261,7 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString(const CFX_ByteString& if (ch < '0' || ch > '9') break; i ++; } - dt.day = (FX_BYTE)k; + dt.day = (uint8_t)k; if (i >= strLength || j < 2) return *this; j = 0; @@ -274,7 +274,7 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString(const CFX_ByteString& if (ch < '0' || ch > '9') break; i ++; } - dt.hour = (FX_BYTE)k; + dt.hour = (uint8_t)k; if (i >= strLength || j < 2) return *this; j = 0; @@ -287,7 +287,7 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString(const CFX_ByteString& if (ch < '0' || ch > '9') break; i ++; } - dt.minute = (FX_BYTE)k; + dt.minute = (uint8_t)k; if (i >= strLength || j < 2) return *this; j = 0; @@ -300,7 +300,7 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString(const CFX_ByteString& if (ch < '0' || ch > '9') break; i ++; } - dt.second = (FX_BYTE)k; + dt.second = (uint8_t)k; if (i >= strLength || j < 2) return *this; ch = dtStr[i ++]; @@ -334,7 +334,7 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString(const CFX_ByteString& if (ch < '0' || ch > '9') break; i ++; } - dt.tzMinute = (FX_BYTE)k; + dt.tzMinute = (uint8_t)k; if (i >= strLength || j < 2) return *this; } @@ -402,9 +402,9 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::AddDays(short days) { if (days == 0) return *this; - FX_SHORT y = dt.year, yy; - FX_BYTE m = dt.month; - FX_BYTE d = dt.day; + int16_t y = dt.year, yy; + uint8_t m = dt.month; + uint8_t d = dt.day; int mdays, ydays, ldays; ldays = days; @@ -490,11 +490,11 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::AddSeconds(int seconds) days = n / 86400; n %= 86400; } - dt.hour = (FX_BYTE)(n / 3600); + dt.hour = (uint8_t)(n / 3600); dt.hour %= 24; n %= 3600; - dt.minute = (FX_BYTE)(n / 60); - dt.second = (FX_BYTE)(n % 60); + dt.minute = (uint8_t)(n / 60); + dt.second = (uint8_t)(n % 60); if (days != 0) AddDays(days); return *this; @@ -962,14 +962,14 @@ void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_ ASSERT(m_pPageView != NULL); CPDF_Document* pDoc = m_pPageView->GetPDFDocument(); ASSERT(pDoc != NULL); - + pStream = FX_NEW CPDF_Stream(NULL, 0, NULL); - FX_INT32 objnum = pDoc->AddIndirectObject(pStream); + int32_t objnum = pDoc->AddIndirectObject(pStream); //pAPDict->SetAtReference(sAPType, pDoc, objnum); ASSERT(pParentDict != NULL); pParentDict->SetAtReference(sAPType, pDoc, objnum); } - + CPDF_Dictionary * pStreamDict = pStream->GetDict(); if (!pStreamDict) @@ -987,7 +987,7 @@ void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_ pStreamDict->SetAtRect("BBox", rcBBox); } - pStream->SetData((FX_BYTE*)sContents.c_str(), sContents.GetLength(), FALSE, FALSE); + pStream->SetData((uint8_t*)sContents.c_str(), sContents.GetLength(), FALSE, FALSE); } #define BA_ANNOT_MINWIDTH 1 diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp index efdcfc0c85..5f9df4852b 100644 --- a/fpdfsdk/src/fsdk_baseform.cpp +++ b/fpdfsdk/src/fsdk_baseform.cpp @@ -284,7 +284,7 @@ FX_BOOL CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, PDFSDK_Field { CXFA_WidgetAcc* pAcc = pXFAWidgetHandler->GetDataAcc(hWidget); param.m_pTarget = pAcc; - FX_INT32 nRet = pXFAWidgetHandler->ProcessEvent(pAcc, ¶m); + int32_t nRet = pXFAWidgetHandler->ProcessEvent(pAcc, ¶m); return nRet == XFA_EVENTERROR_Sucess; } } @@ -292,7 +292,7 @@ FX_BOOL CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, PDFSDK_Field { CXFA_WidgetAcc* pAcc = pXFAWidgetHandler->GetDataAcc(hWidget); param.m_pTarget = pAcc; - FX_INT32 nRet = pXFAWidgetHandler->ProcessEvent(pAcc, ¶m); + int32_t nRet = pXFAWidgetHandler->ProcessEvent(pAcc, ¶m); return nRet == XFA_EVENTERROR_Sucess; } @@ -1093,7 +1093,7 @@ void CPDFSDK_Widget::DrawShadow(CFX_RenderDevice* pDevice, CPDFSDK_PageView* pPa // { CPDF_Rect rc = GetRect(); FX_COLORREF color = m_pInterForm->GetHighlightColor(nFieldType); - FX_BYTE alpha = m_pInterForm->GetHighlightAlpha(); + uint8_t alpha = m_pInterForm->GetHighlightAlpha(); CFX_FloatRect rcDevice; ASSERT(m_pInterForm->GetDocument()); @@ -1125,7 +1125,7 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() CPDF_Rect rcWindow = GetRotatedRect(); - FX_INT32 nLayout = 0; + int32_t nLayout = 0; switch (pControl->GetTextPosition()) { @@ -1166,7 +1166,7 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth(); - FX_INT32 nBorderStyle = 0; + int32_t nBorderStyle = 0; CPWL_Dash dsBorder(3,0,0); CPWL_Color crLeftTop,crRightBottom; @@ -1372,7 +1372,7 @@ void CPDFSDK_Widget::ResetAppearance_CheckBox() crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth(); - FX_INT32 nBorderStyle = 0; + int32_t nBorderStyle = 0; CPWL_Dash dsBorder(3,0,0); CPWL_Color crLeftTop,crRightBottom; @@ -1412,7 +1412,7 @@ void CPDFSDK_Widget::ResetAppearance_CheckBox() crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); } - FX_INT32 nStyle = 0; + int32_t nStyle = 0; CFX_WideString csWCaption = pControl->GetNormalCaption(); if (csWCaption.GetLength() > 0) @@ -1504,7 +1504,7 @@ void CPDFSDK_Widget::ResetAppearance_RadioButton() crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth(); - FX_INT32 nBorderStyle = 0; + int32_t nBorderStyle = 0; CPWL_Dash dsBorder(3,0,0); CPWL_Color crLeftTop,crRightBottom; @@ -1544,7 +1544,7 @@ void CPDFSDK_Widget::ResetAppearance_RadioButton() crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); } - FX_INT32 nStyle = 0; + int32_t nStyle = 0; CFX_WideString csWCaption = pControl->GetNormalCaption(); if (csWCaption.GetLength() > 0) @@ -1706,7 +1706,7 @@ void CPDFSDK_Widget::ResetAppearance_ComboBox(FX_LPCWSTR sValue) pEdit->SetText(sValue); else { - FX_INT32 nCurSel = pField->GetSelectedIndex(0); + int32_t nCurSel = pField->GetSelectedIndex(0); if (nCurSel < 0) pEdit->SetText(pField->GetValue().c_str()); @@ -1780,14 +1780,14 @@ void CPDFSDK_Widget::ResetAppearance_ListBox() CFX_ByteTextBuf sList; FX_FLOAT fy = rcClient.top; - FX_INT32 nTop = pField->GetTopVisibleIndex(); - FX_INT32 nCount = pField->CountOptions(); - FX_INT32 nSelCount = pField->CountSelectedItems(); + int32_t nTop = pField->GetTopVisibleIndex(); + int32_t nCount = pField->CountOptions(); + int32_t nSelCount = pField->CountSelectedItems(); - for (FX_INT32 i=nTop; iGetSelectedIndex(j) == i) { @@ -1954,7 +1954,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(FX_LPCWSTR sValue) sLines << "q\n" << GetBorderWidth() << " w\n" << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE) << " 2 J 0 j\n"; - for (FX_INT32 i=1;iGetDefaultAppearance(); if (da.HasColor()) { - FX_INT32 iColorType; + int32_t iColorType; FX_FLOAT fc[4]; da.GetColor(iColorType, fc); crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); @@ -2150,7 +2150,7 @@ CPWL_Color CPDFSDK_Widget::GetBorderPWLColor() const CPDF_FormControl* pFormCtrl = GetFormControl(); ASSERT(pFormCtrl != NULL); - FX_INT32 iColorType; + int32_t iColorType; FX_FLOAT fc[4]; pFormCtrl->GetOriginalBorderColor(iColorType, fc); if (iColorType > 0) @@ -2166,7 +2166,7 @@ CPWL_Color CPDFSDK_Widget::GetFillPWLColor() const CPDF_FormControl* pFormCtrl = GetFormControl(); ASSERT(pFormCtrl != NULL); - FX_INT32 iColorType; + int32_t iColorType; FX_FLOAT fc[4]; pFormCtrl->GetOriginalBackgroundColor(iColorType, fc); if (iColorType > 0) @@ -2261,7 +2261,7 @@ FX_BOOL CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAc CXFA_WidgetAcc* pAcc = pXFAWidgetHandler->GetDataAcc(hWidget); param.m_pTarget = pAcc; - FX_INT32 nRet = pXFAWidgetHandler->ProcessEvent(pAcc, ¶m); + int32_t nRet = pXFAWidgetHandler->ProcessEvent(pAcc, ¶m); if (IXFA_DocView* pDocView = pDoc->GetXFADocView()) { @@ -2329,12 +2329,12 @@ CFX_WideString CPDFSDK_Widget::GetAlternateName() const return pFormField->GetAlternateName(); } -FX_INT32 CPDFSDK_Widget::GetAppearanceAge() const +int32_t CPDFSDK_Widget::GetAppearanceAge() const { return m_nAppAge; } -FX_INT32 CPDFSDK_Widget::GetValueAge() const +int32_t CPDFSDK_Widget::GetValueAge() const { return m_nValueAge; } @@ -2666,7 +2666,7 @@ CPDF_Stream* CPDFSDK_InterForm::LoadImageFromFile(const CFX_WideString& sFile) pRetStream = new CPDF_Stream(NULL, 0, NULL); CFX_ByteString csStream; csStream.Format("q\n%d 0 0 %d 0 0 cm\n/Img Do\nQ", nWidth, nHeight); - pRetStream->InitStream((FX_BYTE*)csStream.c_str(), csStream.GetLength(), pStreamDict); + pRetStream->InitStream((uint8_t*)csStream.c_str(), csStream.GetLength(), pStreamDict); pDocument->AddIndirectObject(pRetStream); } @@ -3113,7 +3113,7 @@ FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(FX_LPBYTE& pBuf, FX_STRSIZE& nBuf } nBufSize = fdfEncodedData.GetLength(); - pBuf = FX_Alloc(FX_BYTE, nBufSize); + pBuf = FX_Alloc(uint8_t, nBufSize); FXSYS_memcpy(pBuf, fdfEncodedData.GetBuffer(), nBufSize); } return TRUE; diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp index b0b398d563..dc454ee160 100644 --- a/fpdfsdk/src/fsdk_mgr.cpp +++ b/fpdfsdk/src/fsdk_mgr.cpp @@ -34,8 +34,8 @@ public: virtual CFX_WideString GetClipboardText(FX_HWND hWnd){return L"";} virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) {return FALSE;} - virtual void ClientToScreen(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) {} - virtual void ScreenToClient(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) {} + virtual void ClientToScreen(FX_HWND hWnd, int32_t& x, int32_t& y) {} + virtual void ScreenToClient(FX_HWND hWnd, int32_t& x, int32_t& y) {} /*cursor style FXCT_ARROW @@ -45,20 +45,20 @@ public: FXCT_HBEAM FXCT_HAND */ - virtual void SetCursor(FX_INT32 nCursorType); + virtual void SetCursor(int32_t nCursorType); virtual FX_HMENU CreatePopupMenu() {return NULL;} - virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu, FX_INT32 nIDNewItem, CFX_WideString string) {return FALSE;} - virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu, FX_INT32 nIDItem, FX_BOOL bEnabled) {return FALSE;} - virtual FX_INT32 TrackPopupMenu(FX_HMENU hMenu, FX_INT32 x, FX_INT32 y, FX_HWND hParent) {return -1;} + virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu, int32_t nIDNewItem, CFX_WideString string) {return FALSE;} + virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu, int32_t nIDItem, FX_BOOL bEnabled) {return FALSE;} + virtual int32_t TrackPopupMenu(FX_HMENU hMenu, int32_t x, int32_t y, FX_HWND hParent) {return -1;} virtual void DestroyMenu(FX_HMENU hMenu) {} - virtual CFX_ByteString GetNativeTrueTypeFont(FX_INT32 nCharset); - virtual FX_BOOL FindNativeTrueTypeFont(FX_INT32 nCharset, CFX_ByteString sFontFaceName); - virtual CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName, FX_BYTE nCharset); + virtual CFX_ByteString GetNativeTrueTypeFont(int32_t nCharset); + virtual FX_BOOL FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteString sFontFaceName); + virtual CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName, uint8_t nCharset); - virtual FX_INT32 SetTimer(FX_INT32 uElapse, TimerCallback lpTimerFunc) ; - virtual void KillTimer(FX_INT32 nID) ; + virtual int32_t SetTimer(int32_t uElapse, TimerCallback lpTimerFunc) ; + virtual void KillTimer(int32_t nID) ; virtual FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsSHIFTKeyDown(nFlag);} @@ -68,14 +68,14 @@ public: virtual FX_SYSTEMTIME GetLocalTime(); - virtual FX_INT32 GetCharSet() {return m_nCharSet;} - virtual void SetCharSet(FX_INT32 nCharSet) {m_nCharSet = nCharSet;} + virtual int32_t GetCharSet() {return m_nCharSet;} + virtual void SetCharSet(int32_t nCharSet) {m_nCharSet = nCharSet;} private: CPDFDoc_Environment* m_pEnv; int m_nCharSet; }; -void CFX_SystemHandler::SetCursor(FX_INT32 nCursorType) +void CFX_SystemHandler::SetCursor(int32_t nCursorType) { m_pEnv->FFI_SetCursor(nCursorType); @@ -136,12 +136,12 @@ FX_BOOL CFX_SystemHandler::IsSelectionImplemented() return FALSE; } -CFX_ByteString CFX_SystemHandler::GetNativeTrueTypeFont(FX_INT32 nCharset) +CFX_ByteString CFX_SystemHandler::GetNativeTrueTypeFont(int32_t nCharset) { return ""; } -FX_BOOL CFX_SystemHandler::FindNativeTrueTypeFont(FX_INT32 nCharset, CFX_ByteString sFontFaceName) +FX_BOOL CFX_SystemHandler::FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteString sFontFaceName) { CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr(); // FXFT_Face nFace = pFontMgr->FindSubstFont(sFontFaceName,TRUE,0,0,0,0,NULL); @@ -186,7 +186,7 @@ static int CharSet2CP(int charset) return 0; } CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName, - FX_BYTE nCharset) + uint8_t nCharset) { if(pDoc) { @@ -201,11 +201,11 @@ CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CF } -FX_INT32 CFX_SystemHandler::SetTimer(FX_INT32 uElapse, TimerCallback lpTimerFunc) +int32_t CFX_SystemHandler::SetTimer(int32_t uElapse, TimerCallback lpTimerFunc) { return m_pEnv->FFI_SetTimer(uElapse, lpTimerFunc); } -void CFX_SystemHandler::KillTimer(FX_INT32 nID) +void CFX_SystemHandler::KillTimer(int32_t nID) { m_pEnv->FFI_KillTimer(nID); } diff --git a/fpdfsdk/src/fxedit/fxet_ap.cpp b/fpdfsdk/src/fxedit/fxet_ap.cpp index 92e5bfc1dd..10a76a7157 100644 --- a/fpdfsdk/src/fxedit/fxet_ap.cpp +++ b/fpdfsdk/src/fxedit/fxet_ap.cpp @@ -8,7 +8,7 @@ #include "../../include/fxedit/fx_edit.h" #include "../../include/fxedit/fxet_edit.h" -CFX_ByteString GetPDFWordString(IFX_Edit_FontMap * pFontMap, FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord) +CFX_ByteString GetPDFWordString(IFX_Edit_FontMap * pFontMap, int32_t nFontIndex, FX_WORD Word, FX_WORD SubWord) { ASSERT (pFontMap != NULL); @@ -50,7 +50,7 @@ static CFX_ByteString GetWordRenderString(const CFX_ByteString & strWords) return ""; } -static CFX_ByteString GetFontSetString(IFX_Edit_FontMap * pFontMap, FX_INT32 nFontIndex, FX_FLOAT fFontSize) +static CFX_ByteString GetFontSetString(IFX_Edit_FontMap * pFontMap, int32_t nFontIndex, FX_FLOAT fFontSize) { CFX_ByteTextBuf sRet; @@ -71,7 +71,7 @@ CFX_ByteString IFX_Edit::GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Poi CFX_ByteTextBuf sEditStream, sWords; CPDF_Point ptOld(0.0f,0.0f),ptNew(0.0f,0.0f); - FX_INT32 nCurFontIndex = -1; + int32_t nCurFontIndex = -1; if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) { @@ -171,7 +171,7 @@ CFX_ByteString IFX_Edit::GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Poi CFX_ByteTextBuf sAppStream; if (sEditStream.GetSize() > 0) { - FX_INT32 nHorzScale = pEdit->GetHorzScale(); + int32_t nHorzScale = pEdit->GetHorzScale(); if (nHorzScale != 100) { sAppStream << nHorzScale << " Tz\n"; diff --git a/fpdfsdk/src/fxedit/fxet_edit.cpp b/fpdfsdk/src/fxedit/fxet_edit.cpp index 0015c0f4ed..9415cefbe3 100644 --- a/fpdfsdk/src/fxedit/fxet_edit.cpp +++ b/fpdfsdk/src/fxedit/fxet_edit.cpp @@ -105,7 +105,7 @@ FX_BOOL CFX_Edit_Iterator::GetSection(CPVT_Section & section) const return FALSE; } -void CFX_Edit_Iterator::SetAt(FX_INT32 nWordIndex) +void CFX_Edit_Iterator::SetAt(int32_t nWordIndex) { ASSERT(m_pVTIterator != NULL); @@ -147,7 +147,7 @@ IFX_Edit_FontMap* CFX_Edit_Provider::GetFontMap() return m_pFontMap; } -FX_INT32 CFX_Edit_Provider::GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle) +int32_t CFX_Edit_Provider::GetCharWidth(int32_t nFontIndex, FX_WORD word, int32_t nWordStyle) { if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) { @@ -165,7 +165,7 @@ FX_INT32 CFX_Edit_Provider::GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_I return 0; } -FX_INT32 CFX_Edit_Provider::GetTypeAscent(FX_INT32 nFontIndex) +int32_t CFX_Edit_Provider::GetTypeAscent(int32_t nFontIndex) { if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) return pPDFFont->GetTypeAscent(); @@ -173,7 +173,7 @@ FX_INT32 CFX_Edit_Provider::GetTypeAscent(FX_INT32 nFontIndex) return 0; } -FX_INT32 CFX_Edit_Provider::GetTypeDescent(FX_INT32 nFontIndex) +int32_t CFX_Edit_Provider::GetTypeDescent(int32_t nFontIndex) { if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) return pPDFFont->GetTypeDescent(); @@ -181,12 +181,12 @@ FX_INT32 CFX_Edit_Provider::GetTypeDescent(FX_INT32 nFontIndex) return 0; } -FX_INT32 CFX_Edit_Provider::GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex) +int32_t CFX_Edit_Provider::GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex) { return m_pFontMap->GetWordFontIndex(word,charset,nFontIndex); } -FX_INT32 CFX_Edit_Provider::GetDefaultFontIndex() +int32_t CFX_Edit_Provider::GetDefaultFontIndex() { return 0; } @@ -220,26 +220,26 @@ void CFX_Edit_Refresh::Push(const CPVT_WordRange & linerange,const CPDF_Rect & r void CFX_Edit_Refresh::NoAnalyse() { { - for (FX_INT32 i = 0, sz = m_OldLineRects.GetSize(); i < sz; i++) + for (int32_t i = 0, sz = m_OldLineRects.GetSize(); i < sz; i++) if (CFX_Edit_LineRect * pOldRect = m_OldLineRects.GetAt(i)) m_RefreshRects.Add(pOldRect->m_rcLine); } { - for (FX_INT32 i = 0, sz = m_NewLineRects.GetSize(); i < sz; i++) + for (int32_t i = 0, sz = m_NewLineRects.GetSize(); i < sz; i++) if (CFX_Edit_LineRect * pNewRect = m_NewLineRects.GetAt(i)) m_RefreshRects.Add(pNewRect->m_rcLine); } } -void CFX_Edit_Refresh::Analyse(FX_INT32 nAlignment) +void CFX_Edit_Refresh::Analyse(int32_t nAlignment) { FX_BOOL bLineTopChanged = FALSE; CPDF_Rect rcResult; FX_FLOAT fWidthDiff; - FX_INT32 szMax = FX_EDIT_MAX(m_OldLineRects.GetSize(),m_NewLineRects.GetSize()); - FX_INT32 i = 0; + int32_t szMax = FX_EDIT_MAX(m_OldLineRects.GetSize(),m_NewLineRects.GetSize()); + int32_t i = 0; while (i < szMax) { @@ -346,7 +346,7 @@ void CFX_Edit_Refresh::EndRefresh() /* ------------------------------------- CFX_Edit_Undo ------------------------------------- */ -CFX_Edit_Undo::CFX_Edit_Undo(FX_INT32 nBufsize) : m_nCurUndoPos(0), +CFX_Edit_Undo::CFX_Edit_Undo(int32_t nBufsize) : m_nCurUndoPos(0), m_nBufSize(nBufsize), m_bModified(FALSE), m_bVirgin(TRUE), @@ -391,7 +391,7 @@ void CFX_Edit_Undo::Redo() { m_bWorking = TRUE; - FX_INT32 nStackSize = m_UndoItemStack.GetSize(); + int32_t nStackSize = m_UndoItemStack.GetSize(); if (m_nCurUndoPos < nStackSize) { @@ -441,7 +441,7 @@ FX_BOOL CFX_Edit_Undo::IsModified() const return TRUE; } -IFX_Edit_UndoItem* CFX_Edit_Undo::GetItem(FX_INT32 nIndex) +IFX_Edit_UndoItem* CFX_Edit_Undo::GetItem(int32_t nIndex) { if (nIndex>=0 && nIndex < m_UndoItemStack.GetSize()) return m_UndoItemStack.GetAt(nIndex); @@ -459,7 +459,7 @@ void CFX_Edit_Undo::RemoveHeads() void CFX_Edit_Undo::RemoveTails() { - for (FX_INT32 i = m_UndoItemStack.GetSize()-1; i >= m_nCurUndoPos; i--) + for (int32_t i = m_UndoItemStack.GetSize()-1; i >= m_nCurUndoPos; i--) { delete m_UndoItemStack.GetAt(i); m_UndoItemStack.RemoveAt(i); @@ -468,7 +468,7 @@ void CFX_Edit_Undo::RemoveTails() void CFX_Edit_Undo::Reset() { - for (FX_INT32 i=0, sz=m_UndoItemStack.GetSize(); i < sz; i++) + for (int32_t i=0, sz=m_UndoItemStack.GetSize(); i < sz; i++) { delete m_UndoItemStack.GetAt(i); } @@ -549,7 +549,7 @@ CFX_WideString CFX_Edit_GroupUndoItem::GetUndoTitle() /* ------------------------------------- CFX_Edit_UndoItem derived classes ------------------------------------- */ CFXEU_InsertWord::CFXEU_InsertWord(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace, - FX_WORD word, FX_INT32 charset, const CPVT_WordProps * pWordProps) + FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps) : m_pEdit(pEdit), m_wpOld(wpOldPlace), m_wpNew(wpNewPlace), m_Word(word), m_nCharset(charset), m_WordProps() { if (pWordProps) @@ -624,7 +624,7 @@ void CFXEU_InsertReturn::Undo() //CFXEU_Backspace CFXEU_Backspace::CFXEU_Backspace(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace, - FX_WORD word, FX_INT32 charset, + FX_WORD word, int32_t charset, const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps) : m_pEdit(pEdit), m_wpOld(wpOldPlace), @@ -671,7 +671,7 @@ void CFXEU_Backspace::Undo() //CFXEU_Delete CFXEU_Delete::CFXEU_Delete(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace, - FX_WORD word, FX_INT32 charset, + FX_WORD word, int32_t charset, const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps, FX_BOOL bSecEnd) : m_pEdit(pEdit), m_wpOld(wpOldPlace), @@ -754,7 +754,7 @@ void CFXEU_Clear::Undo() //CFXEU_ClearRich CFXEU_ClearRich::CFXEU_ClearRich(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace, - const CPVT_WordRange & wrSel, FX_WORD word, FX_INT32 charset, + const CPVT_WordRange & wrSel, FX_WORD word, int32_t charset, const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps) : m_pEdit(pEdit), m_wpOld(wpOldPlace), @@ -807,7 +807,7 @@ void CFXEU_ClearRich::Undo() //CFXEU_InsertText CFXEU_InsertText::CFXEU_InsertText(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace, - const CFX_WideString & swText, FX_INT32 charset, + const CFX_WideString & swText, int32_t charset, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps) : m_pEdit(pEdit), m_wpOld(wpOldPlace), @@ -1046,13 +1046,13 @@ void CFX_Edit::SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint/* = TRUE*/) if (bPaint) Paint(); } -void CFX_Edit::SetAlignmentH(FX_INT32 nFormat/* =0 */, FX_BOOL bPaint/* = TRUE*/) +void CFX_Edit::SetAlignmentH(int32_t nFormat/* =0 */, FX_BOOL bPaint/* = TRUE*/) { m_pVT->SetAlignment(nFormat); if (bPaint) Paint(); } -void CFX_Edit::SetAlignmentV(FX_INT32 nFormat/* =0 */, FX_BOOL bPaint/* = TRUE*/) +void CFX_Edit::SetAlignmentV(int32_t nFormat/* =0 */, FX_BOOL bPaint/* = TRUE*/) { m_nAlignment = nFormat; if (bPaint) Paint(); @@ -1064,13 +1064,13 @@ void CFX_Edit::SetPasswordChar(FX_WORD wSubWord/* ='*' */, FX_BOOL bPaint/* = TR if (bPaint) Paint(); } -void CFX_Edit::SetLimitChar(FX_INT32 nLimitChar/* =0 */, FX_BOOL bPaint/* = TRUE*/) +void CFX_Edit::SetLimitChar(int32_t nLimitChar/* =0 */, FX_BOOL bPaint/* = TRUE*/) { m_pVT->SetLimitChar(nLimitChar); if (bPaint) Paint(); } -void CFX_Edit::SetCharArray(FX_INT32 nCharArray/* =0 */, FX_BOOL bPaint/* = TRUE*/) +void CFX_Edit::SetCharArray(int32_t nCharArray/* =0 */, FX_BOOL bPaint/* = TRUE*/) { m_pVT->SetCharArray(nCharArray); if (bPaint) Paint(); @@ -1082,7 +1082,7 @@ void CFX_Edit::SetCharSpace(FX_FLOAT fCharSpace/* =0.0f */, FX_BOOL bPaint/* = T if (bPaint) Paint(); } -void CFX_Edit::SetHorzScale(FX_INT32 nHorzScale/* =100 */, FX_BOOL bPaint/* = TRUE*/) +void CFX_Edit::SetHorzScale(int32_t nHorzScale/* =100 */, FX_BOOL bPaint/* = TRUE*/) { m_pVT->SetHorzScale(nHorzScale); if (bPaint) Paint(); @@ -1130,7 +1130,7 @@ void CFX_Edit::SetTextOverflow(FX_BOOL bAllowed /*= FALSE*/, FX_BOOL bPaint/* = if (bPaint) Paint(); } -void CFX_Edit::SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar) +void CFX_Edit::SetSel(int32_t nStartChar,int32_t nEndChar) { if (m_pVT->IsValid()) { @@ -1181,7 +1181,7 @@ void CFX_Edit::SetSel(const CPVT_WordPlace & begin,const CPVT_WordPlace & end) } } -void CFX_Edit::GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const +void CFX_Edit::GetSel(int32_t & nStartChar, int32_t & nEndChar) const { nStartChar = -1; nEndChar = -1; @@ -1209,7 +1209,7 @@ void CFX_Edit::GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const } } -FX_INT32 CFX_Edit::GetCaret() const +int32_t CFX_Edit::GetCaret() const { if (m_pVT->IsValid()) return m_pVT->WordPlaceToWordIndex(m_wpCaret); @@ -1319,14 +1319,14 @@ CFX_WideString CFX_Edit::GetSelText() const return GetRangeText(m_SelState.ConvertToWordRange()); } -FX_INT32 CFX_Edit::GetTotalWords() const +int32_t CFX_Edit::GetTotalWords() const { return m_pVT->GetTotalWords(); } -FX_INT32 CFX_Edit::GetTotalLines() const +int32_t CFX_Edit::GetTotalLines() const { - FX_INT32 nLines = 0; + int32_t nLines = 0; if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator()) { @@ -1379,7 +1379,7 @@ void CFX_Edit::SetRichText(FX_BOOL bRichText/* =TRUE */, FX_BOOL bPaint/* = TRUE if (bPaint) Paint(); } -FX_BOOL CFX_Edit::SetRichFontIndex(FX_INT32 nFontIndex) +FX_BOOL CFX_Edit::SetRichFontIndex(int32_t nFontIndex) { CPVT_WordProps WordProps; WordProps.nFontIndex = nFontIndex; @@ -1400,7 +1400,7 @@ FX_BOOL CFX_Edit::SetRichTextColor(FX_COLORREF dwColor) return SetRichTextProps(EP_WORDCOLOR,NULL,&WordProps); } -FX_BOOL CFX_Edit::SetRichTextScript(FX_INT32 nScriptType) +FX_BOOL CFX_Edit::SetRichTextScript(int32_t nScriptType) { CPVT_WordProps WordProps; WordProps.nScriptType = nScriptType; @@ -1446,7 +1446,7 @@ FX_BOOL CFX_Edit::SetRichTextCharSpace(FX_FLOAT fCharSpace) return SetRichTextProps(EP_CHARSPACE,NULL,&WordProps); } -FX_BOOL CFX_Edit::SetRichTextHorzScale(FX_INT32 nHorzScale /*= 100*/) +FX_BOOL CFX_Edit::SetRichTextHorzScale(int32_t nHorzScale /*= 100*/) { CPVT_WordProps WordProps; WordProps.nHorzScale = nHorzScale; @@ -1467,7 +1467,7 @@ FX_BOOL CFX_Edit::SetRichTextLineIndent(FX_FLOAT fLineIndent) return SetRichTextProps(EP_LINEINDENT,&SecProps,NULL); } -FX_BOOL CFX_Edit::SetRichTextAlignment(FX_INT32 nAlignment) +FX_BOOL CFX_Edit::SetRichTextAlignment(int32_t nAlignment) { CPVT_SecProps SecProps; SecProps.nAlignment = nAlignment; @@ -1921,13 +1921,13 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place return FALSE; } -void CFX_Edit::SetText(FX_LPCWSTR text,FX_INT32 charset /*= DEFAULT_CHARSET*/, +void CFX_Edit::SetText(FX_LPCWSTR text,int32_t charset /*= DEFAULT_CHARSET*/, const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/) { SetText(text,charset,pSecProps,pWordProps,TRUE,TRUE); } -FX_BOOL CFX_Edit::InsertWord(FX_WORD word, FX_INT32 charset /*= DEFAULT_CHARSET*/, const CPVT_WordProps * pWordProps /*= NULL*/) +FX_BOOL CFX_Edit::InsertWord(FX_WORD word, int32_t charset /*= DEFAULT_CHARSET*/, const CPVT_WordProps * pWordProps /*= NULL*/) { return InsertWord(word,charset,pWordProps,TRUE,TRUE); } @@ -1952,7 +1952,7 @@ FX_BOOL CFX_Edit::Clear() return Clear(TRUE,TRUE); } -FX_BOOL CFX_Edit::InsertText(FX_LPCWSTR text, FX_INT32 charset /*= DEFAULT_CHARSET*/, +FX_BOOL CFX_Edit::InsertText(FX_LPCWSTR text, int32_t charset /*= DEFAULT_CHARSET*/, const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/) { return InsertText(text,charset,pSecProps,pWordProps,TRUE,TRUE); @@ -1968,7 +1968,7 @@ FX_WORD CFX_Edit::GetPasswordChar() const return m_pVT->GetPasswordChar(); } -FX_INT32 CFX_Edit::GetCharArray() const +int32_t CFX_Edit::GetCharArray() const { return m_pVT->GetCharArray(); } @@ -1983,7 +1983,7 @@ CPDF_Rect CFX_Edit::GetContentRect() const return VTToEdit(m_pVT->GetContentRect()); } -FX_INT32 CFX_Edit::GetHorzScale() const +int32_t CFX_Edit::GetHorzScale() const { return m_pVT->GetHorzScale(); } @@ -2413,7 +2413,7 @@ void CFX_Edit::Refresh(REFRESH_PLAN_E ePlan,const CPVT_WordRange * pRange1,const m_bNotifyFlag = TRUE; if (const CFX_Edit_RectArray * pRects = m_Refresh.GetRefreshRects()) { - for (FX_INT32 i = 0, sz = pRects->GetSize(); i < sz; i++) + for (int32_t i = 0, sz = pRects->GetSize(); i < sz; i++) m_pNotify->IOnInvalidateRect(pRects->GetAt(i)); } m_bNotifyFlag = FALSE; @@ -2647,7 +2647,7 @@ void CFX_Edit::SetCaretChange() } } -void CFX_Edit::SetCaret(FX_INT32 nPos) +void CFX_Edit::SetCaret(int32_t nPos) { if (m_pVT->IsValid()) { @@ -2962,7 +2962,7 @@ void CFX_Edit::OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) } } -void CFX_Edit::SetText(FX_LPCWSTR text,FX_INT32 charset, +void CFX_Edit::SetText(FX_LPCWSTR text,int32_t charset, const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint) { Empty(); @@ -2973,7 +2973,7 @@ void CFX_Edit::SetText(FX_LPCWSTR text,FX_INT32 charset, //if (bAddUndo) } -FX_BOOL CFX_Edit::InsertWord(FX_WORD word, FX_INT32 charset, const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint) +FX_BOOL CFX_Edit::InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint) { if (IsTextOverflow()) return FALSE; @@ -3264,7 +3264,7 @@ FX_BOOL CFX_Edit::Clear(FX_BOOL bAddUndo, FX_BOOL bPaint) return FALSE; } -FX_BOOL CFX_Edit::InsertText(FX_LPCWSTR text, FX_INT32 charset, +FX_BOOL CFX_Edit::InsertText(FX_LPCWSTR text, int32_t charset, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint) { if (IsTextOverflow()) return FALSE; @@ -3360,7 +3360,7 @@ void CFX_Edit::SetCaretOrigin() } } -FX_INT32 CFX_Edit::WordPlaceToWordIndex(const CPVT_WordPlace & place) const +int32_t CFX_Edit::WordPlaceToWordIndex(const CPVT_WordPlace & place) const { if (m_pVT->IsValid()) return m_pVT->WordPlaceToWordIndex(place); @@ -3368,7 +3368,7 @@ FX_INT32 CFX_Edit::WordPlaceToWordIndex(const CPVT_WordPlace & place) const return -1; } -CPVT_WordPlace CFX_Edit::WordIndexToWordPlace(FX_INT32 index) const +CPVT_WordPlace CFX_Edit::WordIndexToWordPlace(int32_t index) const { if (m_pVT->IsValid()) return m_pVT->WordIndexToWordPlace(index); @@ -3378,9 +3378,9 @@ CPVT_WordPlace CFX_Edit::WordIndexToWordPlace(FX_INT32 index) const FX_BOOL CFX_Edit::IsTextFull() const { - FX_INT32 nTotalWords = m_pVT->GetTotalWords(); - FX_INT32 nLimitChar = m_pVT->GetLimitChar(); - FX_INT32 nCharArray = m_pVT->GetCharArray(); + int32_t nTotalWords = m_pVT->GetTotalWords(); + int32_t nLimitChar = m_pVT->GetLimitChar(); + int32_t nCharArray = m_pVT->GetCharArray(); return IsTextOverflow() || (nLimitChar>0 && nTotalWords >= nLimitChar) || (nCharArray>0 && nTotalWords >= nCharArray); @@ -3510,7 +3510,7 @@ FX_FLOAT CFX_Edit::GetLineBottom(const CPVT_WordPlace& place) const return 0.0f; } -CPVT_WordPlace CFX_Edit::DoInsertText(const CPVT_WordPlace& place, FX_LPCWSTR text, FX_INT32 charset, +CPVT_WordPlace CFX_Edit::DoInsertText(const CPVT_WordPlace& place, FX_LPCWSTR text, int32_t charset, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps) { CPVT_WordPlace wp = place; @@ -3519,7 +3519,7 @@ CPVT_WordPlace CFX_Edit::DoInsertText(const CPVT_WordPlace& place, FX_LPCWSTR te { CFX_WideString sText = text; - for (FX_INT32 i = 0, sz = sText.GetLength(); i < sz; i++) + for (int32_t i = 0, sz = sText.GetLength(); i < sz; i++) { FX_WORD word = sText[i]; switch (word) @@ -3546,7 +3546,7 @@ CPVT_WordPlace CFX_Edit::DoInsertText(const CPVT_WordPlace& place, FX_LPCWSTR te return wp; } -FX_INT32 CFX_Edit::GetCharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset) +int32_t CFX_Edit::GetCharSetFromUnicode(FX_WORD word, int32_t nOldCharset) { if (IFX_Edit_FontMap* pFontMap = this->GetFontMap()) return pFontMap->CharSetFromUnicode(word, nOldCharset); diff --git a/fpdfsdk/src/fxedit/fxet_list.cpp b/fpdfsdk/src/fxedit/fxet_list.cpp index 64ed694d12..03b23020b4 100644 --- a/fpdfsdk/src/fxedit/fxet_list.cpp +++ b/fpdfsdk/src/fxedit/fxet_list.cpp @@ -130,7 +130,7 @@ CFX_List::~CFX_List() void CFX_List::Empty() { - for (FX_INT32 i=0,sz=m_aListItems.GetSize(); iGetRect().bottom; - for (FX_INT32 i=nItemIndex,sz=m_aListItems.GetSize(); i=0; i--) + for (int32_t i=m_aListItems.GetSize()-1; i>=0; i--) { if (CFX_ListItem * pListItem = m_aListItems.GetAt(i)) { @@ -286,11 +286,11 @@ FX_WCHAR CFX_List::Toupper(FX_WCHAR c) const return c; } -FX_INT32 CFX_List::FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const +int32_t CFX_List::FindNext(int32_t nIndex,FX_WCHAR nChar) const { - FX_INT32 nCircleIndex = nIndex; + int32_t nCircleIndex = nIndex; - for (FX_INT32 i=0,sz=m_aListItems.GetSize(); i= sz) nCircleIndex = 0; @@ -305,7 +305,7 @@ FX_INT32 CFX_List::FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const return nCircleIndex; } -CPDF_Rect CFX_List::GetItemRect(FX_INT32 nIndex) const +CPDF_Rect CFX_List::GetItemRect(int32_t nIndex) const { if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex)) { @@ -318,7 +318,7 @@ CPDF_Rect CFX_List::GetItemRect(FX_INT32 nIndex) const return CPDF_Rect(); } -FX_BOOL CFX_List::IsItemSelected(FX_INT32 nIndex) const +FX_BOOL CFX_List::IsItemSelected(int32_t nIndex) const { if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex)) { @@ -328,7 +328,7 @@ FX_BOOL CFX_List::IsItemSelected(FX_INT32 nIndex) const return FALSE; } -void CFX_List::SetItemSelect(FX_INT32 nItemIndex, FX_BOOL bSelected) +void CFX_List::SetItemSelect(int32_t nItemIndex, FX_BOOL bSelected) { if (CFX_ListItem * pListItem = m_aListItems.GetAt(nItemIndex)) { @@ -336,7 +336,7 @@ void CFX_List::SetItemSelect(FX_INT32 nItemIndex, FX_BOOL bSelected) } } -void CFX_List::SetItemCaret(FX_INT32 nItemIndex, FX_BOOL bCaret) +void CFX_List::SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret) { if (CFX_ListItem * pListItem = m_aListItems.GetAt(nItemIndex)) { @@ -354,12 +354,12 @@ FX_BOOL CFX_List::IsMultipleSel() const return m_bMultiple; } -FX_BOOL CFX_List::IsValid(FX_INT32 nItemIndex) const +FX_BOOL CFX_List::IsValid(int32_t nItemIndex) const { return nItemIndex >= 0 && nItemIndex < m_aListItems.GetSize(); } -CFX_WideString CFX_List::GetItemText(FX_INT32 nIndex) const +CFX_WideString CFX_List::GetItemText(int32_t nIndex) const { if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex)) { @@ -377,15 +377,15 @@ CPLST_Select::CPLST_Select() CPLST_Select::~CPLST_Select() { - for (FX_INT32 i=0,sz=m_aItems.GetSize(); i nEndIndex) { - FX_INT32 nTemp = nEndIndex; + int32_t nTemp = nEndIndex; nEndIndex = nBeginIndex; nBeginIndex = nTemp; } - for (FX_INT32 i=nBeginIndex; i<=nEndIndex; i++) Add(i); + for (int32_t i=nBeginIndex; i<=nEndIndex; i++) Add(i); } -void CPLST_Select::Sub(FX_INT32 nItemIndex) +void CPLST_Select::Sub(int32_t nItemIndex) { - for (FX_INT32 i=m_aItems.GetSize()-1; i>=0; i--) + for (int32_t i=m_aItems.GetSize()-1; i>=0; i--) { if (CPLST_Select_Item * pItem = m_aItems.GetAt(i)) if (pItem->nItemIndex == nItemIndex) @@ -420,21 +420,21 @@ void CPLST_Select::Sub(FX_INT32 nItemIndex) } } -void CPLST_Select::Sub(FX_INT32 nBeginIndex, FX_INT32 nEndIndex) +void CPLST_Select::Sub(int32_t nBeginIndex, int32_t nEndIndex) { if (nBeginIndex > nEndIndex) { - FX_INT32 nTemp = nEndIndex; + int32_t nTemp = nEndIndex; nEndIndex = nBeginIndex; nBeginIndex = nTemp; } - for (FX_INT32 i=nBeginIndex; i<=nEndIndex; i++) Sub(i); + for (int32_t i=nBeginIndex; i<=nEndIndex; i++) Sub(i); } -FX_INT32 CPLST_Select::Find(FX_INT32 nItemIndex) const +int32_t CPLST_Select::Find(int32_t nItemIndex) const { - for (FX_INT32 i=0,sz=m_aItems.GetSize(); i= 0; } -FX_INT32 CPLST_Select::GetCount() const +int32_t CPLST_Select::GetCount() const { return m_aItems.GetSize(); } -FX_INT32 CPLST_Select::GetItemIndex(FX_INT32 nIndex) const +int32_t CPLST_Select::GetItemIndex(int32_t nIndex) const { if (nIndex >= 0 && nIndex < m_aItems.GetSize()) if (CPLST_Select_Item * pItem = m_aItems.GetAt(nIndex)) @@ -465,7 +465,7 @@ FX_INT32 CPLST_Select::GetItemIndex(FX_INT32 nIndex) const return -1; } -FX_INT32 CPLST_Select::GetState(FX_INT32 nIndex) const +int32_t CPLST_Select::GetState(int32_t nIndex) const { if (nIndex >= 0 && nIndex < m_aItems.GetSize()) if (CPLST_Select_Item * pItem = m_aItems.GetAt(nIndex)) @@ -476,7 +476,7 @@ FX_INT32 CPLST_Select::GetState(FX_INT32 nIndex) const void CPLST_Select::DeselectAll() { - for (FX_INT32 i=0,sz=m_aItems.GetSize(); i=0; i--) + for (int32_t i=m_aItems.GetSize()-1; i>=0; i--) { if (CPLST_Select_Item * pItem = m_aItems.GetAt(i)) { @@ -559,7 +559,7 @@ CPDF_Rect CFX_ListCtrl::OutToIn(const CPDF_Rect & rect) const void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) { - FX_INT32 nHitIndex = this->GetItemIndex(point); + int32_t nHitIndex = this->GetItemIndex(point); if (IsMultipleSel()) { @@ -608,7 +608,7 @@ void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL b void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) { - FX_INT32 nHitIndex = this->GetItemIndex(point); + int32_t nHitIndex = this->GetItemIndex(point); if (IsMultipleSel()) { @@ -639,7 +639,7 @@ void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL b this->ScrollToListItem(nHitIndex); } -void CFX_ListCtrl::OnVK(FX_INT32 nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) +void CFX_ListCtrl::OnVK(int32_t nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) { if (IsMultipleSel()) { @@ -706,8 +706,8 @@ void CFX_ListCtrl::OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) FX_BOOL CFX_ListCtrl::OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl) { - FX_INT32 nIndex = GetLastSelected(); - FX_INT32 nFindIndex = FindNext(nIndex,nChar); + int32_t nIndex = GetLastSelected(); + int32_t nFindIndex = FindNext(nIndex,nChar); if (nFindIndex != nIndex) { @@ -728,7 +728,7 @@ void CFX_ListCtrl::SetPlateRect(const CPDF_Rect & rect) InvalidateItem(-1); } -CPDF_Rect CFX_ListCtrl::GetItemRect(FX_INT32 nIndex) const +CPDF_Rect CFX_ListCtrl::GetItemRect(int32_t nIndex) const { return InToOut(CFX_List::GetItemRect(nIndex)); } @@ -739,7 +739,7 @@ void CFX_ListCtrl::AddString(FX_LPCWSTR string) ReArrange(GetCount() - 1); } -void CFX_ListCtrl::SetMultipleSelect(FX_INT32 nItemIndex, FX_BOOL bSelected) +void CFX_ListCtrl::SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected) { if (!IsValid(nItemIndex)) return; @@ -758,7 +758,7 @@ void CFX_ListCtrl::SetMultipleSelect(FX_INT32 nItemIndex, FX_BOOL bSelected) } } -void CFX_ListCtrl::SetSingleSelect(FX_INT32 nItemIndex) +void CFX_ListCtrl::SetSingleSelect(int32_t nItemIndex) { if (!IsValid(nItemIndex)) return; @@ -776,13 +776,13 @@ void CFX_ListCtrl::SetSingleSelect(FX_INT32 nItemIndex) } } -void CFX_ListCtrl::SetCaret(FX_INT32 nItemIndex) +void CFX_ListCtrl::SetCaret(int32_t nItemIndex) { if (!IsValid(nItemIndex)) return; if (this->IsMultipleSel()) { - FX_INT32 nOldIndex = m_nCaretIndex; + int32_t nOldIndex = m_nCaretIndex; if (nOldIndex != nItemIndex) { @@ -797,7 +797,7 @@ void CFX_ListCtrl::SetCaret(FX_INT32 nItemIndex) } } -void CFX_ListCtrl::InvalidateItem(FX_INT32 nItemIndex) +void CFX_ListCtrl::InvalidateItem(int32_t nItemIndex) { if (m_pNotify) { @@ -831,10 +831,10 @@ void CFX_ListCtrl::InvalidateItem(FX_INT32 nItemIndex) void CFX_ListCtrl::SelectItems() { - for (FX_INT32 i=0,sz=m_aSelItems.GetCount(); iGetPlateRect(); CPDF_Rect rcItem = this->GetItemRect(nItemIndex); @@ -871,7 +871,7 @@ FX_BOOL CFX_ListCtrl::IsItemVisible(FX_INT32 nItemIndex) const return rcItem.bottom >= rcPlate.bottom && rcItem.top <= rcPlate.top; } -void CFX_ListCtrl::ScrollToListItem(FX_INT32 nItemIndex) +void CFX_ListCtrl::ScrollToListItem(int32_t nItemIndex) { if (!IsValid(nItemIndex)) return; @@ -960,13 +960,13 @@ CPDF_Rect CFX_ListCtrl::GetContentRect() const return InToOut(CFX_List::GetContentRect()); } -void CFX_ListCtrl::ReArrange(FX_INT32 nItemIndex) +void CFX_ListCtrl::ReArrange(int32_t nItemIndex) { CFX_List::ReArrange(nItemIndex); SetScrollInfo(); } -void CFX_ListCtrl::SetTopItem(FX_INT32 nIndex) +void CFX_ListCtrl::SetTopItem(int32_t nIndex) { if (IsValid(nIndex)) { @@ -976,9 +976,9 @@ void CFX_ListCtrl::SetTopItem(FX_INT32 nIndex) } } -FX_INT32 CFX_ListCtrl::GetTopItem() const +int32_t CFX_ListCtrl::GetTopItem() const { - FX_INT32 nItemIndex = this->GetItemIndex(this->GetBTPoint()); + int32_t nItemIndex = this->GetItemIndex(this->GetBTPoint()); if (!IsItemVisible(nItemIndex) && IsItemVisible(nItemIndex + 1)) nItemIndex += 1; @@ -997,7 +997,7 @@ void CFX_ListCtrl::Cancel() m_aSelItems.DeselectAll(); } -FX_INT32 CFX_ListCtrl::GetItemIndex(const CPDF_Point & point) const +int32_t CFX_ListCtrl::GetItemIndex(const CPDF_Point & point) const { return CFX_List::GetItemIndex(OutToIn(point)); } diff --git a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp index 7b64b33ba1..6b597cabb9 100644 --- a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp +++ b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp @@ -11,7 +11,7 @@ #define FX_EDIT_UNDERLINEHALFWIDTH 0.5f #define FX_EDIT_CROSSOUTHALFWIDTH 0.5f -extern CFX_ByteString GetPDFWordString(IFX_Edit_FontMap * pFontMap, FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord); +extern CFX_ByteString GetPDFWordString(IFX_Edit_FontMap * pFontMap, int32_t nFontIndex, FX_WORD Word, FX_WORD SubWord); CPDF_Rect GetUnderLineRect(const CPVT_Word& word) { @@ -26,7 +26,7 @@ CPDF_Rect GetCrossoutRect(const CPVT_Word& word) } static void DrawTextString(CFX_RenderDevice* pDevice, const CPDF_Point& pt, CPDF_Font* pFont, FX_FLOAT fFontSize, CPDF_Matrix* pUser2Device, - const CFX_ByteString& str, FX_ARGB crTextFill, FX_ARGB crTextStroke, FX_INT32 nHorzScale) + const CFX_ByteString& str, FX_ARGB crTextFill, FX_ARGB crTextStroke, int32_t nHorzScale) { FX_FLOAT x = pt.x, y = pt.y; pUser2Device->Transform(x, y); @@ -87,10 +87,10 @@ void IFX_Edit::DrawUnderline(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Devic CPDF_Rect rcTemp = rcClip; pUser2Device->TransformRect(rcTemp); FX_RECT rcDevClip; - rcDevClip.left = (FX_INT32)rcTemp.left; - rcDevClip.right = (FX_INT32)rcTemp.right; - rcDevClip.top = (FX_INT32)rcTemp.top; - rcDevClip.bottom = (FX_INT32)rcTemp.bottom; + rcDevClip.left = (int32_t)rcTemp.left; + rcDevClip.right = (int32_t)rcTemp.right; + rcDevClip.top = (int32_t)rcTemp.top; + rcDevClip.bottom = (int32_t)rcTemp.bottom; pDevice->SetClip_Rect(&rcDevClip); } @@ -139,7 +139,7 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IF FX_WORD SubWord = pEdit->GetPasswordChar(); FX_FLOAT fFontSize = pEdit->GetFontSize(); CPVT_WordRange wrSelect = pEdit->GetSelectWordRange(); - FX_INT32 nHorzScale = pEdit->GetHorzScale(); + int32_t nHorzScale = pEdit->GetHorzScale(); FX_COLORREF crCurFill = crTextFill; FX_COLORREF crOldFill = crCurFill; @@ -149,7 +149,7 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IF const FX_COLORREF crSelBK = ArgbEncode(255,0,51,113); CFX_ByteTextBuf sTextBuf; - FX_INT32 nFontIndex = -1; + int32_t nFontIndex = -1; CPDF_Point ptBT(0.0f,0.0f); pDevice->SaveState(); @@ -159,10 +159,10 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IF CPDF_Rect rcTemp = rcClip; pUser2Device->TransformRect(rcTemp); FX_RECT rcDevClip; - rcDevClip.left = (FX_INT32)rcTemp.left; - rcDevClip.right = (FX_INT32)rcTemp.right; - rcDevClip.top = (FX_INT32)rcTemp.top; - rcDevClip.bottom = (FX_INT32)rcTemp.bottom; + rcDevClip.left = (int32_t)rcTemp.left; + rcDevClip.right = (int32_t)rcTemp.right; + rcDevClip.top = (int32_t)rcTemp.top; + rcDevClip.bottom = (int32_t)rcTemp.bottom; pDevice->SetClip_Rect(&rcDevClip); } @@ -293,10 +293,10 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device CPDF_Rect rcTemp = rcClip; pUser2Device->TransformRect(rcTemp); FX_RECT rcDevClip; - rcDevClip.left = (FX_INT32)rcTemp.left; - rcDevClip.right = (FX_INT32)rcTemp.right; - rcDevClip.top = (FX_INT32)rcTemp.top; - rcDevClip.bottom = (FX_INT32)rcTemp.bottom; + rcDevClip.left = (int32_t)rcTemp.left; + rcDevClip.right = (int32_t)rcTemp.right; + rcDevClip.top = (int32_t)rcTemp.top; + rcDevClip.bottom = (int32_t)rcTemp.bottom; pDevice->SetClip_Rect(&rcDevClip); } @@ -416,7 +416,7 @@ static void AddRectToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crFill } static CPDF_TextObject* AddTextObjToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crText, - CPDF_Font* pFont, FX_FLOAT fFontSize, FX_FLOAT fCharSpace, FX_INT32 nHorzScale, + CPDF_Font* pFont, FX_FLOAT fFontSize, FX_FLOAT fCharSpace, int32_t nHorzScale, const CPDF_Point& point, const CFX_ByteString& text) { CPDF_TextObject* pTxtObj = new CPDF_TextObject; @@ -452,7 +452,7 @@ void IFX_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEd { FX_FLOAT fFontSize = pEdit->GetFontSize(); - FX_INT32 nOldFontIndex = -1; + int32_t nOldFontIndex = -1; CFX_ByteTextBuf sTextBuf; CPDF_Point ptBT(0.0f,0.0f); diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index c4a93ede61..9ea8029f60 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -1213,7 +1213,7 @@ FX_BOOL Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_Wid return FALSE; } CFX_WideString wsFilePath = m_pDocument->GetPath(); - FX_INT32 i = wsFilePath.GetLength() - 1; + int32_t i = wsFilePath.GetLength() - 1; for ( ; i >= 0; i-- ) { if ( wsFilePath.GetAt( i ) == L'\\' || wsFilePath.GetAt( i ) == L'/' ) diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp index 6b24366371..52126bc54c 100644 --- a/fpdfsdk/src/javascript/Field.cpp +++ b/fpdfsdk/src/javascript/Field.cpp @@ -597,7 +597,7 @@ FX_BOOL Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString FX_FLOAT fLeft,fBottom; IconFit.GetIconPosition(fLeft,fBottom); - vp << (FX_INT32)fLeft; + vp << (int32_t)fLeft; } return TRUE; @@ -648,7 +648,7 @@ FX_BOOL Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString FX_FLOAT fLeft,fBottom; IconFit.GetIconPosition(fLeft,fBottom); - vp << (FX_INT32)fBottom; + vp << (int32_t)fBottom; } return TRUE; @@ -788,9 +788,9 @@ FX_BOOL Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri CPDF_IconFit IconFit = pFormControl->GetIconFit(); if (IconFit.IsProportionalScale()) - vp << (FX_INT32)0; + vp << (int32_t)0; else - vp << (FX_INT32)1; + vp << (int32_t)1; } return TRUE; @@ -841,16 +841,16 @@ FX_BOOL Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr switch (ScaleM) { case CPDF_IconFit::Always : - vp << (FX_INT32) CPDF_IconFit::Always; + vp << (int32_t) CPDF_IconFit::Always; break; case CPDF_IconFit::Bigger : - vp << (FX_INT32) CPDF_IconFit::Bigger; + vp << (int32_t) CPDF_IconFit::Bigger; break; case CPDF_IconFit::Never : - vp << (FX_INT32) CPDF_IconFit::Never; + vp << (int32_t) CPDF_IconFit::Never; break; case CPDF_IconFit::Smaller : - vp << (FX_INT32) CPDF_IconFit::Smaller; + vp << (int32_t) CPDF_IconFit::Smaller; break; } } @@ -901,7 +901,7 @@ FX_BOOL Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri CPDF_InterForm* pInterForm = pRDInterForm->GetInterForm(); ASSERT(pInterForm != NULL); - vp << (FX_INT32)pInterForm->FindFieldInCalculationOrder(pFormField); + vp << (int32_t)pInterForm->FindFieldInCalculationOrder(pFormField); } return TRUE; @@ -944,7 +944,7 @@ FX_BOOL Field::charLimit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD) return FALSE; - vp << (FX_INT32)pFormField->GetMaxLen(); + vp << (int32_t)pFormField->GetMaxLen(); } return TRUE; } @@ -1141,7 +1141,7 @@ void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideSt break; } - int iSelecting = (FX_INT32)array.GetAt(i); + int iSelecting = (int32_t)array.GetAt(i); if (iSelecting < pFormField->CountOptions() && !pFormField->IsItemSelected(iSelecting)) pFormField->SetItemSelection(iSelecting, TRUE); @@ -1365,7 +1365,7 @@ FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr if (ANNOTFLAG_INVISIBLE & dwFlag || ANNOTFLAG_HIDDEN & dwFlag) { - vp << (FX_INT32)1; + vp << (int32_t)1; } else { @@ -1373,16 +1373,16 @@ FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr { if (ANNOTFLAG_NOVIEW & dwFlag) { - vp << (FX_INT32)3; + vp << (int32_t)3; } else { - vp << (FX_INT32)0; + vp << (int32_t)0; } } else { - vp << (FX_INT32)2; + vp << (int32_t)2; } } } @@ -1932,7 +1932,7 @@ FX_BOOL Field::lineWidth(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(0)); if (!pWidget) return FALSE; - vp << (FX_INT32)pWidget->GetBorderWidth(); + vp << (int32_t)pWidget->GetBorderWidth(); } return TRUE; @@ -2110,7 +2110,7 @@ FX_BOOL Field::numItems(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE if (!vp.IsGetting()) return FALSE; - vp << (FX_INT32)pFormField->CountOptions(); + vp << (int32_t)pFormField->CountOptions(); return TRUE; } @@ -2147,14 +2147,14 @@ FX_BOOL Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError if(!pPageView) return FALSE; - PageArray.SetElement(i, CJS_Value(m_isolate,(FX_INT32)pPageView->GetPageIndex())); + PageArray.SetElement(i, CJS_Value(m_isolate,(int32_t)pPageView->GetPageIndex())); } vp << PageArray; } else { - vp << (FX_INT32) -1; + vp << (int32_t) -1; } return TRUE; @@ -2407,10 +2407,10 @@ FX_BOOL Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError CFX_FloatRect crRect = pWidget->GetRect(); CJS_Value Upper_Leftx(m_isolate),Upper_Lefty(m_isolate),Lower_Rightx(m_isolate),Lower_Righty(m_isolate); - Upper_Leftx = (FX_INT32)crRect.left; - Upper_Lefty = (FX_INT32)crRect.top; - Lower_Rightx = (FX_INT32)crRect.right; - Lower_Righty = (FX_INT32)crRect.bottom; + Upper_Leftx = (int32_t)crRect.left; + Upper_Lefty = (int32_t)crRect.top; + Lower_Rightx = (int32_t)crRect.right; + Lower_Righty = (int32_t)crRect.bottom; CJS_Array rcArray(m_isolate); rcArray.SetElement(0,Upper_Leftx); @@ -2643,7 +2643,7 @@ FX_BOOL Field::rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); if (!pFormControl)return FALSE; - vp << (FX_INT32)pFormControl->GetRotation(); + vp << (int32_t)pFormControl->GetRotation(); } return TRUE; @@ -2850,7 +2850,7 @@ FX_BOOL Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s FX_ARGB color; CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaultAppearance(); FieldAppearance.GetColor(color, iColorType); - FX_INT32 a,r,g,b; + int32_t a,r,g,b; ArgbDecode(color, a, r, g, b); CPWL_Color crRet = CPWL_Color(COLORTYPE_RGB, r / 255.0f, @@ -3791,7 +3791,7 @@ FX_BOOL Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); - FX_INT32 nCount = pFormField->CountControls(); + int32_t nCount = pFormField->CountControls(); if (nCount < 1) return FALSE; @@ -3812,7 +3812,7 @@ FX_BOOL Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val return FALSE; if (CPDFSDK_PageView* pCurPageView = m_pDocument->GetPageView(pPage)) { - for (FX_INT32 i=0; iGetWidget(pFormField->GetControl(i))) { @@ -3886,7 +3886,7 @@ FX_BOOL Field::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr /////////////////////////////////////////// delay ///////////////////////////////////////////// -void Field::AddDelay_Int(enum FIELD_PROP prop, FX_INT32 n) +void Field::AddDelay_Int(enum FIELD_PROP prop, int32_t n) { ASSERT(m_pJSDoc != NULL); diff --git a/fpdfsdk/src/javascript/JS_GlobalData.cpp b/fpdfsdk/src/javascript/JS_GlobalData.cpp index b242ae8031..c4166762ee 100644 --- a/fpdfsdk/src/javascript/JS_GlobalData.cpp +++ b/fpdfsdk/src/javascript/JS_GlobalData.cpp @@ -105,7 +105,7 @@ void CJS_GlobalVariableArray::Empty() #define PHANTOM_JS_GLOBALDATA_FILENAME L"Phantom_JsGlobal.Data" #define SDK_JS_GLOBALDATA_FILENAME L"SDK_JsGlobal.Data" -static const FX_BYTE JS_RC4KEY[] = {0x19,0xa8,0xe8,0x01,0xf6,0xa8,0xb6,0x4d,0x82,0x04, +static const uint8_t JS_RC4KEY[] = {0x19,0xa8,0xe8,0x01,0xf6,0xa8,0xb6,0x4d,0x82,0x04, 0x45,0x6d,0xb4,0xcf,0xd7,0x77,0x67,0xf9,0x75,0x9f, 0xf0,0xe0,0x1e,0x51,0xee,0x46,0xfd,0x0b,0xc9,0x93, 0x25,0x55,0x4a,0xee,0xe0,0x16,0xd0,0xdf,0x8c,0xfa, @@ -338,7 +338,7 @@ FX_BOOL CJS_GlobalData::DeleteGlobalVariable(FX_LPCSTR propname) return FALSE; } -FX_INT32 CJS_GlobalData::GetSize() const +int32_t CJS_GlobalData::GetSize() const { return m_arrayGlobalData.GetSize(); } @@ -351,7 +351,7 @@ CJS_GlobalData_Element* CJS_GlobalData::GetAt(int index) const void CJS_GlobalData::LoadGlobalPersistentVariables() { FX_LPBYTE pBuffer = NULL; - FX_INT32 nLength = 0; + int32_t nLength = 0; LoadFileBuffer(m_sFilePath.c_str(), pBuffer, nLength); CRYPT_ArcFourCryptBlock(pBuffer, nLength, JS_RC4KEY, sizeof(JS_RC4KEY)); @@ -379,7 +379,7 @@ void CJS_GlobalData::LoadGlobalPersistentVariables() if (dwSize == nLength - sizeof(FX_WORD) * 2 - sizeof(FX_DWORD)* 2) { - for (FX_INT32 i=0,sz=dwCount; i pBuffer + nLength) break; @@ -511,12 +511,12 @@ void CJS_GlobalData::SaveGlobalPersisitentVariables() WriteFileBuffer(m_sFilePath.c_str(), (FX_LPCSTR)sFile.GetBuffer(), sFile.GetSize()); } -void CJS_GlobalData::LoadFileBuffer(FX_LPCWSTR sFilePath, FX_LPBYTE& pBuffer, FX_INT32& nLength) +void CJS_GlobalData::LoadFileBuffer(FX_LPCWSTR sFilePath, FX_LPBYTE& pBuffer, int32_t& nLength) { //UnSupport. } -void CJS_GlobalData::WriteFileBuffer(FX_LPCWSTR sFilePath, FX_LPCSTR pBuffer, FX_INT32 nLength) +void CJS_GlobalData::WriteFileBuffer(FX_LPCWSTR sFilePath, FX_LPCSTR pBuffer, int32_t nLength) { //UnSupport. } diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp index 26c59a32ad..e051cda66e 100644 --- a/fpdfsdk/src/javascript/util.cpp +++ b/fpdfsdk/src/javascript/util.cpp @@ -603,10 +603,10 @@ FX_BOOL util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& return TRUE; } -FX_INT64 FX_atoi64(const char *nptr) +int64_t FX_atoi64(const char *nptr) { int c; /* current char */ - FX_INT64 total; /* current total */ + int64_t total; /* current total */ int sign; /* if '-', then negative, otherwise positive */ /* skip whitespace */ diff --git a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp index 33c95d4232..cbc2ba46ba 100644 --- a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp @@ -256,12 +256,12 @@ void CPWL_ComboBox::AddString(FX_LPCWSTR string) m_pList->AddString(string); } -FX_INT32 CPWL_ComboBox::GetSelect() const +int32_t CPWL_ComboBox::GetSelect() const { return m_nSelectItem; } -void CPWL_ComboBox::SetSelect(FX_INT32 nItemIndex) +void CPWL_ComboBox::SetSelect(int32_t nItemIndex) { if (m_pList) m_pList->Select(nItemIndex); @@ -271,7 +271,7 @@ void CPWL_ComboBox::SetSelect(FX_INT32 nItemIndex) m_nSelectItem = nItemIndex; } -void CPWL_ComboBox::SetEditSel(FX_INT32 nStartChar,FX_INT32 nEndChar) +void CPWL_ComboBox::SetEditSel(int32_t nStartChar,int32_t nEndChar) { if (m_pEdit) { @@ -279,7 +279,7 @@ void CPWL_ComboBox::SetEditSel(FX_INT32 nStartChar,FX_INT32 nEndChar) } } -void CPWL_ComboBox::GetEditSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const +void CPWL_ComboBox::GetEditSel(int32_t & nStartChar, int32_t & nEndChar) const { nStartChar = -1; nEndChar = -1; @@ -506,7 +506,7 @@ void CPWL_ComboBox::SetPopup(FX_BOOL bPopup) m_pFillerNotify->OnPopupPreOpen(GetAttachedData(), bExit, 0); if (bExit) return; - FX_INT32 nWhere = 0; + int32_t nWhere = 0; FX_FLOAT fPopupRet = 0.0f; FX_FLOAT fPopupMin = 0.0f; if (m_pList->GetCount() > 3) @@ -637,7 +637,7 @@ FX_BOOL CPWL_ComboBox::OnChar(FX_WORD nChar, FX_DWORD nFlag) } } -void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam) +void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam) { switch (msg) { diff --git a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp index 83f7340fad..f50233ff1c 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp @@ -47,12 +47,12 @@ void CPWL_Edit::SetText(FX_LPCWSTR csText) if (CXML_Element * pXML = CXML_Element::Parse(sValue.c_str(), sValue.GetLength())) { - FX_INT32 nCount = pXML->CountChildren(); + int32_t nCount = pXML->CountChildren(); FX_BOOL bFirst = TRUE; swText.Empty(); - for (FX_INT32 i=0; iGetElement(i)) { @@ -61,7 +61,7 @@ void CPWL_Edit::SetText(FX_LPCWSTR csText) { int nChild = pSubElement->CountChildren(); CFX_WideString swSection; - for(FX_INT32 j=0; jGetContent(j); } @@ -119,12 +119,12 @@ CPDF_Rect CPWL_Edit::GetClientRect() const void CPWL_Edit::SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat, FX_BOOL bPaint/* = TRUE*/) { - m_pEdit->SetAlignmentH((FX_INT32)nFormat, bPaint); + m_pEdit->SetAlignmentH((int32_t)nFormat, bPaint); } void CPWL_Edit::SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat, FX_BOOL bPaint/* = TRUE*/) { - m_pEdit->SetAlignmentV((FX_INT32)nFormat, bPaint); + m_pEdit->SetAlignmentV((int32_t)nFormat, bPaint); } FX_BOOL CPWL_Edit::CanSelectAll() const @@ -298,7 +298,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream) CPDF_Rect rcClient = GetClientRect(); CFX_ByteTextBuf sLine; - FX_INT32 nCharArray = m_pEdit->GetCharArray(); + int32_t nCharArray = m_pEdit->GetCharArray(); if (nCharArray > 0) { @@ -309,7 +309,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream) sLine << "q\n" << GetBorderWidth() << " w\n" << CPWL_Utils::GetColorAppStream(GetBorderColor(),FALSE) << " 2 J 0 j\n"; - for (FX_INT32 i=1;iGetCharArray(); + int32_t nCharArray = m_pEdit->GetCharArray(); FX_SAFE_INT32 nCharArraySafe = nCharArray; nCharArraySafe -= 1; nCharArraySafe *= 2; @@ -428,7 +428,7 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser CFX_PathData path; path.SetPointCount(nCharArraySafe.ValueOrDie()); - for (FX_INT32 i=0; iSuggestWords(sLatin,sSuggestWords); - FX_INT32 nSuggest = sSuggestWords.GetSize(); + int32_t nSuggest = sSuggestWords.GetSize(); - for (FX_INT32 nWord=0; nWordAppendMenuItem(hPopup, WM_PWLEDIT_SUGGEST+nWord, sSuggestWords[nWord].UTF8Decode()); } @@ -643,11 +643,11 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag) pSH->EnableMenuItem(hPopup, WM_PWLEDIT_SELECTALL, FALSE); } - FX_INT32 x, y; + int32_t x, y; PWLtoWnd(ptPopup, x, y); pSH->ClientToScreen(GetAttachedHWnd(), x, y); pSH->SetCursor(FXCT_ARROW); - FX_INT32 nCmd = pSH->TrackPopupMenu(hPopup, + int32_t nCmd = pSH->TrackPopupMenu(hPopup, x, y, GetAttachedHWnd()); @@ -736,7 +736,7 @@ void CPWL_Edit::OnKillFocus() m_bFocus = FALSE; } -void CPWL_Edit::SetHorzScale(FX_INT32 nHorzScale, FX_BOOL bPaint/* = TRUE*/) +void CPWL_Edit::SetHorzScale(int32_t nHorzScale, FX_BOOL bPaint/* = TRUE*/) { m_pEdit->SetHorzScale(nHorzScale, bPaint); } @@ -761,8 +761,8 @@ CPVT_WordRange CPWL_Edit::GetSelectWordRange() const { if (m_pEdit->IsSelected()) { - FX_INT32 nStart = -1; - FX_INT32 nEnd = -1; + int32_t nStart = -1; + int32_t nEnd = -1; m_pEdit->GetSel(nStart, nEnd); @@ -821,7 +821,7 @@ FX_BOOL CPWL_Edit::IsTextFull() const return m_pEdit->IsTextFull(); } -FX_FLOAT CPWL_Edit::GetCharArrayAutoFontSize(CPDF_Font* pFont, const CPDF_Rect& rcPlate, FX_INT32 nCharArray) +FX_FLOAT CPWL_Edit::GetCharArrayAutoFontSize(CPDF_Font* pFont, const CPDF_Rect& rcPlate, int32_t nCharArray) { if (pFont && !pFont->IsStandardFont()) { @@ -838,7 +838,7 @@ FX_FLOAT CPWL_Edit::GetCharArrayAutoFontSize(CPDF_Font* pFont, const CPDF_Rect& return 0.0f; } -void CPWL_Edit::SetCharArray(FX_INT32 nCharArray) +void CPWL_Edit::SetCharArray(int32_t nCharArray) { if (HasFlag(PES_CHARARRAY) && nCharArray > 0) { @@ -860,7 +860,7 @@ void CPWL_Edit::SetCharArray(FX_INT32 nCharArray) } } -void CPWL_Edit::SetLimitChar(FX_INT32 nLimitChar) +void CPWL_Edit::SetLimitChar(int32_t nLimitChar) { m_pEdit->SetLimitChar(nLimitChar); } @@ -1016,7 +1016,7 @@ FX_BOOL CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag) if (m_pFillerNotify) { CFX_WideString swChange; - FX_INT32 nKeyCode; + int32_t nKeyCode; int nSelStart = 0; int nSelEnd = 0; @@ -1048,8 +1048,8 @@ FX_BOOL CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag) if (IFX_Edit_FontMap * pFontMap = GetFontMap()) { - FX_INT32 nOldCharSet = GetCharSet(); - FX_INT32 nNewCharSet = pFontMap->CharSetFromUnicode(nChar, DEFAULT_CHARSET); + int32_t nOldCharSet = GetCharSet(); + int32_t nNewCharSet = pFontMap->CharSetFromUnicode(nChar, DEFAULT_CHARSET); if(nOldCharSet != nNewCharSet) { SetCharSet(nNewCharSet); diff --git a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp index 90a198a771..a38371c326 100644 --- a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp @@ -81,7 +81,7 @@ void CPWL_EditCtrl::RePosChildWnd() m_pEdit->SetPlateRect(GetClientRect()); } -void CPWL_EditCtrl::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam) +void CPWL_EditCtrl::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam) { CPWL_Wnd::OnNotify(pWnd,msg,wParam,lParam); @@ -409,7 +409,7 @@ void CPWL_EditCtrl::GetCaretInfo(CPDF_Point & ptHead, CPDF_Point & ptFoot) const } } -void CPWL_EditCtrl::GetCaretPos(FX_INT32& x, FX_INT32& y) const +void CPWL_EditCtrl::GetCaretPos(int32_t& x, int32_t& y) const { CPDF_Point ptHead(0,0), ptFoot(0,0); @@ -439,12 +439,12 @@ CFX_WideString CPWL_EditCtrl::GetText() const return m_pEdit->GetText(); } -void CPWL_EditCtrl::SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar) +void CPWL_EditCtrl::SetSel(int32_t nStartChar,int32_t nEndChar) { m_pEdit->SetSel(nStartChar, nEndChar); } -void CPWL_EditCtrl::GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar ) const +void CPWL_EditCtrl::GetSel(int32_t & nStartChar, int32_t & nEndChar ) const { m_pEdit->GetSel(nStartChar, nEndChar); } @@ -472,7 +472,7 @@ void CPWL_EditCtrl::EnableRefresh(FX_BOOL bRefresh) m_pEdit->EnableRefresh(bRefresh); } -FX_INT32 CPWL_EditCtrl::GetCaret() const +int32_t CPWL_EditCtrl::GetCaret() const { if (m_pEdit) return m_pEdit->GetCaret(); @@ -480,13 +480,13 @@ FX_INT32 CPWL_EditCtrl::GetCaret() const return -1; } -void CPWL_EditCtrl::SetCaret(FX_INT32 nPos) +void CPWL_EditCtrl::SetCaret(int32_t nPos) { if (m_pEdit) m_pEdit->SetCaret(nPos); } -FX_INT32 CPWL_EditCtrl::GetTotalWords() const +int32_t CPWL_EditCtrl::GetTotalWords() const { if (m_pEdit) return m_pEdit->GetTotalWords(); @@ -510,7 +510,7 @@ CPDF_Point CPWL_EditCtrl::GetScrollPos() const CPDF_Font * CPWL_EditCtrl::GetCaretFont() const { - FX_INT32 nFontIndex = 0; + int32_t nFontIndex = 0; if (IFX_Edit_Iterator * pIterator = m_pEdit->GetIterator()) { @@ -588,7 +588,7 @@ void CPWL_EditCtrl::InsertText(FX_LPCWSTR csText) m_pEdit->InsertText(csText); } -void CPWL_EditCtrl::InsertWord(FX_WORD word, FX_INT32 nCharset) +void CPWL_EditCtrl::InsertWord(FX_WORD word, int32_t nCharset) { if (!IsReadOnly()) m_pEdit->InsertWord(word, nCharset); @@ -646,7 +646,7 @@ void CPWL_EditCtrl::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, Info.fSmallStep = fSmallStep; Info.fBigStep = fBigStep; - this->OnNotify(this,PNM_SETSCROLLINFO,SBT_VSCROLL,(FX_INTPTR)&Info); + this->OnNotify(this,PNM_SETSCROLLINFO,SBT_VSCROLL,(intptr_t)&Info); // PWL_TRACE("set scroll info:%f\n",fContentMax - fContentMin); @@ -664,7 +664,7 @@ void CPWL_EditCtrl::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, void CPWL_EditCtrl::IOnSetScrollPosY(FX_FLOAT fy) { // PWL_TRACE("set scroll position:%f\n",fy); - this->OnNotify(this,PNM_SETSCROLLPOS,SBT_VSCROLL,(FX_INTPTR)&fy); + this->OnNotify(this,PNM_SETSCROLLPOS,SBT_VSCROLL,(intptr_t)&fy); } void CPWL_EditCtrl::IOnSetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot, const CPVT_WordPlace& place) @@ -674,7 +674,7 @@ void CPWL_EditCtrl::IOnSetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, con cInfo.ptHead = ptHead; cInfo.ptFoot = ptFoot; - this->OnNotify(this,PNM_SETCARETINFO,(FX_INTPTR)&cInfo,(FX_INTPTR)NULL); + this->OnNotify(this,PNM_SETCARETINFO,(intptr_t)&cInfo,(intptr_t)NULL); } void CPWL_EditCtrl::IOnCaretChange(const CPVT_SecProps & secProps, const CPVT_WordProps & wordProps) @@ -697,7 +697,7 @@ void CPWL_EditCtrl::IOnInvalidateRect(CPDF_Rect * pRect) this->InvalidateRect(pRect); } -FX_INT32 CPWL_EditCtrl::GetCharSet() const +int32_t CPWL_EditCtrl::GetCharSet() const { if (m_nCharSet < 0) return DEFAULT_CHARSET; @@ -705,13 +705,13 @@ FX_INT32 CPWL_EditCtrl::GetCharSet() const return m_nCharSet; } -void CPWL_EditCtrl::GetTextRange(const CPDF_Rect& rect, FX_INT32 & nStartChar, FX_INT32 & nEndChar) const +void CPWL_EditCtrl::GetTextRange(const CPDF_Rect& rect, int32_t & nStartChar, int32_t & nEndChar) const { nStartChar = m_pEdit->WordPlaceToWordIndex(m_pEdit->SearchWordPlace(CPDF_Point(rect.left, rect.top))); nEndChar = m_pEdit->WordPlaceToWordIndex(m_pEdit->SearchWordPlace(CPDF_Point(rect.right, rect.bottom))); } -CFX_WideString CPWL_EditCtrl::GetText(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const +CFX_WideString CPWL_EditCtrl::GetText(int32_t & nStartChar, int32_t & nEndChar) const { CPVT_WordPlace wpStart = m_pEdit->WordIndexToWordPlace(nStartChar); CPVT_WordPlace wpEnd = m_pEdit->WordIndexToWordPlace(nEndChar); diff --git a/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp index 10549d583e..085159f5f3 100644 --- a/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp @@ -49,7 +49,7 @@ CPDF_Document* CPWL_FontMap::GetDocument() return m_pPDFDoc; } -CPDF_Font* CPWL_FontMap::GetPDFFont(FX_INT32 nFontIndex) +CPDF_Font* CPWL_FontMap::GetPDFFont(int32_t nFontIndex) { if (nFontIndex >=0 && nFontIndex < m_aData.GetSize()) { @@ -62,7 +62,7 @@ CPDF_Font* CPWL_FontMap::GetPDFFont(FX_INT32 nFontIndex) return NULL; } -CFX_ByteString CPWL_FontMap::GetPDFFontAlias(FX_INT32 nFontIndex) +CFX_ByteString CPWL_FontMap::GetPDFFontAlias(int32_t nFontIndex) { if (nFontIndex >=0 && nFontIndex < m_aData.GetSize()) { @@ -75,7 +75,7 @@ CFX_ByteString CPWL_FontMap::GetPDFFontAlias(FX_INT32 nFontIndex) return ""; } -FX_BOOL CPWL_FontMap::KnowWord(FX_INT32 nFontIndex, FX_WORD word) +FX_BOOL CPWL_FontMap::KnowWord(int32_t nFontIndex, FX_WORD word) { if (nFontIndex >=0 && nFontIndex < m_aData.GetSize()) { @@ -88,7 +88,7 @@ FX_BOOL CPWL_FontMap::KnowWord(FX_INT32 nFontIndex, FX_WORD word) return FALSE; } -FX_INT32 CPWL_FontMap::GetWordFontIndex(FX_WORD word, FX_INT32 nCharset, FX_INT32 nFontIndex) +int32_t CPWL_FontMap::GetWordFontIndex(FX_WORD word, int32_t nCharset, int32_t nFontIndex) { if (nFontIndex > 0) { @@ -111,7 +111,7 @@ FX_INT32 CPWL_FontMap::GetWordFontIndex(FX_WORD word, FX_INT32 nCharset, FX_INT3 } } - FX_INT32 nNewFontIndex = -1; + int32_t nNewFontIndex = -1; nNewFontIndex = this->GetFontIndex(GetNativeFontName(nCharset), nCharset, TRUE); if (nNewFontIndex >= 0) @@ -130,7 +130,7 @@ FX_INT32 CPWL_FontMap::GetWordFontIndex(FX_WORD word, FX_INT32 nCharset, FX_INT3 return -1; } -FX_INT32 CPWL_FontMap::CharCodeFromUnicode(FX_INT32 nFontIndex, FX_WORD word) +int32_t CPWL_FontMap::CharCodeFromUnicode(int32_t nFontIndex, FX_WORD word) { if (CPWL_FontMap_Data* pData = m_aData.GetAt(nFontIndex)) { @@ -153,10 +153,10 @@ FX_INT32 CPWL_FontMap::CharCodeFromUnicode(FX_INT32 nFontIndex, FX_WORD word) return -1; } -CFX_ByteString CPWL_FontMap::GetNativeFontName(FX_INT32 nCharset) +CFX_ByteString CPWL_FontMap::GetNativeFontName(int32_t nCharset) { //searching native font is slow, so we must save time - for (FX_INT32 i=0,sz=m_aNativeFont.GetSize(); i= 0) return nFontIndex; // nFontIndex = FindFont("", nCharset); @@ -285,11 +285,11 @@ FX_INT32 CPWL_FontMap::GetFontIndex(const CFX_ByteString& sFontName, FX_INT32 nC return AddFontData(pFont, sAlias, nCharset); } -FX_INT32 CPWL_FontMap::GetPWLFontIndex(FX_WORD word, FX_INT32 nCharset) +int32_t CPWL_FontMap::GetPWLFontIndex(FX_WORD word, int32_t nCharset) { - FX_INT32 nFind = -1; + int32_t nFind = -1; - for (FX_INT32 i=0,sz=m_aData.GetSize(); ipFont = pFont; @@ -339,7 +339,7 @@ void CPWL_FontMap::AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias) { } -CFX_ByteString CPWL_FontMap::GetFontName(FX_INT32 nFontIndex) +CFX_ByteString CPWL_FontMap::GetFontName(int32_t nFontIndex) { if (nFontIndex >=0 && nFontIndex < m_aData.GetSize()) { @@ -352,7 +352,7 @@ CFX_ByteString CPWL_FontMap::GetFontName(FX_INT32 nFontIndex) return ""; } -CFX_ByteString CPWL_FontMap::GetNativeFont(FX_INT32 nCharset) +CFX_ByteString CPWL_FontMap::GetNativeFont(int32_t nCharset) { CFX_ByteString sFontName; @@ -372,7 +372,7 @@ CFX_ByteString CPWL_FontMap::GetNativeFont(FX_INT32 nCharset) return sFontName; } -CPDF_Font* CPWL_FontMap::AddFontToDocument(CPDF_Document* pDoc, CFX_ByteString& sFontName, FX_BYTE nCharset) +CPDF_Font* CPWL_FontMap::AddFontToDocument(CPDF_Document* pDoc, CFX_ByteString& sFontName, uint8_t nCharset) { if (IsStandardFont(sFontName)) return AddStandardFont(pDoc, sFontName); @@ -397,7 +397,7 @@ CPDF_Font* CPWL_FontMap::AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sF return pFont; } -CPDF_Font* CPWL_FontMap::AddSystemFont(CPDF_Document* pDoc, CFX_ByteString& sFontName, FX_BYTE nCharset) +CPDF_Font* CPWL_FontMap::AddSystemFont(CPDF_Document* pDoc, CFX_ByteString& sFontName, uint8_t nCharset) { if (!pDoc) return NULL; @@ -410,7 +410,7 @@ CPDF_Font* CPWL_FontMap::AddSystemFont(CPDF_Document* pDoc, CFX_ByteString& sFon return NULL; } -CFX_ByteString CPWL_FontMap::EncodeFontAlias(const CFX_ByteString& sFontName, FX_INT32 nCharset) +CFX_ByteString CPWL_FontMap::EncodeFontAlias(const CFX_ByteString& sFontName, int32_t nCharset) { CFX_ByteString sPostfix; sPostfix.Format("_%02X", nCharset); @@ -424,12 +424,12 @@ CFX_ByteString CPWL_FontMap::EncodeFontAlias(const CFX_ByteString& sFontName) return sRet; } -FX_INT32 CPWL_FontMap::GetFontMapCount() const +int32_t CPWL_FontMap::GetFontMapCount() const { return m_aData.GetSize(); } -const CPWL_FontMap_Data* CPWL_FontMap::GetFontMapData(FX_INT32 nIndex) const +const CPWL_FontMap_Data* CPWL_FontMap::GetFontMapData(int32_t nIndex) const { if (nIndex >=0 && nIndex < m_aData.GetSize()) { @@ -439,10 +439,10 @@ const CPWL_FontMap_Data* CPWL_FontMap::GetFontMapData(FX_INT32 nIndex) const return NULL; } -FX_INT32 CPWL_FontMap::GetNativeCharset() +int32_t CPWL_FontMap::GetNativeCharset() { - FX_BYTE nCharset = ANSI_CHARSET; - FX_INT32 iCodePage = FXSYS_GetACP(); + uint8_t nCharset = ANSI_CHARSET; + int32_t iCodePage = FXSYS_GetACP(); switch (iCodePage) { case 932://Japan @@ -513,7 +513,7 @@ const CPWL_FontMap::CharsetFontMap CPWL_FontMap::defaultTTFMap[] = { { -1, NULL } }; -CFX_ByteString CPWL_FontMap::GetDefaultFontByCharset(FX_INT32 nCharset) +CFX_ByteString CPWL_FontMap::GetDefaultFontByCharset(int32_t nCharset) { int i = 0; while (defaultTTFMap[i].charset != -1) { @@ -524,7 +524,7 @@ CFX_ByteString CPWL_FontMap::GetDefaultFontByCharset(FX_INT32 nCharset) return ""; } -FX_INT32 CPWL_FontMap::CharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset) +int32_t CPWL_FontMap::CharSetFromUnicode(FX_WORD word, int32_t nOldCharset) { if(m_pSystemHandler && (-1 != m_pSystemHandler->GetCharSet())) return m_pSystemHandler->GetCharSet(); diff --git a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp index 5e3e6e5586..9426824c8e 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp @@ -137,7 +137,7 @@ CPWL_Icon::~CPWL_Icon() { } -FX_INT32 CPWL_Icon::GetScaleMethod() +int32_t CPWL_Icon::GetScaleMethod() { if (m_pIconFit) return m_pIconFit->GetScaleMethod(); @@ -199,7 +199,7 @@ void CPWL_Icon::GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale) GetImageSize(fImageWidth,fImageHeight); - FX_INT32 nScaleMethod = this->GetScaleMethod(); + int32_t nScaleMethod = this->GetScaleMethod(); /* enum ScaleMethod diff --git a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp index 990f8b893f..cbb94d23d7 100644 --- a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp @@ -100,7 +100,7 @@ void CPWL_IconList_Item::SetData(void* pData) m_pData = pData; } -void CPWL_IconList_Item::SetIcon(FX_INT32 nIconIndex) +void CPWL_IconList_Item::SetIcon(int32_t nIconIndex) { m_nIconIndex = nIconIndex; } @@ -148,7 +148,7 @@ void CPWL_IconList_Item::OnDisabled() /* ----------------- CPWL_IconList_Content ----------------- */ -CPWL_IconList_Content::CPWL_IconList_Content(FX_INT32 nListCount) : +CPWL_IconList_Content::CPWL_IconList_Content(int32_t nListCount) : m_nSelectIndex(-1), m_pNotify(NULL), m_bEnableNotify(TRUE), @@ -163,7 +163,7 @@ CPWL_IconList_Content::~CPWL_IconList_Content() void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM & cp) { - for (FX_INT32 i=0; iOnNotify(this, PNM_SETSCROLLINFO, SBT_VSCROLL, (FX_INTPTR)&sInfo); + pParent->OnNotify(this, PNM_SETSCROLLINFO, SBT_VSCROLL, (intptr_t)&sInfo); } } @@ -199,7 +199,7 @@ FX_BOOL CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point, FX_DWORD SetCapture(); m_bMouseDown = TRUE; - FX_INT32 nItemIndex = FindItemIndex(point); + int32_t nItemIndex = FindItemIndex(point); SetSelect(nItemIndex); ScrollToItem(nItemIndex); @@ -218,7 +218,7 @@ FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point, FX_DWORD nF { if (m_bMouseDown) { - FX_INT32 nItemIndex = FindItemIndex(point); + int32_t nItemIndex = FindItemIndex(point); SetSelect(nItemIndex); ScrollToItem(nItemIndex); } @@ -233,7 +233,7 @@ FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) case FWL_VKEY_Up: if (m_nSelectIndex > 0) { - FX_INT32 nItemIndex = m_nSelectIndex - 1; + int32_t nItemIndex = m_nSelectIndex - 1; SetSelect(nItemIndex); ScrollToItem(nItemIndex); } @@ -241,7 +241,7 @@ FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) case FWL_VKEY_Down: if (m_nSelectIndex < m_nListCount-1) { - FX_INT32 nItemIndex = m_nSelectIndex + 1; + int32_t nItemIndex = m_nSelectIndex + 1; SetSelect(nItemIndex); ScrollToItem(nItemIndex); } @@ -251,10 +251,10 @@ FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) return FALSE; } -FX_INT32 CPWL_IconList_Content::FindItemIndex(const CPDF_Point& point) +int32_t CPWL_IconList_Content::FindItemIndex(const CPDF_Point& point) { - FX_INT32 nIndex = 0; - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); iInvalidateRect(); if (CPWL_Wnd* pParent = this->GetParentWindow()) { - pParent->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y); + pParent->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&ptScroll.y); } } } } -void CPWL_IconList_Content::SetSelect(FX_INT32 nIndex) +void CPWL_IconList_Content::SetSelect(int32_t nIndex) { if (m_nSelectIndex != nIndex) { @@ -316,7 +316,7 @@ void CPWL_IconList_Content::SetSelect(FX_INT32 nIndex) } } -FX_INT32 CPWL_IconList_Content::GetSelect() const +int32_t CPWL_IconList_Content::GetSelect() const { return m_nSelectIndex; } @@ -338,7 +338,7 @@ void CPWL_IconList_Content::EnableNotify(FX_BOOL bNotify) m_bEnableNotify = bNotify; } -void CPWL_IconList_Content::SelectItem(FX_INT32 nItemIndex, FX_BOOL bSelect) +void CPWL_IconList_Content::SelectItem(int32_t nItemIndex, FX_BOOL bSelect) { if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) { @@ -347,7 +347,7 @@ void CPWL_IconList_Content::SelectItem(FX_INT32 nItemIndex, FX_BOOL bSelect) } } -CPWL_IconList_Item* CPWL_IconList_Content::GetListItem(FX_INT32 nItemIndex) const +CPWL_IconList_Item* CPWL_IconList_Content::GetListItem(int32_t nItemIndex) const { if (nItemIndex >= 0 && nItemIndexSetData(pData); } -void CPWL_IconList_Content::SetListIcon(FX_INT32 nItemIndex, FX_INT32 nIconIndex) +void CPWL_IconList_Content::SetListIcon(int32_t nItemIndex, int32_t nIconIndex) { if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) pItem->SetIcon(nIconIndex); } -void CPWL_IconList_Content::SetListString(FX_INT32 nItemIndex, const CFX_WideString& str) +void CPWL_IconList_Content::SetListString(int32_t nItemIndex, const CFX_WideString& str) { if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) pItem->SetText(str); } -CFX_WideString CPWL_IconList_Content::GetListString(FX_INT32 nItemIndex) const +CFX_WideString CPWL_IconList_Content::GetListString(int32_t nItemIndex) const { if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) return pItem->GetText(); @@ -391,7 +391,7 @@ CFX_WideString CPWL_IconList_Content::GetListString(FX_INT32 nItemIndex) const void CPWL_IconList_Content::SetIconFillColor(const CPWL_Color& color) { - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); iSetSelect(nIndex); } -void CPWL_IconList::SetTopItem(FX_INT32 nIndex) +void CPWL_IconList::SetTopItem(int32_t nIndex) { m_pListContent->ScrollToItem(nIndex); } -FX_INT32 CPWL_IconList::GetSelect() const +int32_t CPWL_IconList::GetSelect() const { return m_pListContent->GetSelect(); } @@ -527,22 +527,22 @@ void CPWL_IconList::EnableNotify(FX_BOOL bNotify) m_pListContent->EnableNotify(bNotify); } -void CPWL_IconList::SetListData(FX_INT32 nItemIndex, void* pData) +void CPWL_IconList::SetListData(int32_t nItemIndex, void* pData) { m_pListContent->SetListData(nItemIndex, pData); } -void CPWL_IconList::SetListIcon(FX_INT32 nItemIndex, FX_INT32 nIconIndex) +void CPWL_IconList::SetListIcon(int32_t nItemIndex, int32_t nIconIndex) { m_pListContent->SetListIcon(nItemIndex, nIconIndex); } -void CPWL_IconList::SetListString(FX_INT32 nItemIndex, const CFX_WideString& str) +void CPWL_IconList::SetListString(int32_t nItemIndex, const CFX_WideString& str) { m_pListContent->SetListString(nItemIndex, str); } -CFX_WideString CPWL_IconList::GetListString(FX_INT32 nItemIndex) const +CFX_WideString CPWL_IconList::GetListString(int32_t nItemIndex) const { return m_pListContent->GetListString(nItemIndex); } @@ -581,7 +581,7 @@ FX_BOOL CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_D m_pListContent->InvalidateRect(NULL); if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar()) - pScrollBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptNew.y); + pScrollBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&ptNew.y); return TRUE; } diff --git a/fpdfsdk/src/pdfwindow/PWL_Label.cpp b/fpdfsdk/src/pdfwindow/PWL_Label.cpp index 18580f3be7..f2f3929e3f 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Label.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Label.cpp @@ -132,7 +132,7 @@ IFX_SystemHandler* pSysHandler = GetSystemHandler(); rcClip, CPDF_Point(0.0f,0.0f), pRange,pSysHandler, NULL); } -void CPWL_Label::SetHorzScale(FX_INT32 nHorzScale) +void CPWL_Label::SetHorzScale(int32_t nHorzScale) { m_pEdit->SetHorzScale(nHorzScale); } @@ -172,12 +172,12 @@ CFX_WideString CPWL_Label::GetText() const return m_pEdit->GetText(); } -void CPWL_Label::SetLimitChar(FX_INT32 nLimitChar) +void CPWL_Label::SetLimitChar(int32_t nLimitChar) { m_pEdit->SetLimitChar(nLimitChar); } -FX_INT32 CPWL_Label::GetTotalWords() +int32_t CPWL_Label::GetTotalWords() { if (m_pEdit) return m_pEdit->GetTotalWords(); diff --git a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp index 035d81959d..47c1c86123 100644 --- a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp @@ -40,7 +40,7 @@ void CPWL_List_Notify::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, Info.fSmallStep = fSmallStep; Info.fBigStep = fBigStep; - m_pList->OnNotify(m_pList,PNM_SETSCROLLINFO,SBT_VSCROLL,(FX_INTPTR)&Info); + m_pList->OnNotify(m_pList,PNM_SETSCROLLINFO,SBT_VSCROLL,(intptr_t)&Info); if (CPWL_ScrollBar * pScroll = m_pList->GetVScrollBar()) { @@ -66,7 +66,7 @@ void CPWL_List_Notify::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, void CPWL_List_Notify::IOnSetScrollPosY(FX_FLOAT fy) { - m_pList->OnNotify(m_pList,PNM_SETSCROLLPOS,SBT_VSCROLL,(FX_INTPTR)&fy); + m_pList->OnNotify(m_pList,PNM_SETSCROLLPOS,SBT_VSCROLL,(intptr_t)&fy); } void CPWL_List_Notify::IOnInvalidateRect(CPDF_Rect * pRect) @@ -139,7 +139,7 @@ void CPWL_ListBox::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream) if (m_pList) { CPDF_Rect rcPlate = m_pList->GetPlateRect(); - for (FX_INT32 i=0,sz=m_pList->GetCount(); iGetCount(); iGetItemRect(i); @@ -191,7 +191,7 @@ void CPWL_ListBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pU CPDF_Rect rcList = GetListRect(); CPDF_Rect rcClient = GetClientRect(); - for (FX_INT32 i=0,sz=m_pList->GetCount(); iGetCount(); iGetItemRect(i); if (rcItem.bottom > rcPlate.top || rcItem.top < rcPlate.bottom) continue; @@ -356,7 +356,7 @@ FX_BOOL CPWL_ListBox::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag) return TRUE; } -void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam) +void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam) { CPWL_Wnd::OnNotify(pWnd,msg,wParam,lParam); @@ -406,7 +406,7 @@ void CPWL_ListBox::KillFocus() /* if (this->IsMultipleSel()) { - for(FX_INT32 i=0;iGetCount();i++) + for(int32_t i=0;iGetCount();i++) { if (this->IsListItemSelected(i)) { @@ -496,25 +496,25 @@ FX_FLOAT CPWL_ListBox::GetFontSize() const return 0.0f; } -void CPWL_ListBox::Select(FX_INT32 nItemIndex) +void CPWL_ListBox::Select(int32_t nItemIndex) { if (m_pList) m_pList->Select(nItemIndex); } -void CPWL_ListBox::SetCaret(FX_INT32 nItemIndex) +void CPWL_ListBox::SetCaret(int32_t nItemIndex) { if (m_pList) m_pList->SetCaret(nItemIndex); } -void CPWL_ListBox::SetTopVisibleIndex(FX_INT32 nItemIndex) +void CPWL_ListBox::SetTopVisibleIndex(int32_t nItemIndex) { if (m_pList) m_pList->SetTopItem(nItemIndex); } -void CPWL_ListBox::ScrollToListItem(FX_INT32 nItemIndex) +void CPWL_ListBox::ScrollToListItem(int32_t nItemIndex) { if (m_pList) m_pList->ScrollToListItem(nItemIndex); @@ -540,7 +540,7 @@ FX_BOOL CPWL_ListBox::IsMultipleSel() const return FALSE; } -FX_INT32 CPWL_ListBox::GetCaretIndex() const +int32_t CPWL_ListBox::GetCaretIndex() const { if (m_pList) return m_pList->GetCaret(); @@ -548,7 +548,7 @@ FX_INT32 CPWL_ListBox::GetCaretIndex() const return -1; } -FX_INT32 CPWL_ListBox::GetCurSel() const +int32_t CPWL_ListBox::GetCurSel() const { if (m_pList) return m_pList->GetSelect(); @@ -556,7 +556,7 @@ FX_INT32 CPWL_ListBox::GetCurSel() const return -1; } -FX_BOOL CPWL_ListBox::IsItemSelected(FX_INT32 nItemIndex) const +FX_BOOL CPWL_ListBox::IsItemSelected(int32_t nItemIndex) const { if (m_pList) return m_pList->IsItemSelected(nItemIndex); @@ -564,7 +564,7 @@ FX_BOOL CPWL_ListBox::IsItemSelected(FX_INT32 nItemIndex) const return FALSE; } -FX_INT32 CPWL_ListBox::GetTopVisibleIndex() const +int32_t CPWL_ListBox::GetTopVisibleIndex() const { if (m_pList) { @@ -575,7 +575,7 @@ FX_INT32 CPWL_ListBox::GetTopVisibleIndex() const return -1; } -FX_INT32 CPWL_ListBox::GetCount() const +int32_t CPWL_ListBox::GetCount() const { if (m_pList) return m_pList->GetCount(); @@ -583,7 +583,7 @@ FX_INT32 CPWL_ListBox::GetCount() const return 0; } -FX_INT32 CPWL_ListBox::FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const +int32_t CPWL_ListBox::FindNext(int32_t nIndex,FX_WCHAR nChar) const { if (m_pList) return m_pList->FindNext(nIndex,nChar); diff --git a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp index 9ac18fdc63..17d842165d 100644 --- a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp @@ -55,7 +55,7 @@ void CPWL_ListCtrl::ResetFace() ResetAll(FALSE, 0); } -void CPWL_ListCtrl::ResetContent(FX_INT32 nStart) +void CPWL_ListCtrl::ResetContent(int32_t nStart) { if (nStart < 0) nStart = 0; @@ -71,7 +71,7 @@ FX_FLOAT CPWL_ListCtrl::GetContentsHeight(FX_FLOAT fLimitWidth) if (fLimitWidth > fBorderWidth* 2) { - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); iGetWindowRect().bottom - m_fItemSpace; - for (FX_INT32 i=nStart,sz=m_aChildren.GetSize(); iTransformRect(rcTemp); - FX_RECT rcClip((FX_INT32)rcTemp.left, - (FX_INT32)rcTemp.bottom, - (FX_INT32)rcTemp.right, - (FX_INT32)rcTemp.top); + FX_RECT rcClip((int32_t)rcTemp.left, + (int32_t)rcTemp.bottom, + (int32_t)rcTemp.right, + (int32_t)rcTemp.top); pDevice->SetClip_Rect(&rcClip); - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); iRestoreState(); } -FX_INT32 CPWL_ListCtrl::GetItemIndex(CPWL_Wnd* pItem) +int32_t CPWL_ListCtrl::GetItemIndex(CPWL_Wnd* pItem) { - for (FX_INT32 i=0, sz=m_aChildren.GetSize(); iGetParentWindow()) { - pParent->OnNotify(this, PNM_SETCARETINFO, (FX_INTPTR)&newInfo, 0); + pParent->OnNotify(this, PNM_SETCARETINFO, (intptr_t)&newInfo, 0); } } break; @@ -340,7 +340,7 @@ CPWL_Note_Icon::~CPWL_Note_Icon() { } -void CPWL_Note_Icon::SetIconType(FX_INT32 nType) +void CPWL_Note_Icon::SetIconType(int32_t nType) { m_nType = nType; } @@ -481,14 +481,14 @@ CPWL_NoteItem* CPWL_Note_Contents::CreateSubItem() return pNoteItem; } -FX_INT32 CPWL_Note_Contents::CountSubItems() const +int32_t CPWL_Note_Contents::CountSubItems() const { return m_aChildren.GetSize() - 1; } -IPWL_NoteItem* CPWL_Note_Contents::GetSubItems(FX_INT32 index) const +IPWL_NoteItem* CPWL_Note_Contents::GetSubItems(int32_t index) const { - FX_INT32 nIndex = index + 1; + int32_t nIndex = index + 1; if (nIndex > 0 && nIndex < m_aChildren.GetSize()) if (CPWL_Wnd* pChild = m_aChildren.GetAt(nIndex)) @@ -502,7 +502,7 @@ IPWL_NoteItem* CPWL_Note_Contents::GetSubItems(FX_INT32 index) const void CPWL_Note_Contents::DeleteSubItem(IPWL_NoteItem* pNoteItem) { - FX_INT32 nIndex = this->GetItemIndex((CPWL_NoteItem*)pNoteItem); + int32_t nIndex = this->GetItemIndex((CPWL_NoteItem*)pNoteItem); if (nIndex > 0) { @@ -513,7 +513,7 @@ void CPWL_Note_Contents::DeleteSubItem(IPWL_NoteItem* pNoteItem) delete pPWLNoteItem; } - for (FX_INT32 i=nIndex,sz=m_aChildren.GetSize(); iParentToChild(point); - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); iGetItemIndex(pWnd); + int32_t nIndex = this->GetItemIndex(pWnd); if (nIndex < 0) nIndex = 0; m_pEdit->EnableNotify(FALSE); this->ResetContent(nIndex); m_pEdit->EnableNotify(TRUE); - for (FX_INT32 i=nIndex+1, sz=m_aChildren.GetSize(); iOnNotify(this, PNM_NOTERESET, 0, 0); @@ -586,7 +586,7 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam if (CPWL_Wnd * pParent = this->GetParentWindow()) { - pParent->OnNotify(this, PNM_SETCARETINFO, (FX_INTPTR)&newInfo, 0); + pParent->OnNotify(this, PNM_SETCARETINFO, (intptr_t)&newInfo, 0); } } return; @@ -596,7 +596,7 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam this->ResetContent(0); m_pEdit->EnableNotify(TRUE); - for (FX_INT32 i=1, sz=m_aChildren.GetSize(); iOnNotify(this, PNM_NOTERESET, 0, 0); @@ -645,7 +645,7 @@ void CPWL_Note_Contents::EnableModify(FX_BOOL bEnabled) else m_pEdit->RemoveFlag(PWS_READONLY); - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); iRemoveFlag(PES_NOREAD); - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); iCountSubItems(); @@ -974,7 +974,7 @@ FX_INT32 CPWL_NoteItem::CountSubItems() const return 0; } -IPWL_NoteItem* CPWL_NoteItem::GetSubItems(FX_INT32 index) const +IPWL_NoteItem* CPWL_NoteItem::GetSubItems(int32_t index) const { if (m_pContents) return m_pContents->GetSubItems(index); @@ -1095,7 +1095,7 @@ FX_BOOL CPWL_NoteItem::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag) return CPWL_Wnd::OnRButtonUp(point,nFlag); } -void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam) +void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam) { switch (msg) { @@ -1117,7 +1117,7 @@ void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_ if (CPWL_Wnd * pParent = this->GetParentWindow()) { - pParent->OnNotify(this, PNM_SETCARETINFO, (FX_INTPTR)&newInfo, 0); + pParent->OnNotify(this, PNM_SETCARETINFO, (intptr_t)&newInfo, 0); } } return; @@ -1135,7 +1135,7 @@ void CPWL_NoteItem::PopupNoteItemMenu(const CPDF_Point& point) { if (IPWL_NoteNotify* pNotify = GetNoteNotify()) { - FX_INT32 x,y; + int32_t x,y; PWLtoWnd(point, x, y); if (IFX_SystemHandler* pSH = GetSystemHandler()) pSH->ClientToScreen(GetAttachedHWnd(), x, y); @@ -1247,7 +1247,7 @@ void CPWL_Note::RePosChildWnd() } } //CPDF_Point ptNew = m_pContents->GetScrollPos(); - //m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptNew.y); + //m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&ptNew.y); } FX_BOOL CPWL_Note::ResetScrollBar() @@ -1420,7 +1420,7 @@ void CPWL_Note::RePosNoteChildren() } //0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close / 5-options -FX_INT32 CPWL_Note::NoteHitTest(const CPDF_Point& point) const +int32_t CPWL_Note::NoteHitTest(const CPDF_Point& point) const { ASSERT(m_pSubject != NULL); ASSERT(m_pDateTime != NULL); @@ -1570,8 +1570,8 @@ FX_BOOL CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD if (ptNew.y != ptScroll.y) { m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0); - m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&ptNew.y); - m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptNew.y); + m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (intptr_t)&ptNew.y); + m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&ptNew.y); return TRUE; } @@ -1580,7 +1580,7 @@ FX_BOOL CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD return FALSE; } -void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam) +void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam) { switch (msg) { @@ -1615,7 +1615,7 @@ void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTP { if (m_pContentsBar->IsVisible()) { - m_pContentsBar->OnNotify(pWnd, PNM_SETSCROLLINFO, SBT_VSCROLL, (FX_INTPTR)&sInfo); + m_pContentsBar->OnNotify(pWnd, PNM_SETSCROLLINFO, SBT_VSCROLL, (intptr_t)&sInfo); m_OldScrollInfo = sInfo; CPDF_Point ptScroll = m_pContents->GetScrollPos(); @@ -1630,9 +1630,9 @@ void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTP if (ptOld.y != ptScroll.y) { - m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y); + m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&ptScroll.y); m_pContentsBar->InvalidateRect(NULL); - m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y); + m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (intptr_t)&ptScroll.y); } } } @@ -1662,10 +1662,10 @@ void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTP if (pInfo->ptHead.y > rcClient.top) { CPDF_Point pt = m_pContents->OutToIn(pInfo->ptHead); - m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&pt.y); + m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (intptr_t)&pt.y); CPDF_Point ptScroll = m_pContents->GetScrollPos(); - m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y); + m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&ptScroll.y); return; } @@ -1674,10 +1674,10 @@ void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTP { CPDF_Point pt = m_pContents->OutToIn(pInfo->ptFoot); pt.y += rcClient.Height(); - m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&pt.y); + m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (intptr_t)&pt.y); CPDF_Point ptScroll = m_pContents->GetScrollPos(); - m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y); + m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&ptScroll.y); return; } @@ -1717,7 +1717,7 @@ FX_BOOL CPWL_Note::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { if (IPWL_NoteNotify* pNotify = this->GetNoteNotify()) { - FX_INT32 x, y; + int32_t x, y; PWLtoWnd(point, x, y); if (IFX_SystemHandler* pSH = GetSystemHandler()) pSH->ClientToScreen(GetAttachedHWnd(), x, y); @@ -1749,7 +1749,7 @@ IPWL_NoteNotify* CPWL_Note::GetNoteNotify() const return NULL; } -void CPWL_Note::SetIconType(FX_INT32 nType) +void CPWL_Note::SetIconType(int32_t nType) { if (m_pIcon) m_pIcon->SetIconType(nType); diff --git a/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp index 772e184902..ad293bc578 100644 --- a/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp @@ -281,7 +281,7 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* p if (rectWnd.IsEmpty()) return; CPDF_Point ptCenter = this->GetCenterPoint(); - FX_INT32 nTransparancy = this->GetTransparency(); + int32_t nTransparancy = this->GetTransparency(); switch (this->m_eScrollBarType) { @@ -570,7 +570,7 @@ FX_BOOL CPWL_SBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag) CPWL_Wnd::OnLButtonDown(point,nFlag); if (CPWL_Wnd * pParent = GetParentWindow()) - pParent->OnNotify(this,PNM_LBUTTONDOWN,0,(FX_INTPTR)&point); + pParent->OnNotify(this,PNM_LBUTTONDOWN,0,(intptr_t)&point); m_bMouseDown = TRUE; SetCapture(); @@ -583,7 +583,7 @@ FX_BOOL CPWL_SBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag) CPWL_Wnd::OnLButtonUp(point,nFlag); if (CPWL_Wnd * pParent = GetParentWindow()) - pParent->OnNotify(this,PNM_LBUTTONUP,0,(FX_INTPTR)&point); + pParent->OnNotify(this,PNM_LBUTTONUP,0,(intptr_t)&point); m_bMouseDown = FALSE; ReleaseCapture(); @@ -597,12 +597,12 @@ FX_BOOL CPWL_SBButton::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag) if (CPWL_Wnd * pParent = GetParentWindow()) { - pParent->OnNotify(this,PNM_MOUSEMOVE,0,(FX_INTPTR)&point); + pParent->OnNotify(this,PNM_MOUSEMOVE,0,(intptr_t)&point); /* if (m_bMouseDown && (m_eSBButtonType == PSBT_MIN || m_eSBButtonType == PSBT_MAX)) { - if (!pParent->OnNotify(this,PNM_LBUTTONDOWN,nFlags,(FX_INTPTR)&point)) + if (!pParent->OnNotify(this,PNM_LBUTTONDOWN,nFlags,(intptr_t)&point)) return FALSE; } */ @@ -840,7 +840,7 @@ FX_BOOL CPWL_ScrollBar::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag) return TRUE; } -void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam) +void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam) { CPWL_Wnd::OnNotify(pWnd,msg,wParam,lParam); @@ -1214,7 +1214,7 @@ void CPWL_ScrollBar::NotifyScrollWindow() fPos = m_OriginInfo.fContentMax - m_sData.fScrollPos; break; } - pParent->OnNotify(this,PNM_SCROLLWINDOW,(FX_INTPTR)m_sbType,(FX_INTPTR)&fPos); + pParent->OnNotify(this,PNM_SCROLLWINDOW,(intptr_t)m_sbType,(intptr_t)&fPos); } } diff --git a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp index 5d79ce9cab..fe07630057 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp @@ -42,8 +42,8 @@ void CPWL_Signature_Image::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Ma FX_FLOAT x, y; pUser2Device->Transform(rcClient.left, rcClient.top, x, y); - pDevice->StretchDIBits(m_pImage, (FX_INT32)x, (FX_INT32)y, - (FX_INT32)rcClient.Width(), (FX_INT32)rcClient.Height()); + pDevice->StretchDIBits(m_pImage, (int32_t)x, (int32_t)y, + (int32_t)rcClient.Width(), (int32_t)rcClient.Height()); } } diff --git a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp index b57f8e019d..884807364e 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp @@ -16,11 +16,11 @@ /* ---------------------------- CPWL_Utils ------------------------------ */ -CFX_ByteString CPWL_Utils::GetAppStreamFromArray(const CPWL_PathData* pPathData, FX_INT32 nCount) +CFX_ByteString CPWL_Utils::GetAppStreamFromArray(const CPWL_PathData* pPathData, int32_t nCount) { CFX_ByteTextBuf csAP; - for (FX_INT32 i=0; i= 5) nNext -= 5; @@ -476,7 +476,7 @@ static CFX_ByteString GetSquigglyAppearanceStream(FX_FLOAT fStartX, FX_FLOAT fEn sRet << "0 w\n" << fStartX << " " << fY << " m\n"; FX_FLOAT fx; - FX_INT32 i; + int32_t i; for (i=1,fx=fStartX+fStep; fxDrawPath(&path, pUser2Device, NULL, color, 0, FXFILL_ALTERNATE); @@ -1468,14 +1468,14 @@ void CPWL_Utils::DrawStrokeLine(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2De } void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,const CPDF_Rect & rect, - const CPWL_Color & color, FX_INT32 nTransparancy) + const CPWL_Color & color, int32_t nTransparancy) { CPWL_Utils::DrawFillRect(pDevice,pUser2Device,rect,PWLColorToFXColor(color,nTransparancy)); } void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, FX_BOOL bVertical, FX_BOOL bHorizontal, CPDF_Rect rect, - FX_INT32 nTransparancy, FX_INT32 nStartGray, FX_INT32 nEndGray) + int32_t nTransparancy, int32_t nStartGray, int32_t nEndGray) { FX_FLOAT fStepGray = 1.0f; @@ -1485,7 +1485,7 @@ void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device for (FX_FLOAT fy=rect.bottom+0.5f; fy<=rect.top-0.5f; fy+=1.0f) { - FX_INT32 nGray = nStartGray + (FX_INT32)(fStepGray * (fy-rect.bottom)); + int32_t nGray = nStartGray + (int32_t)(fStepGray * (fy-rect.bottom)); CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, CPDF_Point(rect.left, fy), CPDF_Point(rect.right, fy), ArgbEncode(nTransparancy, nGray, nGray, nGray), 1.5f); } @@ -1497,7 +1497,7 @@ void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device for (FX_FLOAT fx=rect.left+0.5f; fx<=rect.right-0.5f; fx+=1.0f) { - FX_INT32 nGray = nStartGray + (FX_INT32)(fStepGray * (fx-rect.left)); + int32_t nGray = nStartGray + (int32_t)(fStepGray * (fx-rect.left)); CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, CPDF_Point(fx, rect.bottom), CPDF_Point(fx, rect.top), ArgbEncode(nTransparancy, nGray, nGray, nGray), 1.5f); } @@ -1507,7 +1507,7 @@ void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, const CPDF_Rect & rect, FX_FLOAT fWidth, const CPWL_Color & color, const CPWL_Color & crLeftTop, const CPWL_Color & crRightBottom, - FX_INT32 nStyle, const CPWL_Dash & dash, FX_INT32 nTransparancy) + int32_t nStyle, const CPWL_Dash & dash, int32_t nTransparancy) { FX_FLOAT fLeft = rect.left; FX_FLOAT fRight = rect.right; @@ -1622,7 +1622,7 @@ static void AddSquigglyPath(CFX_PathData & PathData, FX_FLOAT fStartX, FX_FLOAT PathData.SetPoint(PathData.GetPointCount() - 1, fStartX, fY, FXPT_MOVETO); FX_FLOAT fx; - FX_INT32 i; + int32_t i; for (i=1,fx=fStartX+fStep; fxTransformRect(rcTemp); FX_RECT rcDevClip; - rcDevClip.left = (FX_INT32)rcTemp.left; - rcDevClip.right = (FX_INT32)rcTemp.right; - rcDevClip.top = (FX_INT32)rcTemp.top; - rcDevClip.bottom = (FX_INT32)rcTemp.bottom; + rcDevClip.left = (int32_t)rcTemp.left; + rcDevClip.right = (int32_t)rcTemp.right; + rcDevClip.top = (int32_t)rcTemp.top; + rcDevClip.bottom = (int32_t)rcTemp.bottom; pDevice->SetClip_Rect(&rcDevClip); } @@ -1848,7 +1848,7 @@ CPWL_Color CPWL_Utils::GetReverseColor(const CPWL_Color& color) return crRet; } -CFX_ByteString CPWL_Utils::GetIconAppStream(FX_INT32 nType, const CPDF_Rect& rect, const CPWL_Color& crFill, +CFX_ByteString CPWL_Utils::GetIconAppStream(int32_t nType, const CPDF_Rect& rect, const CPWL_Color& crFill, const CPWL_Color& crStroke) { CFX_ByteString sAppStream = CPWL_Utils::GetColorAppStream(crStroke, FALSE); @@ -1931,7 +1931,7 @@ CFX_ByteString CPWL_Utils::GetIconAppStream(FX_INT32 nType, const CPDF_Rect& rec } void CPWL_Utils::DrawIconAppStream(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, - FX_INT32 nType, const CPDF_Rect & rect, const CPWL_Color& crFill, const CPWL_Color& crStroke, const FX_INT32 nTransparancy) + int32_t nType, const CPDF_Rect & rect, const CPWL_Color& crFill, const CPWL_Color& crStroke, const int32_t nTransparancy) { CFX_GraphStateData gsd; gsd.m_LineWidth = 1.0f; @@ -2477,7 +2477,7 @@ void CPWL_Utils::GetGraphics_Star(CFX_ByteString& sPathData, CFX_PathData& path, FX_FLOAT fAngel = PWL_PI/10.0f; - for (FX_INT32 i=0; i<5; i++) + for (int32_t i=0; i<5; i++) { px1[i] = ptCenter.x + fLongRadius * (FX_FLOAT)cos(fAngel); py1[i] = ptCenter.y + fLongRadius * (FX_FLOAT)sin(fAngel); @@ -2487,7 +2487,7 @@ void CPWL_Utils::GetGraphics_Star(CFX_ByteString& sPathData, CFX_PathData& path, fAngel = PWL_PI/5.0f + PWL_PI/10.0f; - for (FX_INT32 j=0; j<5; j++) + for (int32_t j=0; j<5; j++) { px2[j] = ptCenter.x + fShortRadius * (FX_FLOAT)cos(fAngel); py2[j] = ptCenter.y + fShortRadius * (FX_FLOAT)sin(fAngel); @@ -2499,7 +2499,7 @@ void CPWL_Utils::GetGraphics_Star(CFX_ByteString& sPathData, CFX_PathData& path, PathArray[0] = CPWL_PathData(CPWL_Point(px1[0], py1[0]), PWLPT_MOVETO); PathArray[1] = CPWL_PathData(CPWL_Point(px2[0], py2[0]), PWLPT_LINETO); - for(FX_INT32 k = 0; k < 4; k++) + for(int32_t k = 0; k < 4; k++) { PathArray[(k+1)*2] = CPWL_PathData(CPWL_Point(px1[k+1], py1[k+1]), PWLPT_LINETO); PathArray[(k+1)*2 + 1] = CPWL_PathData(CPWL_Point(px2[k+1], py2[k+1]), PWLPT_LINETO); @@ -2795,7 +2795,7 @@ void CPWL_Utils::GetGraphics_Foxit(CFX_ByteString& sPathData, CFX_PathData& path GetPathDataFromArray(path, PathArray, 23); } -void CPWL_Color::ConvertColorType(FX_INT32 nColorType) +void CPWL_Color::ConvertColorType(int32_t nColorType) { switch (this->nColorType) { diff --git a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp index 69535d7d85..c621508885 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp @@ -11,10 +11,10 @@ /* -------------------------- CPWL_Timer -------------------------- */ -static CFX_MapPtrTemplate& GetPWLTimeMap() +static CFX_MapPtrTemplate& GetPWLTimeMap() { // Leak the object at shutdown. - static auto timeMap = new CFX_MapPtrTemplate; + static auto timeMap = new CFX_MapPtrTemplate; return *timeMap; } @@ -32,7 +32,7 @@ CPWL_Timer::~CPWL_Timer() KillPWLTimer(); } -FX_INT32 CPWL_Timer::SetPWLTimer(FX_INT32 nElapse) +int32_t CPWL_Timer::SetPWLTimer(int32_t nElapse) { if (m_nTimerID != 0) KillPWLTimer(); m_nTimerID = m_pSystemHandler->SetTimer(nElapse, TimerProc); @@ -50,7 +50,7 @@ void CPWL_Timer::KillPWLTimer() } } -void CPWL_Timer::TimerProc(FX_INT32 idEvent) +void CPWL_Timer::TimerProc(int32_t idEvent) { CPWL_Timer* pTimer = NULL; if (GetPWLTimeMap().Lookup(idEvent, pTimer)) @@ -74,7 +74,7 @@ CPWL_TimerHandler::~CPWL_TimerHandler() if (m_pTimer) delete m_pTimer; } -void CPWL_TimerHandler::BeginTimer(FX_INT32 nElapse) +void CPWL_TimerHandler::BeginTimer(int32_t nElapse) { if (!m_pTimer) m_pTimer = new CPWL_Timer(this, GetSystemHandler()); @@ -134,7 +134,7 @@ public: FX_BOOL IsWndCaptureMouse(const CPWL_Wnd * pWnd) const { if (pWnd) - for( FX_INT32 i=0,sz=m_aMousePath.GetSize(); i= 0; i --) + for (int32_t i = m_aChildren.GetSize()-1; i >= 0; i --) { if (CPWL_Wnd * pChild = m_aChildren[i]) { @@ -355,7 +355,7 @@ void CPWL_Wnd::InvalidateRectMove(const CPDF_Rect & rcOld, const CPDF_Rect & rc CPDF_Rect SubArray[4]; rcOld.Substract4(rcNew,SubArray); - for (FX_INT32 i=0;i<4;i++) + for (int32_t i=0;i<4;i++) { if (SubArray[i].left == 0 && SubArray[i].right == 0 && @@ -366,7 +366,7 @@ void CPWL_Wnd::InvalidateRectMove(const CPDF_Rect & rcOld, const CPDF_Rect & rc } rcNew.Substract4(rcOld,SubArray); - for (FX_INT32 j=0;j<4;j++) + for (int32_t j=0;j<4;j++) { if (SubArray[j].left == 0 && SubArray[j].right == 0 && @@ -423,7 +423,7 @@ void CPWL_Wnd::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream) void CPWL_Wnd::GetChildAppearanceStream(CFX_ByteTextBuf & sAppStream) { - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i= 0; i --) + for (int32_t i = m_aChildren.GetSize()-1; i >= 0; i --) { if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) { @@ -634,7 +634,7 @@ void CPWL_Wnd::RemoveChild(CPWL_Wnd * pWnd) } } -void CPWL_Wnd::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam) +void CPWL_Wnd::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam) { switch (msg) { @@ -753,18 +753,18 @@ CPWL_Color CPWL_Wnd::GetTextStrokeColor() const return m_sPrivateParam.sTextStrokeColor; } -FX_INT32 CPWL_Wnd::GetBorderStyle() const +int32_t CPWL_Wnd::GetBorderStyle() const { return m_sPrivateParam.nBorderStyle; } -void CPWL_Wnd::SetBorderStyle(FX_INT32 nBorderStyle) +void CPWL_Wnd::SetBorderStyle(int32_t nBorderStyle) { if (HasFlag(PWS_BORDER)) m_sPrivateParam.nBorderStyle = nBorderStyle; } -FX_INT32 CPWL_Wnd::GetBorderWidth() const +int32_t CPWL_Wnd::GetBorderWidth() const { if (HasFlag(PWS_BORDER)) return m_sPrivateParam.dwBorderWidth; @@ -772,7 +772,7 @@ FX_INT32 CPWL_Wnd::GetBorderWidth() const return 0; } -FX_INT32 CPWL_Wnd::GetInnerBorderWidth() const +int32_t CPWL_Wnd::GetInnerBorderWidth() const { /* switch (GetBorderStyle()) @@ -785,7 +785,7 @@ FX_INT32 CPWL_Wnd::GetInnerBorderWidth() const return 0; } -void CPWL_Wnd::SetBorderWidth(FX_INT32 nBorderWidth) +void CPWL_Wnd::SetBorderWidth(int32_t nBorderWidth) { if (HasFlag(PWS_BORDER)) m_sPrivateParam.dwBorderWidth = nBorderWidth; @@ -861,7 +861,7 @@ void CPWL_Wnd::SetCapture() void CPWL_Wnd::ReleaseCapture() { - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); iReleaseCapture(); @@ -918,7 +918,7 @@ void CPWL_Wnd::SetVisible(FX_BOOL bVisible) { if (IsValid()) { - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); iGetCreationParam().eCursorType; + int32_t nCursorType = this->GetCreationParam().eCursorType; pSH->SetCursor(nCursorType); } } @@ -1063,7 +1063,7 @@ IFX_Edit_FontMap* CPWL_Wnd::GetFontMap() const return m_sPrivateParam.pFontMap; } -CPWL_Color CPWL_Wnd::GetBorderLeftTopColor(FX_INT32 nBorderStyle) const +CPWL_Color CPWL_Wnd::GetBorderLeftTopColor(int32_t nBorderStyle) const { CPWL_Color color; @@ -1086,7 +1086,7 @@ CPWL_Color CPWL_Wnd::GetBorderLeftTopColor(FX_INT32 nBorderStyle) const return color; } -CPWL_Color CPWL_Wnd::GetBorderRightBottomColor(FX_INT32 nBorderStyle) const +CPWL_Color CPWL_Wnd::GetBorderRightBottomColor(int32_t nBorderStyle) const { CPWL_Color color; @@ -1111,14 +1111,14 @@ CPWL_Color CPWL_Wnd::GetBorderRightBottomColor(FX_INT32 nBorderStyle) const /* ----------------------------------------------------------------- */ -FX_INT32 CPWL_Wnd::GetTransparency() +int32_t CPWL_Wnd::GetTransparency() { return m_sPrivateParam.nTransparency; } -void CPWL_Wnd::SetTransparency(FX_INT32 nTransparency) +void CPWL_Wnd::SetTransparency(int32_t nTransparency) { - for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i